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

Julia Lawall julia.lawall at lip6.fr
Mon Dec 14 15:00:08 UTC 2015


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(-)

--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -8209,7 +8209,7 @@ static int igb_change_mode(struct igb_ad
 	int err = 0;
 	int current_mode;

-	if (NULL == adapter) {
+	if (adapter == NULL) {
 		dev_err(&adapter->pdev->dev, "map to unbound device!\n");
 		return -ENOENT;
 	}
@@ -8272,7 +8272,7 @@ static ssize_t igb_set_qav_mode(struct d
 	if (!capable(CAP_NET_ADMIN))
 		return -EPERM;

-	if (0 > kstrtoint(buf, 0, &request_mode))
+	if (kstrtoint(buf, 0, &request_mode) < 0)
 		return -EINVAL;

 	if (request_mode != 0 && request_mode != 1)


More information about the Intel-wired-lan mailing list