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

Brown, Aaron F aaron.f.brown at intel.com
Fri Dec 18 02:58:48 UTC 2015

> From: Intel-wired-lan [intel-wired-lan-bounces at lists.osuosl.org] on behalf of Julia Lawall [julia.lawall at lip6.fr]
> Sent: Monday, December 14, 2015 7:00 AM
> To: Gangfeng Huang
> Cc: intel-wired-lan at lists.osuosl.org; kbuild-all at 01.org
> Subject: [Intel-wired-lan] [PATCH] igb: fix compare_const_fl.cocci warnings
> In both of these cases, it is more common to have the constant on the
> right, in kernel code.
> 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>
> ---
>  igb_main.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

And based on another patch I was looking at checkpatch agrees :)

It also suggests as a check that this could be written !adapter rather than NULL == adapter
u1458:[1]/usr/src/kernels/next-queue> git format-patch 1b199aa -1 --stdout|./scripts/checkpatch.pl -
CHECK: Comparison to NULL could be written "!adapter"
#27: FILE: drivers/net/ethernet/intel/igb/igb_main.c:8276:
+	if (adapter == NULL) {

total: 0 errors, 0 warnings, 1 checks, 16 lines checked

Your patch has style problems, please review.

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
But I don't have particularly strong feelings on that either way, so...

Tested-by: Aaron Brown <aaron.f.brown at intel.com>

More information about the Intel-wired-lan mailing list