Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2184475yba; Thu, 25 Apr 2019 12:03:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyjaGfHbRN6sKNVWxd1vDgt2D+yKoD2zYBWweyoVHwLIYdoLPC+bLb/X6S2zElW4cYJ2z4n X-Received: by 2002:a63:e110:: with SMTP id z16mr21631892pgh.165.1556218982178; Thu, 25 Apr 2019 12:03:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556218982; cv=none; d=google.com; s=arc-20160816; b=hSdcH4NRLgaQCTu//r1n4VeURUbD6blImxWGxIFF9Rztr3/CB+THvKw0VdmWm9mFhw Z0tqeq/WSiTiJpHwdttZZpPvzV98rD6dxDIL2UmsFD3Qxk8JOMj7nRvo61GLguMe9qii 3/jJUak0UHHPDMTEKjU7hqwvAOd1FO376C1LZNBRepD9P+DChqUdM9LBk4P/5z9dgk0q 89avvncUp1RgZRV5fG4DW3ZA/8S/fXiyL9CGJ1ybbL+9ZEPoAOtilGpMIll4pi3E/06c R7cYjw49ssoC+SmDEMBwmWHDfcy+ZdCPcEgpbGupNJoDXBcXaAL0dNpZzRUBm/JOMzC6 Vb5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=G2YgNacUSGvQfoenjr0MC31lYNzLBltR3PjfCg1bekM=; b=RfF52Nh+gtCxfHP9UhSb+M7u+nq8cJPTXOqFrX0XP/c/zd/VByldfT5mofzxu9Q7oz LqNjq28q5+kpAQKVJZvbJXyAxQ+iqN5oxxgXlWPn+F8+vgRADGvWJNOCvR66KXtkOIeK InX+dAaDt69z14EB5D8LkL741CzrVx+zXkuLHhN07bRdD+8TjK4TyMJnjMA+hQNsLTsu FPTNEiO9WOKcJ/zmCLn0wb1YZLIjBltjSXUp0Qg+AMRC7goEvgZpE2a59jKz/LPJh3nL bc9Nx4os9343ezBzidTwpdhStXU9f9XkuvuNGpuXGBF9rMYSiTDmxTvKOSaSnT5GsK96 vHHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="O/Ee76pu"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si23054958plb.346.2019.04.25.12.02.44; Thu, 25 Apr 2019 12:03:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="O/Ee76pu"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730588AbfDYSdw (ORCPT + 99 others); Thu, 25 Apr 2019 14:33:52 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:38712 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbfDYSdw (ORCPT ); Thu, 25 Apr 2019 14:33:52 -0400 Received: by mail-pl1-f195.google.com with SMTP id f36so213363plb.5 for ; Thu, 25 Apr 2019 11:33:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=G2YgNacUSGvQfoenjr0MC31lYNzLBltR3PjfCg1bekM=; b=O/Ee76pu85m95BmZnljEaTwIAwA67u6Ib542P2D/ZwM3axm9LJ+r/bOkXxqnhh8RvM /zfr7IRmtg06BxQqqAzRB8nKkVA8cjQOrMF59IVbawKp1hyETCLOPNOAWMc1V38BUWOj zQHFJQlCcSXERN90RJBA3+YbJUYXPIRP01l3YGsj1phv57M0yDEOuLTv92Tb07f70dVJ iWK0zBjYVB79cbOh33v3OmYxIR0AUKbVjjED/Cff77lo0ZhQlyzgFu+ZvJW01Q636CTu 0Lr/KO+/sV1v6qd7HhpNCjqKu1jZGg1FdBPgkiKt+UkKA34mB8yKxnc6UzLGJrp15V+y om5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=G2YgNacUSGvQfoenjr0MC31lYNzLBltR3PjfCg1bekM=; b=hI2OsknQSKOlqrnuJlBSCYCdDimW1KQBUs98iwgdb9h/O+ZP31Xwc20HNkb1q3hivk JL/MPBVv2BkVQ1UQhGrucv+y0FKNo1da/rsPpDBoYEY2EHgit6IaMXsyiqSAe73T/8k/ 1izBB8b6FWzgErAKIoUKZr9y9S+vpSs8uIHvbD4T5D0IpjIzQqVwY7APGKlGChKkCh0q iBobVj0uDlbtI4NDmcu3jABlC3ynQza8YAcGS4k3H+UbP9wtSkdsfj6e3Fv+iHRnvb2w tmWw4LHpXXq0GFT42g+4hC8UilCLvmBDTsFphhJtIOPsXZu5SJACLVDbRvcdivblbYeI 4xxg== X-Gm-Message-State: APjAAAVkNaApJ9TbibcuAaa7O8tjxAyX06dtZz7I1l5/H662CMBDe9E7 /HnAPaZKhCky817ttuInzR1icZ+i X-Received: by 2002:a17:902:2d04:: with SMTP id o4mr41482963plb.88.1556217231526; Thu, 25 Apr 2019 11:33:51 -0700 (PDT) Received: from localhost.localdomain ([103.87.57.142]) by smtp.gmail.com with ESMTPSA id b1sm26050186pgq.15.2019.04.25.11.33.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 11:33:51 -0700 (PDT) From: Vatsala Narang To: gregkh@linuxfoundation.org Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, Julia.Lawall@lip6.fr, Vatsala Narang Subject: [PATCH] staging: rtl8192u: ieee80211: Replace bit shifting with BIT macro Date: Fri, 26 Apr 2019 00:03:20 +0530 Message-Id: <20190425183320.23962-1-vatsalanarang@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Challenge suggested by coccinelle. Replace bit shifting on 1 with the BIT(x) macro. Coccinelle script: @@ expression c; @@ -(1 << c) +BIT(c) Signed-off-by: Vatsala Narang --- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c index fa59c712c74b..c44662f03a6b 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c @@ -86,7 +86,7 @@ static inline char *rtl819x_translate_scan(struct ieee80211_device *ieee, /* Add the protocol name */ iwe.cmd = SIOCGIWNAME; for(i=0; imode&(1<mode&BIT(i)) { sprintf(pname,ieee80211_modes[i].mode_string,ieee80211_modes[i].mode_size); pname +=ieee80211_modes[i].mode_size; } @@ -394,7 +394,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, sec.key_sizes[key] = len; (*crypt)->ops->set_key(sec.keys[key], len, NULL, (*crypt)->priv); - sec.flags |= (1 << key); + sec.flags |= BIT(key); /* This ensures a key will be activated if no key is * explicitely set */ if (key == sec.active_key) @@ -415,7 +415,7 @@ int ieee80211_wx_set_encode(struct ieee80211_device *ieee, (*crypt)->ops->set_key(sec.keys[key], 13, NULL, (*crypt)->priv); sec.key_sizes[key] = 13; - sec.flags |= (1 << key); + sec.flags |= BIT(key); } /* No key data - just set the default TX key index */ @@ -636,7 +636,7 @@ int ieee80211_wx_set_encode_ext(struct ieee80211_device *ieee, if (ext->alg != IW_ENCODE_ALG_NONE) { //memcpy(sec.keys[idx], ext->key, ext->key_len); sec.key_sizes[idx] = ext->key_len; - sec.flags |= (1 << idx); + sec.flags |= BIT(idx); if (ext->alg == IW_ENCODE_ALG_WEP) { // sec.encode_alg[idx] = SEC_ALG_WEP; sec.flags |= SEC_LEVEL; -- 2.17.1