* [PATCH 0/5] staging: rts5208: clean up coding style in rtsx_chip.c
@ 2014-10-03 20:27 Giedrius Statkevicius
0 siblings, 0 replies; 3+ messages in thread
From: Giedrius Statkevicius @ 2014-10-03 20:27 UTC (permalink / raw)
To: gregkh; +Cc: micky_ching, fabio.falzoi84, devel, linux-kernel
From: Giedrius Statkevičius <giedrius.statkevicius@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 format of: 'if (a) { b = foo1; } else { b = foo2; }'
Make the names of labels all lower case to avoid Camel Case.
Remove unnecessary parantheses around variables that are after a dereference operator like this: '&(a) => &a'
Switch the if condition around in 'if (0 == (value & (1 << bit))) {' to make it have the same form as the rest of the code.
After this patch checkpatch.pl without --strict doesn't complain about rtsx_chip.c at all and with --strict it only complains about the unmatched parantheses. I am reluctant to move that code with unmatched parantheses into another function to lower the indentation level because I don't have the hardware needed to test this driver and don't have enough experience to do it properly. Doing so would just probably hide the other problems this code has. My patch is purely about changing the code style without creating more functions and moving code to them.
This patch is against Greg KH's staging-next tree.
Giedrius Statkevičius (5):
Combine ifs into one where possible to avoid unnecessary indentation
level increase
Convert Camel Case labels to lower case, remove unnecessary
parantheses after a dereference operator and remove empty lines
before }
Align lines of divided lines to the opening paranthesis where
possible
Divide lines to make them less than 80 characters long, align to the
opening paranthesis where possible
Use ternary operators where possible and sensible to avoid unnecessary
increase of indentation level
drivers/staging/rts5208/rtsx_chip.c | 322 +++++++++++++++---------------------
1 file changed, 136 insertions(+), 186 deletions(-)
--
2.1.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 0/5] staging: rts5208: clean up coding style in rtsx_chip.c
@ 2014-10-03 21:31 Giedrius Statkevicius
0 siblings, 0 replies; 3+ messages in thread
From: Giedrius Statkevicius @ 2014-10-03 21:31 UTC (permalink / raw)
To: gregkh; +Cc: micky_ching, fabio.falzoi84, devel, linux-kernel
From: Giedrius Statkevičius <giedrius.statkevicius@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 places where I can't fix them because I don't
have the hardware to test the bigger changes nor do I have enough
experience to make such bigger changes flawlessly.
Giedrius Statkevičius (5):
staging: rts5208: combine ifs where possible
staging: rts5208: get rid of Camel Case, remove unneeded lines and
parantheses
staging: rts5208: align divided lines to opening paranthesis
staging: rts5208: divide lines to make them less than 80 characters
long
staging: rts5208: use ternary operators to reduce indentation level
drivers/staging/rts5208/rtsx_chip.c | 322 +++++++++++++++---------------------
1 file changed, 136 insertions(+), 186 deletions(-)
--
2.1.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 0/5] staging: rts5208: clean up coding style in rtsx_chip.c
@ 2014-10-03 21:53 Giedrius Statkevicius
0 siblings, 0 replies; 3+ messages in thread
From: Giedrius Statkevicius @ 2014-10-03 21:53 UTC (permalink / raw)
To: gregkh; +Cc: micky_ching, fabio.falzoi84, devel, linux-kernel
From: Giedrius Statkevičius <giedrius.statkevicius@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 places where I can't fix them because I don't
have the hardware to test the bigger changes nor do I have enough
experience to make such bigger changes flawlessly.
(Sorry for littering the mailing list. You can delete my other threads.
I somehow accidentaly managed to reply to my older thread. This is
really embarassing.)
Giedrius Statkevičius (5):
staging: rts5208: combine ifs where possible
staging: rts5208: get rid of Camel Case, remove unneeded lines and
parantheses
staging: rts5208: align divided lines to opening paranthesis
staging: rts5208: divide lines to make them less than 80 characters
long
staging: rts5208: use ternary operators to reduce indentation level
drivers/staging/rts5208/rtsx_chip.c | 322 +++++++++++++++---------------------
1 file changed, 136 insertions(+), 186 deletions(-)
--
2.1.2
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-10-03 21:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-03 21:53 [PATCH 0/5] staging: rts5208: clean up coding style in rtsx_chip.c Giedrius Statkevicius
-- strict thread matches above, loose matches on Subject: below --
2014-10-03 21:31 Giedrius Statkevicius
2014-10-03 20:27 Giedrius Statkevicius
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).