From patchwork Tue Dec 22 08:15:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 559914 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id CFB15140313 for ; Tue, 22 Dec 2015 19:15:52 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753840AbbLVIPq (ORCPT ); Tue, 22 Dec 2015 03:15:46 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:2714 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751906AbbLVIPZ (ORCPT ); Tue, 22 Dec 2015 03:15:25 -0500 X-IronPort-AV: E=Sophos;i="5.20,463,1444687200"; d="scan'208";a="193477212" Received: from 198.67.28.109.rev.sfr.net (HELO hadrien) ([109.28.67.198]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Dec 2015 09:15:23 +0100 Date: Tue, 22 Dec 2015 09:15:23 +0100 (CET) From: Julia Lawall X-X-Sender: jll@localhost6.localdomain6 To: Faisal Latif cc: kbuild-all@01.org, dledford@redhat.com, linux-rdma@vger.kernel.org, netdev@vger.kernel.org, jeffrey.t.kirsher@intel.com, e1000-rdma@lists.sourceforge.net, faisal.latif@intel.com Subject: [PATCH] i40iw: fix compare_const_fl.cocci warnings Message-ID: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Move constants to the right of binary operators. Generated by: scripts/coccinelle/misc/compare_const_fl.cocci CC: Faisal Latif Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- It's a minor point, but when I first looked at the code, I thought that MIN and MAX were inverted, so it could be good to change. i40iw_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/infiniband/hw/i40iw/i40iw_ctrl.c +++ b/drivers/infiniband/hw/i40iw/i40iw_ctrl.c @@ -1664,7 +1664,7 @@ static enum i40iw_status_code i40iw_sc_c { u32 pble_obj_cnt; - if (I40IW_MIN_CQ_SIZE > info->num_elem || I40IW_MAX_CQ_SIZE < info->num_elem) + if (info->num_elem < I40IW_MIN_CQ_SIZE || info->num_elem > I40IW_MAX_CQ_SIZE) return I40IW_ERR_INVALID_SIZE; if (info->ceq_id > I40IW_MAX_CEQID)