Re: [PATCH] ext4: remove redundant judgment

From: Theodore Ts'o
Date: Thu Apr 07 2022 - 11:01:59 EST


On Wed, Apr 06, 2022 at 09:05:01AM +0000, cgel.zte@xxxxxxxxx wrote:
> From: Lv Ruyi <lv.ruyi@xxxxxxxxxx>
>
> iput() has already handled null and non-null parameter. so there is no
> need to use if().
>
> Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
> Signed-off-by: Lv Ruyi <lv.ruyi@xxxxxxxxxx>

I'd use the word "conditional" instead of "judgment", so I'd suggest rewording it as:

>ext4: remove unnecessary conditional
>
>
>iput() already tests to see if it is called with a NULL argument, so
>there is no need to check if the inode is NULL before calling iput().

I've noticed that you've submitted this for other subsystems, so I'd
thought I'd mention it before just applying the patch and quietly
adjusting the commit description for clarity.

- Ted