linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2] staging: rtl8723bs: do not use __constant_cpu_to_le16
@ 2019-03-17 11:48 Sergey Senozhatsky
  2019-03-17 12:16 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Senozhatsky @ 2019-03-17 11:48 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: devel, linux-kernel, Sergey Senozhatsky, Sergey Senozhatsky

From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>

cpu_to_le16() is capable enough to detect __builtin_constant_p()
and to use an appropriate compile time ___constant_swahbXX()
function.

So we can use cpu_to_le16() instead of __constant_cpu_to_le16().

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 drivers/staging/rtl8723bs/include/wifi.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8723bs/include/wifi.h b/drivers/staging/rtl8723bs/include/wifi.h
index 559bf2606fb7..1e79e6f0c206 100644
--- a/drivers/staging/rtl8723bs/include/wifi.h
+++ b/drivers/staging/rtl8723bs/include/wifi.h
@@ -266,8 +266,8 @@ enum WIFI_REG_DOMAIN {
 
 #define SetFrameType(pbuf, type)	\
 	do {	\
-		*(unsigned short *)(pbuf) &= __constant_cpu_to_le16(~(BIT(3) | BIT(2))); \
-		*(unsigned short *)(pbuf) |= __constant_cpu_to_le16(type); \
+		*(unsigned short *)(pbuf) &= cpu_to_le16(~(BIT(3) | BIT(2))); \
+		*(unsigned short *)(pbuf) |= cpu_to_le16(type); \
 	} while (0)
 
 #define GetFrameSubType(pbuf)	(le16_to_cpu(*(__le16 *)(pbuf)) & (BIT(7) |\
-- 
2.21.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCHv2] staging: rtl8723bs: do not use __constant_cpu_to_le16
  2019-03-17 11:48 [PATCHv2] staging: rtl8723bs: do not use __constant_cpu_to_le16 Sergey Senozhatsky
@ 2019-03-17 12:16 ` Greg Kroah-Hartman
  2019-03-17 15:14   ` Sergey Senozhatsky
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2019-03-17 12:16 UTC (permalink / raw)
  To: Sergey Senozhatsky; +Cc: devel, linux-kernel, Sergey Senozhatsky

On Sun, Mar 17, 2019 at 08:48:03PM +0900, Sergey Senozhatsky wrote:
> From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>

Why ".work"?

> 
> cpu_to_le16() is capable enough to detect __builtin_constant_p()
> and to use an appropriate compile time ___constant_swahbXX()
> function.
> 
> So we can use cpu_to_le16() instead of __constant_cpu_to_le16().
> 
> Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>

Email address does not match up to the From: line above :(


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCHv2] staging: rtl8723bs: do not use __constant_cpu_to_le16
  2019-03-17 12:16 ` Greg Kroah-Hartman
@ 2019-03-17 15:14   ` Sergey Senozhatsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Senozhatsky @ 2019-03-17 15:14 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Sergey Senozhatsky, devel, linux-kernel, Sergey Senozhatsky

On (03/17/19 13:16), Greg Kroah-Hartman wrote:
> On Sun, Mar 17, 2019 at 08:48:03PM +0900, Sergey Senozhatsky wrote:
> > From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
> 
> Why ".work"?

Aha, good question. There is not so much of a difference between .work and
!.work. (if any at all).

> > cpu_to_le16() is capable enough to detect __builtin_constant_p()
> > and to use an appropriate compile time ___constant_swahbXX()
> > function.
> > 
> > So we can use cpu_to_le16() instead of __constant_cpu_to_le16().
> > 
> > Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> 
> Email address does not match up to the From: line above :(

Greg, sorry about that!
Either you were the first one to complaint or this was the first time
I re-rent a patch from a different google account.

	-ss

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-17 15:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-17 11:48 [PATCHv2] staging: rtl8723bs: do not use __constant_cpu_to_le16 Sergey Senozhatsky
2019-03-17 12:16 ` Greg Kroah-Hartman
2019-03-17 15:14   ` Sergey Senozhatsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).