Re: [PATCH -next] cifsd: fix WARNING: convert list_for_each to entry variant in smb2pdu.c

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

 



On Fri, Jun 18, 2021 at 09:44:37AM +0800, libaokun (A) wrote:
> I don't know what the difference is between
> 
> list_for_each_entry() and list_for_each() for 'struct channel *chann',
> 
> but I don't think there's any difference here.

Correct.  There is no difference, but Coccinelle is smart enough to
parse list_for_each_entry() and it's not smart enough to parse
list_for_each().

> 
> Would you give me more detial about this, please?

There is a Coccinelle script scripts/coccinelle/iterators/itnull.cocci
which will complain about the NULL check in the new code so this patch
will introduce a new warning.  We may as well remove the unnecessary
NULL check and avoid the warning.

regards,
dan carpenter




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux