Re: [PATCH V2 4/9] [media] dvb-core/dvb_ca_en50221.c: Fixed block comments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 07/13/2017 03:04 AM, Antti Palosaari wrote:
On 07/13/2017 02:45 AM, Jasmin J. wrote:
Hello Antti!

Have you ever looked that coding style doc?
Yes I read it several times already and used it in my daily work in my
previous company.

Beside the Multi-line comment style, which I will fix in a follow up,
you mentioned other issues.
Please can you tell me which one you mean, so that I can check the series
for those things.

eh, OK, here short list from my head:
* you fixed comments, but left //-comments

* many cases where if (ret != 0), which generally should be written as if (ret). If you expect it is just error ret value, then prefer if (ret), but if ret has some other meaning like it returns number of bytes then if you expect 0-bytes returned (ret != 0) is also valid.

* unnecessary looking line split like that:
if (a
       & b)

* logical continuous line split wrong (I think I have seen checkpatch reported that kind of mistakes, dunno why not now)
if (a
     && b)
== >
if (a &&
     b)

actually it reports, when run --strict mode:

+       if (a
+           && b) {
+               foo(a);
+               foo(b);
+       }
+

CHECK: Logical continuations should be on the previous line
#11: FILE: drivers/media/usb/dvb-usb-v2/af9035.c:2135:
+	if (a
+	    && b) {


Antti
--
http://palosaari.fi/



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux