From: Julia Lawall Date: Mon, 14 Dec 2015 16:00:08 +0100 (CET) Subject: [Intel-wired-lan] [PATCH] igb: fix compare_const_fl.cocci warnings Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: intel-wired-lan@osuosl.org List-ID: 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 Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- 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)