[linux-dvb] [PATCH 2/2] mxl500x: debug module param and checkpatch.pl compliance
Andy Walls
awalls at radix.net
Sun Apr 27 02:35:41 CEST 2008
Patch 2/2: checkpatch.pl compliance for mxl500x
This patch implements checkpatch.pl compliance for mxl500x source files,
out of tree, using the v4l/scripts/checkpatch.pl scripts v 0.14.
The command
$ find . -name "mxl500*" \
-exec ../v4l/scripts/checkpatch.pl -q --summary-file --notree --terse --file {} \; \
| sed 's/:[0-9]*:/:/' | sort | uniq -c
initially returned:
1 ./drivers/media/dvb/frontends/mxl500x.c: ERROR: do not use assignment in if condition
44 ./drivers/media/dvb/frontends/mxl500x.c: ERROR: do not use C99 // comments
1 ./drivers/media/dvb/frontends/mxl500x.c: ERROR: need a space before the open parenthesis '('
7 ./drivers/media/dvb/frontends/mxl500x.c: ERROR: need space after that ',' (ctx:VxV)
1 ./drivers/media/dvb/frontends/mxl500x.c total: 53 errors, 111 warnings, 1254 lines checked
1 ./drivers/media/dvb/frontends/mxl500x.c: WARNING: braces {} are not necessary for single statement blocks
107 ./drivers/media/dvb/frontends/mxl500x.c: WARNING: line over 80 characters
3 ./drivers/media/dvb/frontends/mxl500x.c: WARNING: no space between function name and open parenthesis '('
1 ./drivers/media/dvb/frontends/mxl500x.h: ERROR: do not use C99 // comments
1 ./drivers/media/dvb/frontends/mxl500x.h total: 1 errors, 2 warnings, 109 lines checked
2 ./drivers/media/dvb/frontends/mxl500x.h: WARNING: line over 80 characters
1 ./drivers/media/dvb/frontends/mxl500x_reg.h: ERROR: do not use C99 // comments
1 ./drivers/media/dvb/frontends/mxl500x_reg.h total: 1 errors, 9 warnings, 494 lines checked
9 ./drivers/media/dvb/frontends/mxl500x_reg.h: WARNING: line over 80 characters
but now all warnings and errors are cleaned up. (If you use the
--strict switch you'll see two "#if 0"'s I had to add to convert a bunch
of C99 comments to a mix of c89 comments and code that shouldn't be
run.)
Although I have reviewed and tested the changes, I really need another
set of eyes to check some things:
1. The macros in mxl500x_reg.h were long and used a few identical, hard
to parse (for a human) idioms. I used 3 new helper macros to get them
into a shorter, (subjectively) more readable form. Please check that
nothing got lost in the translation. Does anyone object that I changed
them in that way?
2. The MXL500x_SET_MAP macro in mxl500x.c was brought into compliance
with Documentation/CodingStyle and now calls the MXL500x_SETFIELD macro
in mxl500x_reg.h. Again, please make sure I didn't lose anything in the
translation.
3. There are 2 "#if 0" blocks in mxl500x.c for mixed code/comments that
I didn't know if I should get rid of. Please tell me if there was a
more acceptable way of commenting out those lines, or if they can be
removed all together.
4. When doing the cleanup, I noticed some apparent "MXL500x_DC1" to
"DC2_DN_" mismatches. You can see some in the patch. Can anyone
confirm that this is correct?
Regards,
Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mxl500x-checkpatch-cleanup.patch
Type: text/x-patch
Size: 38970 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20080426/7ca9c2d0/attachment-0001.bin
More information about the linux-dvb
mailing list