From patchwork Mon Dec 7 09:55:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 7781711 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 2E17D9F350 for ; Mon, 7 Dec 2015 09:55:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FE1A20426 for ; Mon, 7 Dec 2015 09:55:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 650782041A for ; Mon, 7 Dec 2015 09:55:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755697AbbLGJzh (ORCPT ); Mon, 7 Dec 2015 04:55:37 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:36342 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755240AbbLGJzf (ORCPT ); Mon, 7 Dec 2015 04:55:35 -0500 X-IronPort-AV: E=Sophos;i="5.20,394,1444687200"; d="scan'208";a="190737786" 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; 07 Dec 2015 10:55:34 +0100 Date: Mon, 7 Dec 2015 10:55:33 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: "Kalle Valo Kalle Valo" cc: "Luis R. Rodriguez" , linux-wireless@vger.kernel.org, kbuild-all@01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] prism54: fix compare_const_fl.cocci warnings (fwd) Message-ID: User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 Signed-off-by: Fengguang Wu Signed-off-by: Julia Lawall --- It looks a little nicer to me because n is the thing we care about. oid_mgt.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/net/wireless/intersil/prism54/oid_mgt.c +++ b/drivers/net/wireless/intersil/prism54/oid_mgt.c @@ -424,7 +424,7 @@ mgt_set_request(islpci_private *priv, en void *cache, *_data = data; u32 oid; - BUG_ON(OID_NUM_LAST <= n); + BUG_ON(n >= OID_NUM_LAST); BUG_ON(extra > isl_oid[n].range); if (!priv->mib) @@ -485,7 +485,7 @@ mgt_set_varlen(islpci_private *priv, enu int dlen; u32 oid; - BUG_ON(OID_NUM_LAST <= n); + BUG_ON(n >= OID_NUM_LAST); dlen = isl_oid[n].size; oid = isl_oid[n].oid; @@ -524,7 +524,7 @@ mgt_get_request(islpci_private *priv, en void *cache, *_res = NULL; u32 oid; - BUG_ON(OID_NUM_LAST <= n); + BUG_ON(n >= OID_NUM_LAST); BUG_ON(extra > isl_oid[n].range); res->ptr = NULL; @@ -626,7 +626,7 @@ mgt_commit_list(islpci_private *priv, en void mgt_set(islpci_private *priv, enum oid_num_t n, void *data) { - BUG_ON(OID_NUM_LAST <= n); + BUG_ON(n >= OID_NUM_LAST); BUG_ON(priv->mib[n] == NULL); memcpy(priv->mib[n], data, isl_oid[n].size); @@ -636,7 +636,7 @@ mgt_set(islpci_private *priv, enum oid_n void mgt_get(islpci_private *priv, enum oid_num_t n, void *res) { - BUG_ON(OID_NUM_LAST <= n); + BUG_ON(n >= OID_NUM_LAST); BUG_ON(priv->mib[n] == NULL); BUG_ON(res == NULL);