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: 7902451 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E90399F32E for ; Tue, 22 Dec 2015 08:15:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2F25C2058E for ; Tue, 22 Dec 2015 08:15:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9439C20595 for ; Tue, 22 Dec 2015 08:15:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753819AbbLVIPp (ORCPT ); Tue, 22 Dec 2015 03:15:45 -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: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 linux-rdma" 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)