From patchwork Mon Dec 14 15:00:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 556534 X-Patchwork-Delegate: jeffrey.t.kirsher@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 74ADF14030D for ; Tue, 15 Dec 2015 02:00:24 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id A277A32E4A; Mon, 14 Dec 2015 15:00:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wfQ9eJlaeDVs; Mon, 14 Dec 2015 15:00:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 06F7432E4F; Mon, 14 Dec 2015 15:00:20 +0000 (UTC) X-Original-To: intel-wired-lan@lists.osuosl.org Delivered-To: intel-wired-lan@lists.osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id DCB311C101F for ; Mon, 14 Dec 2015 15:00:18 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D44AA93C62 for ; Mon, 14 Dec 2015 15:00:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kn8Cizi0+yfK for ; Mon, 14 Dec 2015 15:00:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by hemlock.osuosl.org (Postfix) with ESMTPS id CD380948B1 for ; Mon, 14 Dec 2015 15:00:16 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.20,427,1444687200"; d="scan'208";a="192002132" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Dec 2015 16:00:12 +0100 Date: Mon, 14 Dec 2015 16:00:08 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Gangfeng Huang Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Cc: intel-wired-lan@lists.osuosl.org, kbuild-all@01.org Subject: [Intel-wired-lan] [PATCH] igb: fix compare_const_fl.cocci warnings X-BeenThere: intel-wired-lan@lists.osuosl.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@lists.osuosl.org Sender: "Intel-wired-lan" 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 Tested-by: Aaron Brown --- 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)