Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1559039 > unrolled thread
| Started by | Kartikey Singh <dr.kartikeynrc@gmail.com> |
|---|---|
| First post | 2017-01-14 19:30 +0100 |
| Last post | 2017-01-15 12:00 +0100 |
| Articles | 7 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro Kartikey Singh <dr.kartikeynrc@gmail.com> - 2017-01-14 19:30 +0100
Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro Greg KH <gregkh@linuxfoundation.org> - 2017-01-14 19:40 +0100
Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro Kartikey Singh <dr.kartikeynrc@gmail.com> - 2017-01-14 20:40 +0100
Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro Greg KH <gregkh@linuxfoundation.org> - 2017-01-15 12:00 +0100
Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro Greg KH <gregkh@linuxfoundation.org> - 2017-01-14 20:50 +0100
Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro Ivan Safonov <insafonov@gmail.com> - 2017-01-14 21:00 +0100
Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro Greg KH <gregkh@linuxfoundation.org> - 2017-01-15 12:00 +0100
| From | Kartikey Singh <dr.kartikeynrc@gmail.com> |
|---|---|
| Date | 2017-01-14 19:30 +0100 |
| Subject | [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro |
| Message-ID | <sZBfr-Np-9@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-01-14 19:40 +0100 |
| Message-ID | <sZBp8-Qr-15@gated-at.bofh.it> |
| In reply to | #1559039 |
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
[toc] | [prev] | [next] | [standalone]
| From | Kartikey Singh <dr.kartikeynrc@gmail.com> |
|---|---|
| Date | 2017-01-14 20:40 +0100 |
| Message-ID | <sZClc-1qb-21@gated-at.bofh.it> |
| In reply to | #1559042 |
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.
[toc] | [prev] | [next] | [standalone]
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-01-15 12:00 +0100 |
| Message-ID | <sZQHw-1wB-3@gated-at.bofh.it> |
| In reply to | #1559063 |
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?
[toc] | [prev] | [next] | [standalone]
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-01-14 20:50 +0100 |
| Message-ID | <sZCuS-1u5-17@gated-at.bofh.it> |
| In reply to | #1559042 |
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
[toc] | [prev] | [next] | [standalone]
| From | Ivan Safonov <insafonov@gmail.com> |
|---|---|
| Date | 2017-01-14 21:00 +0100 |
| Message-ID | <sZCEy-1xV-3@gated-at.bofh.it> |
| In reply to | #1559065 |
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...
[toc] | [prev] | [next] | [standalone]
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2017-01-15 12:00 +0100 |
| Message-ID | <sZQHw-1wB-19@gated-at.bofh.it> |
| In reply to | #1559066 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web