From: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
To: outreachy-kernel@googlegroups.com
Subject: [PATCH v2 1/3] staging: rtl8712: Place constants on the right side of '&'
Date: Sun, 21 Feb 2016 13:51:06 +0530 [thread overview]
Message-ID: <20160221082106.GA24203@Karyakshetra> (raw)
Move constants to the right of binary operator '&'.
This issue was identified using the Coccinelle script:
@@
constant c,c1;
expression e,e1,e2;
local idexpression i;
binary operator b = {==,!=,&,|};
@@
(
c b (c1)
|
i b e1
|
c | e1 | e2 | ...
|
c | (e ? e1 : e2)
|
- c
+ e
b
- e
+ c
)
Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
---
Changes in v2:
-change subject line
-inserted Coccinelle script
drivers/staging/rtl8712/wifi.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h
index 7a352c4..ee41971 100644
--- a/drivers/staging/rtl8712/wifi.h
+++ b/drivers/staging/rtl8712/wifi.h
@@ -260,12 +260,12 @@ enum WIFI_REG_DOMAIN {
*(unsigned short *)((addr_t)(pbuf) + 22) = \
((*(unsigned short *)((addr_t)(pbuf) + 22)) & \
le16_to_cpu((unsigned short)0x000f)) | \
- le16_to_cpu((unsigned short)(0xfff0 & (num << 4))); \
+ le16_to_cpu((unsigned short)((num << 4) & 0xfff0)); \
})
#define SetDuration(pbuf, dur) ({ \
*(unsigned short *)((addr_t)(pbuf) + 2) |= \
- cpu_to_le16(0xffff & (dur)); \
+ cpu_to_le16((dur) & 0xffff); \
})
#define SetPriority(pbuf, tid) ({ \
--
2.1.4
next reply other threads:[~2016-02-21 8:20 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-21 8:21 Bhaktipriya Shridhar [this message]
2016-03-11 18:29 ` [Outreachy kernel] [PATCH v2 1/3] staging: rtl8712: Place constants on the right side of '&' Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160221082106.GA24203@Karyakshetra \
--to=bhaktipriya96@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.