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

From: Gao Xiang
Date: Sun Aug 05 2018 - 12:05:51 EST


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