[Intel-wired-lan] [PATCH] igb: fix compare_const_fl.cocci warnings

Julia Lawall julia.lawall at lip6.fr
Thu Jan 7 06:22:07 UTC 2016


On Thu, 7 Jan 2016, Brown, Aaron F wrote:

> > From: Intel-wired-lan [intel-wired-lan-bounces at lists.osuosl.org] on behalf of Julia Lawall [julia.lawall at lip6.fr]
> > Sent: Wednesday, December 23, 2015 4:58 AM
> > To: Gangfeng Huang
> > Cc: intel-wired-lan at lists.osuosl.org; kbuild-all at 01.org
> > Subject: Re: [Intel-wired-lan] [PATCH] igb: fix compare_const_fl.cocci  warnings
> > 
> > Actully, there is a more serious problem here, that there are a lot of
> > potential dereferences of invalid pointers, via calls like:
> > 
> > dev_err(&adapter->pdev->dev, "map to unbound device!\n")
> 
> > julia
> 
> I don't see that this patch changes that, it still seems proper to apply this clean up.

No, the patch just does what the rule says, which is move the NULL to the 
other side.

julia

> 
> > On Wed, 23 Dec 2015, Julia Lawall wrote:
> > 
> > > Kernel code typically uses == NULL.
> > >
> > > Generated by: scripts/coccinelle/misc/compare_const_fl.cocci
> > >
> > > CC: Gangfeng Huang <gangfeng.huang at ni.com>
> > > Signed-off-by: Fengguang Wu <fengguang.wu at intel.com>
> > > Signed-off-by: Julia Lawall <julia.lawall at lip6.fr>
> > >
> > > ---
> > >
> > > Alternatively, consider using !adapter.
> > >
> > >  igb_cdev.c |   14 +++++++-------
> > >  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> Tested-by: Aaron Brown <aaron.f.brown at intel.com>


More information about the Intel-wired-lan mailing list