All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro
@ 2017-01-14 18:23 Kartikey Singh
  2017-01-14 18:38 ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Kartikey Singh @ 2017-01-14 18:23 UTC (permalink / raw)
  To: gregkh, insafonov, devel, linux-kernel

do while loop removed from single statement macro

Signed-off-by: Kartikey Singh <dr.kartikeynrc@gmail.com>
---
 drivers/staging/rtl8188eu/include/wifi.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/staging/rtl8188eu/include/wifi.h
index 9e08e68..57db709 100644
--- a/drivers/staging/rtl8188eu/include/wifi.h
+++ b/drivers/staging/rtl8188eu/include/wifi.h
@@ -481,9 +481,7 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
 ------------------------------------------------------------------------------*/
 
 #define SetOrderBit(pbuf)	\
-	do	{	\
-		*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \
-	} while (0)
+	(*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_))
 
 #define GetOrderBit(pbuf)			\
 	(((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0)
-- 
2.9.3

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

* Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro
  2017-01-14 18:23 [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro Kartikey Singh
@ 2017-01-14 18:38 ` Greg KH
  2017-01-14 19:38   ` Kartikey Singh
       [not found]   ` <CAOKLEkBoQrV_TE+61vD=43B8py21Moq-Tyczz+d=u8dTpbACkg@mail.gmail.com>
  0 siblings, 2 replies; 7+ messages in thread
From: Greg KH @ 2017-01-14 18:38 UTC (permalink / raw)
  To: Kartikey Singh; +Cc: insafonov, devel, linux-kernel

On Sat, Jan 14, 2017 at 11:53:36PM +0530, Kartikey Singh wrote:
> do while loop removed from single statement macro
> 
> Signed-off-by: Kartikey Singh <dr.kartikeynrc@gmail.com>
> ---
>  drivers/staging/rtl8188eu/include/wifi.h | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/staging/rtl8188eu/include/wifi.h
> index 9e08e68..57db709 100644
> --- a/drivers/staging/rtl8188eu/include/wifi.h
> +++ b/drivers/staging/rtl8188eu/include/wifi.h
> @@ -481,9 +481,7 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
>  ------------------------------------------------------------------------------*/
>  
>  #define SetOrderBit(pbuf)	\
> -	do	{	\
> -		*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \
> -	} while (0)
> +	(*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_))

This macro is never used, so it could just be removed, right?

>  #define GetOrderBit(pbuf)			\
>  	(((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0)

Same with that one.  Care to do that type of fixup instead please?

thanks,

greg k-h

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

* Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro
  2017-01-14 18:38 ` Greg KH
@ 2017-01-14 19:38   ` Kartikey Singh
  2017-01-15 10:56     ` Greg KH
       [not found]   ` <CAOKLEkBoQrV_TE+61vD=43B8py21Moq-Tyczz+d=u8dTpbACkg@mail.gmail.com>
  1 sibling, 1 reply; 7+ messages in thread
From: Kartikey Singh @ 2017-01-14 19:38 UTC (permalink / raw)
  To: gregkh, insafonov, devel, linux-kernel

On Sat, Jan 14, 2017 at 07:38:01PM +0100, Greg KH wrote:
> On Sat, Jan 14, 2017 at 11:53:36PM +0530, Kartikey Singh wrote:
> > do while loop removed from single statement macro
> > 
> > Signed-off-by: Kartikey Singh <dr.kartikeynrc@gmail.com>
> > ---
> >  drivers/staging/rtl8188eu/include/wifi.h | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/staging/rtl8188eu/include/wifi.h
> > index 9e08e68..57db709 100644
> > --- a/drivers/staging/rtl8188eu/include/wifi.h
> > +++ b/drivers/staging/rtl8188eu/include/wifi.h
> > @@ -481,9 +481,7 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
> >  ------------------------------------------------------------------------------*/
> >  
> >  #define SetOrderBit(pbuf)	\
> > -	do	{	\
> > -		*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \
> > -	} while (0)
> > +	(*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_))
> 
> This macro is never used, so it could just be removed, right?
> 
> >  #define GetOrderBit(pbuf)			\
> >  	(((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0)
> 
> Same with that one.  Care to do that type of fixup instead please?
> 
> thanks,
> 
> greg k-h
I think that macro is needed.

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

* Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro
       [not found]   ` <CAOKLEkBoQrV_TE+61vD=43B8py21Moq-Tyczz+d=u8dTpbACkg@mail.gmail.com>
@ 2017-01-14 19:40     ` Greg KH
  2017-01-14 19:53       ` Ivan Safonov
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2017-01-14 19:40 UTC (permalink / raw)
  To: Kartikey singh; +Cc: Ivan Safonov, devel, linux-kernel

On Sun, Jan 15, 2017 at 12:44:41AM +0530, Kartikey singh wrote:
> I think that macro is required. Anyway I won't have trouble cleaning it up if
> you say so.

I don't see it being used anywhere, do you?  Use 'git grep' to search
for it.  Even better yet, remove it and rebuild the driver and see if it
breaks :)

thanks,

greg k-h

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

* Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro
  2017-01-14 19:40     ` Greg KH
@ 2017-01-14 19:53       ` Ivan Safonov
  2017-01-15 10:56         ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Ivan Safonov @ 2017-01-14 19:53 UTC (permalink / raw)
  To: Greg KH, Kartikey singh; +Cc: devel, linux-kernel

On 01/14/2017 10:40 PM, Greg KH wrote:
> On Sun, Jan 15, 2017 at 12:44:41AM +0530, Kartikey singh wrote:
> Even better yet, remove it and rebuild the driver and see if it
> breaks :)

Only if the code is not between #ifn?def / #endif...

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

* Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro
  2017-01-14 19:38   ` Kartikey Singh
@ 2017-01-15 10:56     ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2017-01-15 10:56 UTC (permalink / raw)
  To: Kartikey Singh; +Cc: insafonov, devel, linux-kernel

On Sun, Jan 15, 2017 at 01:08:15AM +0530, Kartikey Singh wrote:
> On Sat, Jan 14, 2017 at 07:38:01PM +0100, Greg KH wrote:
> > On Sat, Jan 14, 2017 at 11:53:36PM +0530, Kartikey Singh wrote:
> > > do while loop removed from single statement macro
> > > 
> > > Signed-off-by: Kartikey Singh <dr.kartikeynrc@gmail.com>
> > > ---
> > >  drivers/staging/rtl8188eu/include/wifi.h | 4 +---
> > >  1 file changed, 1 insertion(+), 3 deletions(-)
> > > 
> > > diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/staging/rtl8188eu/include/wifi.h
> > > index 9e08e68..57db709 100644
> > > --- a/drivers/staging/rtl8188eu/include/wifi.h
> > > +++ b/drivers/staging/rtl8188eu/include/wifi.h
> > > @@ -481,9 +481,7 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
> > >  ------------------------------------------------------------------------------*/
> > >  
> > >  #define SetOrderBit(pbuf)	\
> > > -	do	{	\
> > > -		*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_); \
> > > -	} while (0)
> > > +	(*(unsigned short *)(pbuf) |= cpu_to_le16(_ORDER_))
> > 
> > This macro is never used, so it could just be removed, right?
> > 
> > >  #define GetOrderBit(pbuf)			\
> > >  	(((*(unsigned short *)(pbuf)) & le16_to_cpu(_ORDER_)) != 0)
> > 
> > Same with that one.  Care to do that type of fixup instead please?
> > 
> > thanks,
> > 
> > greg k-h
> I think that macro is needed.

I don't see it being used anywhere, do you?

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

* Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro
  2017-01-14 19:53       ` Ivan Safonov
@ 2017-01-15 10:56         ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2017-01-15 10:56 UTC (permalink / raw)
  To: Ivan Safonov; +Cc: Kartikey singh, devel, linux-kernel

On Sat, Jan 14, 2017 at 10:53:04PM +0300, Ivan Safonov wrote:
> On 01/14/2017 10:40 PM, Greg KH wrote:
> > On Sun, Jan 15, 2017 at 12:44:41AM +0530, Kartikey singh wrote:
> > Even better yet, remove it and rebuild the driver and see if it
> > breaks :)
> 
> Only if the code is not between #ifn?def / #endif...

Heh, fair enough, but it usually is a good sign if you do a build, along
with a search, that you are safe to remove something.

thanks,

greg k-h

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

end of thread, other threads:[~2017-01-15 10:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-14 18:23 [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro Kartikey Singh
2017-01-14 18:38 ` Greg KH
2017-01-14 19:38   ` Kartikey Singh
2017-01-15 10:56     ` Greg KH
     [not found]   ` <CAOKLEkBoQrV_TE+61vD=43B8py21Moq-Tyczz+d=u8dTpbACkg@mail.gmail.com>
2017-01-14 19:40     ` Greg KH
2017-01-14 19:53       ` Ivan Safonov
2017-01-15 10:56         ` Greg KH

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.