[PATCH 2/3] staging: dgnc: remove redundant check

2015-04-05 Thread Giedrius Statkevicius
count doesn't change between the last check a few lines before so remove this redundant check Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com --- drivers/staging/dgnc/dgnc_tty.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c

[PATCH 3/3] staging: dgnc: improve the coding style in unlocking part of dgnc_tty_write()

2015-04-05 Thread Giedrius Statkevicius
do if (blah) foo(); bar(); instead of if (blah) { foo(); bar(); } else { bar(); } Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com --- drivers/staging/dgnc/dgnc_tty.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git

[PATCH 1/3] staging: dgnc: use a real mutex instead of masquerading a semaphore as a mutex

2015-04-05 Thread Giedrius Statkevicius
A mutex should be used here (and it's name even says that) so remove the hiding of a semaphore behind a #define and use a real mutex that the kernel provides. Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com --- drivers/staging/dgnc/dgnc_tty.c | 12 1 file

[PATCH 1/2] staging: dgnc: remove dead code in dgnc_tty_write()

2015-04-05 Thread Giedrius Statkevicius
Remove the dead code protected by in_user in dgnc_tty_write() because it is set to 0 and never changed to 1 thus the code in ifs never gets executed. Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com --- v2: Just remove the dead code protected by in_user and join the first and

[PATCH 2/2] staging: dgnc: remove redundant check

2015-04-05 Thread Giedrius Statkevicius
count doesn't get changed in between identical checks in dgnc_tty_write() so remove the second check Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com --- v2: no change drivers/staging/dgnc/dgnc_tty.c | 6 -- 1 file changed, 6 deletions(-) diff --git

[PATCH] staging: lustre: Fix sparse warnings for lnet/lnet/router.c

2014-11-23 Thread Giedrius Statkevicius
it be static? Signed-off-by: Giedrius Statkevicius giedriusw...@gmail.com --- drivers/staging/lustre/lnet/lnet/router.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index

Re: [PATCH 0/2] Staging: rts5208: rtsx_reset_chip style clean up

2014-10-19 Thread Giedrius Statkevicius
On 2014.10.19 12:55, Fabio Falzoi wrote: Clean up the code in rtsx_reset_chip function defining two new helper functions rtsx_reset_aspm and rtsx_enable_pcie_intr. Specifically, the following checkpatch warnings are corrected: * PARENTHESIS_ALIGNMENT at rows 271, 302, 343 and 346 * LONG_LINE

[PATCH v3] staging: rts5208: Clean up coding style in rtsx_chip.c

2014-10-03 Thread Giedrius Statkevicius
is against Greg KH's staging-next tree. Signed-off-by: Giedrius Statkevicius giedrius.statkevic...@gmail.com --- Changes in v3: - Change blocks that have form of if (a) { b = 1; } else { b = 0; } to 'b = a ? 1 : 0;' and use ternary operator other where possible and sensible to reduce

[PATCH 1/5] Combine ifs into one where possible to avoid unnecessary indentation level increase

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Join together chained if's where possible to lower the indentation level. Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com --- drivers/staging/rts5208/rtsx_chip.c | 100 1 file

[PATCH 4/5] Divide lines to make them less than 80 characters long, align to the opening paranthesis where possible

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Make a couple of lines shorter than the max limit by diving them and also make sure to align them properly where possible. Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com --- drivers/staging/rts5208/rtsx_chip.c |

[PATCH 0/5] staging: rts5208: clean up coding style in rtsx_chip.c

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Align divided lines to the first line's opening paranthesis Where two or more if's are in form 'if (a) if (b) { [...] }' convert them into one to lower the indentation level. Use the ternary operator in places where there is code in

[PATCH 2/5] Convert Camel Case labels to lower case, remove unnecessary parantheses after a dereference operator and remove empty lines before }

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Convert labels from Camel Case to lower case, remove unnecessary parantheses around operands of dereference operators and remove unneeded empty lines before }. Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com ---

[PATCH 3/5] Align lines of divided lines to the opening paranthesis where possible

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Make all divided lines aligned to the opening paranthesis Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com --- drivers/staging/rts5208/rtsx_chip.c | 87 +++-- 1 file changed, 45

[PATCH 5/5] Use ternary operators where possible and sensible to avoid unnecessary increase of indentation level

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Convert code in format of if (a) if(b) { [...] } to one line with a simple ternary operation to avoid unnecesary increase of indentation level. Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com ---

[PATCH 5/5] staging: rts5208: use ternary operators to reduce indentation level

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Convert code in format of if (a) if(b) { [...] } to one line with a simple ternary operation to avoid unnecesary increase of indentation level. Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com ---

[PATCH 4/5] staging: rts5208: divide lines to make them less than 80 characters long

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Make a couple of lines shorter than the max limit by diving them and also make sure to align them properly where possible. Signed-off-by: Giedrius Statkevičius giedrius.statkevic...@gmail.com --- drivers/staging/rts5208/rtsx_chip.c |

[PATCH 1/5] staging: rts5208: combine ifs where possible

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Join together chained if's where possible to lower the indentation level. In a lot of places of this code the indentation level is already very high. As a result, this patch increases the code flow and readability. Signed-off-by:

[PATCH 2/5] staging: rts5208: get rid of Camel Case, remove unneeded lines and parantheses

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Convert labels from Camel Case to lower case, remove unnecessary parantheses around operands of dereference operators and remove unneeded empty lines before }. Gets rid of a checkpatch.pl check that code should avoid Camel Case, also

[PATCH 3/5] staging: rts5208: align divided lines to opening paranthesis

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com Make all divided lines aligned to the opening paranthesis. Basically makes all lines aligned to the opening paranthesis to make the code more readable and it also gets rid of a lot of checkpatch.pl checks. Signed-off-by: Giedrius

[PATCH 0/5] staging: rts5208: clean up coding style in rtsx_chip.c

2014-10-03 Thread Giedrius Statkevicius
From: Giedrius Statkevičius giedrius.statkevic...@gmail.com This patch set is a general code style clean up for rtsx_chip.c. After this patch set checkpatch.pl without --strict doesn't complain anything about at all and with --strict it only complains about unmatched parantheses in those few

[PATCH v2] staging: rts5208: Clean up coding style in rtsx_chip.c to get rid of checkpatch.pl warnings and combine two ifs into one

2014-10-02 Thread Giedrius Statkevicius
reports these errors as: 'WARNING: void function return statements are not generally useful' Lastly it combines two if statements into one in rtsx_reset_chip() Patch is against Greg KH's staging-next tree. Signed-off-by: Giedrius Statkevicius giedrius.statkevic...@gmail.com --- Changes in v2

Re: [PATCH v2] staging: rts5208: Clean up coding style in rtsx_chip.c to get rid of checkpatch.pl warnings and combine two ifs into one

2014-10-02 Thread Giedrius Statkevicius
On 2014.10.02 14:45, Joe Perches wrote: On Thu, 2014-10-02 at 14:13 +0300, Giedrius Statkevicius wrote: Fix 10 occurences of coding style errors where the line exceeds 80 characters by breaking them into more lines. Checkpatch.pl reports these errors as: 'WARNING: line over 80 characters

[PATCH] staging: rts5208: Clean up coding style in rtsx_chip.c to get rid of checkpatch.pl warnings

2014-10-01 Thread Giedrius Statkevicius
reports these errors as: 'WARNING: void function return statements are not generally useful' Patch is against Greg KH's staging-next tree. Signed-off-by: Giedrius Statkevicius giedrius.statkevic...@gmail.com --- drivers/staging/rts5208/rtsx_chip.c | 40 - 1 file