Re: [PATCH] staging: erofs: fix if assignment style issue

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

 



Hi Kristaps,

On 2018/8/5 23:21, Kristaps Čivkulis wrote:
> Fix coding style issue "do not use assignment in if condition"
> detected by checkpatch.pl.
>
> Signed-off-by: Kristaps Čivkulis <kristaps.civkulis@xxxxxxxxx>

I don't know whether this rule is mandatory or not for the current linux
kernel
when I checked the original patchset with checkpatch.pl.

Sometime I prefer to use assignment in if condition since the whole
statement
is more meaningful than separate to several statements...  although it
can lead to
some potential bugs.

Another case is use (!ptr) to replace (ptr == NULL) and use (ptr) to replace
(ptr != NULL) for pointers. Actually these expressions are equivalent in C,
but I personally like the nullptr concept... I also have no idea if it
is mandatory to fix
as the checkpatch.pl suggested or not...

Thanks for your patch :) if it is actually mandatory or strongly
recommend, you can add:

Reviewed-by: Gao Xiang <gaoxiang25@xxxxxxxxxx>

Thanks,
Gao Xiang
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux