Re: [PATCH] io_uring/net: Remove unneeded if check in io_net_vec_assign()

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

 



On 12. Aug 2024, at 00:31, Jens Axboe <axboe@xxxxxxxxx> wrote:
> On 8/11/24 4:26 PM, Thorsten Blum wrote:
>> kfree() already checks if its argument is NULL. Remove the unneeded if
>> check and fix the following Coccinelle/coccicheck warning reported by
>> ifnullfree.cocci:
>> 
>>  WARNING: NULL check before some freeing functions is not needed
> 
> Yes it's not needed, but the NULL check is done after a function call.
> For the hot path, it's FASTER to check if it's NULL or not.
> 
> I can put a comment on these, but honestly I wish the ifnullfree
> thing would just go away as it's hardly useful for anything. It's
> not like it's a bug to check for NULL first, or that it would find
> something useful.

Ok, thanks for explaining.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux