All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: most: net: Replace macros HB and LB with static inline functions
@ 2022-10-05 16:10 Brent Pappas
  2022-10-05 23:57 ` Nam Cao
  0 siblings, 1 reply; 9+ messages in thread
From: Brent Pappas @ 2022-10-05 16:10 UTC (permalink / raw)
  To: gregkh; +Cc: cai.huoqing, kuba, linux-staging, linux-kernel

Replace function-like macros "HB" and "LB" with static inline functions
to comply with preferred Linux coding style standards.

Signed-off-by: Brent Pappas <pappasbrent@knights.ucf.edu>
---
diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
index 1d1fe8bff7ee..8a8fbc274b73 100644
--- a/drivers/staging/most/net/net.c
+++ b/drivers/staging/most/net/net.c
@@ -36,8 +36,8 @@
 #define PMS_TELID_MASK         0x0F
 #define PMS_TELID_SHIFT                4
 
-#define HB(value)              ((u8)((u16)(value) >> 8))
-#define LB(value)              ((u8)(value))
+static inline u8 HB(unsigned int value)                { return ((u8)((u16)(value) >> 8)); }
+static inline u8 LB(unsigned int value)                { return ((u8)(value)); }
 
 #define EXTRACT_BIT_SET(bitset_name, value) \
        (((value) >> bitset_name##_SHIFT) & bitset_name##_MASK)

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

* Re: [PATCH] staging: most: net: Replace macros HB and LB with static inline functions
  2022-10-05 16:10 [PATCH] staging: most: net: Replace macros HB and LB with static inline functions Brent Pappas
@ 2022-10-05 23:57 ` Nam Cao
  2022-10-06  1:39   ` Brent Pappas
  2022-10-06 13:21   ` Brent Pappas
  0 siblings, 2 replies; 9+ messages in thread
From: Nam Cao @ 2022-10-05 23:57 UTC (permalink / raw)
  To: Brent Pappas; +Cc: gregkh, cai.huoqing, kuba, linux-staging, linux-kernel

On Wed, Oct 05, 2022 at 04:10:44PM +0000, Brent Pappas wrote:
> Replace function-like macros "HB" and "LB" with static inline functions
> to comply with preferred Linux coding style standards.
> 
> Signed-off-by: Brent Pappas <pappasbrent@knights.ucf.edu>
> ---
> diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
> index 1d1fe8bff7ee..8a8fbc274b73 100644
> --- a/drivers/staging/most/net/net.c
> +++ b/drivers/staging/most/net/net.c
> @@ -36,8 +36,8 @@
>  #define PMS_TELID_MASK         0x0F
>  #define PMS_TELID_SHIFT                4
>  
> -#define HB(value)              ((u8)((u16)(value) >> 8))
> -#define LB(value)              ((u8)(value))
> +static inline u8 HB(unsigned int value)                { return ((u8)((u16)(value) >> 8)); }
> +static inline u8 LB(unsigned int value)                { return ((u8)(value)); }
>  
>  #define EXTRACT_BIT_SET(bitset_name, value) \
>         (((value) >> bitset_name##_SHIFT) & bitset_name##_MASK)

I cannot apply your patch. I think your email client modified some
whitespace characters.

Check this for more information:
https://www.kernel.org/doc/html/v4.10/process/email-clients.html

Best regards,
Nam

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

* Re: [PATCH] staging: most: net: Replace macros HB and LB with static inline functions
  2022-10-05 23:57 ` Nam Cao
@ 2022-10-06  1:39   ` Brent Pappas
  2022-10-06 13:21   ` Brent Pappas
  1 sibling, 0 replies; 9+ messages in thread
From: Brent Pappas @ 2022-10-06  1:39 UTC (permalink / raw)
  To: Nam Cao; +Cc: gregkh, cai.huoqing, kuba, linux-staging, linux-kernel

On 10/05/2022 19:57, Nam Cao wrote:
> On Wed, Oct 05, 2022 at 04:10:44PM +0000, Brent Pappas wrote:
> > Replace function-like macros "HB" and "LB" with static inline functions
> > to comply with preferred Linux coding style standards.
> > 
> > Signed-off-by: Brent Pappas <pappasbrent@knights.ucf.edu>
> > ---
> > diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
> > index 1d1fe8bff7ee..8a8fbc274b73 100644
> > --- a/drivers/staging/most/net/net.c
> > +++ b/drivers/staging/most/net/net.c
> > @@ -36,8 +36,8 @@
> >  #define PMS_TELID_MASK         0x0F
> >  #define PMS_TELID_SHIFT                4
> >  
> > -#define HB(value)              ((u8)((u16)(value) >> 8))
> > -#define LB(value)              ((u8)(value))
> > +static inline u8 HB(unsigned int value)                { return ((u8)((u16)(value) >> 8)); }
> > +static inline u8 LB(unsigned int value)                { return ((u8)(value)); }
> >  
> >  #define EXTRACT_BIT_SET(bitset_name, value) \
> >         (((value) >> bitset_name##_SHIFT) & bitset_name##_MASK)
> 
> I cannot apply your patch. I think your email client modified some
> whitespace characters.
> 
> Check this for more information:
> https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.kernel.org%2Fdoc%2Fhtml%2Fv4.10%2Fprocess%2Femail-clients.html&amp;data=05%7C01%7Cpappasbrent%40knights.ucf.edu%7C3748a695ff1e438ecd0b08daa72d66bf%7C5b16e18278b3412c919668342689eeb7%7C0%7C0%7C638006110693613730%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=rq2pgVr1dqT2k9hC21LXueqMeIcVyk2Qjvjl1KtkhsU%3D&amp;reserved=0
> 
> Best regards,
> Nam

You are correct.
The tabs were converted to spaces.
I will read the link you have provided and fix the problem.

Thank you,
	
Brent
-- 

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

* Re: [PATCH] staging: most: net: Replace macros HB and LB with static inline functions
  2022-10-05 23:57 ` Nam Cao
  2022-10-06  1:39   ` Brent Pappas
@ 2022-10-06 13:21   ` Brent Pappas
  2022-10-06 13:42     ` Nam Cao
  1 sibling, 1 reply; 9+ messages in thread
From: Brent Pappas @ 2022-10-06 13:21 UTC (permalink / raw)
  To: Nam Cao; +Cc: gregkh, cai.huoqing, kuba, linux-staging, linux-kernel

The 10/05/2022 19:57, Nam Cao wrote:
> On Wed, Oct 05, 2022 at 04:10:44PM +0000, Brent Pappas wrote:
> > Replace function-like macros "HB" and "LB" with static inline functions
> > to comply with preferred Linux coding style standards.
> > 
> > Signed-off-by: Brent Pappas <pappasbrent@knights.ucf.edu>
> > ---
> > diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
> > index 1d1fe8bff7ee..8a8fbc274b73 100644
> > --- a/drivers/staging/most/net/net.c
> > +++ b/drivers/staging/most/net/net.c
> > @@ -36,8 +36,8 @@
> >  #define PMS_TELID_MASK         0x0F
> >  #define PMS_TELID_SHIFT                4
> >  
> > -#define HB(value)              ((u8)((u16)(value) >> 8))
> > -#define LB(value)              ((u8)(value))
> > +static inline u8 HB(unsigned int value)                { return ((u8)((u16)(value) >> 8)); }
> > +static inline u8 LB(unsigned int value)                { return ((u8)(value)); }
> >  
> >  #define EXTRACT_BIT_SET(bitset_name, value) \
> >         (((value) >> bitset_name##_SHIFT) & bitset_name##_MASK)
> 
> I cannot apply your patch. I think your email client modified some
> whitespace characters.
> 
> Check this for more information:
> https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.kernel.org%2Fdoc%2Fhtml%2Fv4.10%2Fprocess%2Femail-clients.html&amp;data=05%7C01%7Cpappasbrent%40knights.ucf.edu%7C3748a695ff1e438ecd0b08daa72d66bf%7C5b16e18278b3412c919668342689eeb7%7C0%7C0%7C638006110693613730%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=rq2pgVr1dqT2k9hC21LXueqMeIcVyk2Qjvjl1KtkhsU%3D&amp;reserved=0
> 
> Best regards,
> Nam

I have followed your advice Nam and am now using an email cient that
leaves whitespace intact.

Should I reply to this post with the corrected diff, or would it
be better to submit a new patch with it?

Thank you again for taking the time to review.

Brent

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

* Re: [PATCH] staging: most: net: Replace macros HB and LB with static inline functions
  2022-10-06 13:21   ` Brent Pappas
@ 2022-10-06 13:42     ` Nam Cao
  2022-10-06 17:02       ` [PATCH v2] " Brent Pappas
  0 siblings, 1 reply; 9+ messages in thread
From: Nam Cao @ 2022-10-06 13:42 UTC (permalink / raw)
  To: Brent Pappas; +Cc: gregkh, cai.huoqing, kuba, linux-staging, linux-kernel

On Thu, Oct 06, 2022 at 09:21:24AM -0400, Brent Pappas wrote:
> The 10/05/2022 19:57, Nam Cao wrote:
> > On Wed, Oct 05, 2022 at 04:10:44PM +0000, Brent Pappas wrote:
> > > Replace function-like macros "HB" and "LB" with static inline functions
> > > to comply with preferred Linux coding style standards.
> > > 
> > > Signed-off-by: Brent Pappas <pappasbrent@knights.ucf.edu>
> > > ---
> > > diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
> > > index 1d1fe8bff7ee..8a8fbc274b73 100644
> > > --- a/drivers/staging/most/net/net.c
> > > +++ b/drivers/staging/most/net/net.c
> > > @@ -36,8 +36,8 @@
> > >  #define PMS_TELID_MASK         0x0F
> > >  #define PMS_TELID_SHIFT                4
> > >  
> > > -#define HB(value)              ((u8)((u16)(value) >> 8))
> > > -#define LB(value)              ((u8)(value))
> > > +static inline u8 HB(unsigned int value)                { return ((u8)((u16)(value) >> 8)); }
> > > +static inline u8 LB(unsigned int value)                { return ((u8)(value)); }
> > >  
> > >  #define EXTRACT_BIT_SET(bitset_name, value) \
> > >         (((value) >> bitset_name##_SHIFT) & bitset_name##_MASK)
> > 
> > I cannot apply your patch. I think your email client modified some
> > whitespace characters.
> > 
> > Check this for more information:
> > https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.kernel.org%2Fdoc%2Fhtml%2Fv4.10%2Fprocess%2Femail-clients.html&amp;data=05%7C01%7Cpappasbrent%40knights.ucf.edu%7C3748a695ff1e438ecd0b08daa72d66bf%7C5b16e18278b3412c919668342689eeb7%7C0%7C0%7C638006110693613730%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=rq2pgVr1dqT2k9hC21LXueqMeIcVyk2Qjvjl1KtkhsU%3D&amp;reserved=0
> > 
> > Best regards,
> > Nam
> 
> I have followed your advice Nam and am now using an email cient that
> leaves whitespace intact.
> 
> Should I reply to this post with the corrected diff, or would it
> be better to submit a new patch with it?

It's up to you. Replying sometimes make the conversation messy, but for
this case I think it's fine. Don't forget to add "PATCH v2" prefix and a
change log.

Best regards,
Nam

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

* [PATCH v2] staging: most: net: Replace macros HB and LB with static inline functions
  2022-10-06 13:42     ` Nam Cao
@ 2022-10-06 17:02       ` Brent Pappas
  2022-10-06 17:44         ` Nam Cao
  0 siblings, 1 reply; 9+ messages in thread
From: Brent Pappas @ 2022-10-06 17:02 UTC (permalink / raw)
  To: Nam Cao; +Cc: gregkh, cai.huoqing, kuba, linux-staging, linux-kernel

Replace function-like macros "HB" and "LB" with static inline functions
to comply with preferred Linux coding style standards.

Signed-off-by: Brent Pappas <pappasbrent@knights.ucf.edu>
---
Changelog:
V1 -> V2: Resent diff from a mail client that would not replace tabs
          with spaces so that patch can be successfully applied.

diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
index 1d1fe8bff7ee..8a8fbc274b73 100644
--- a/drivers/staging/most/net/net.c
+++ b/drivers/staging/most/net/net.c
@@ -36,8 +36,8 @@
 #define PMS_TELID_MASK		0x0F
 #define PMS_TELID_SHIFT		4
 
-#define HB(value)		((u8)((u16)(value) >> 8))
-#define LB(value)		((u8)(value))
+static inline u8 HB(unsigned int value)		{ return ((u8)((u16)(value) >> 8)); }
+static inline u8 LB(unsigned int value)		{ return ((u8)(value)); }
 
 #define EXTRACT_BIT_SET(bitset_name, value) \
 	(((value) >> bitset_name##_SHIFT) & bitset_name##_MASK) 

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

* Re: [PATCH v2] staging: most: net: Replace macros HB and LB with static inline functions
  2022-10-06 17:02       ` [PATCH v2] " Brent Pappas
@ 2022-10-06 17:44         ` Nam Cao
  2022-10-06 23:07           ` [PATCH v3] " Brent Pappas
  0 siblings, 1 reply; 9+ messages in thread
From: Nam Cao @ 2022-10-06 17:44 UTC (permalink / raw)
  To: Brent Pappas; +Cc: gregkh, cai.huoqing, kuba, linux-staging, linux-kernel

On Thu, Oct 06, 2022 at 01:02:34PM -0400, Brent Pappas wrote:
> Replace function-like macros "HB" and "LB" with static inline functions
> to comply with preferred Linux coding style standards.
> 
> Signed-off-by: Brent Pappas <pappasbrent@knights.ucf.edu>
> ---
> Changelog:
> V1 -> V2: Resent diff from a mail client that would not replace tabs
>           with spaces so that patch can be successfully applied.
> 
> diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
> index 1d1fe8bff7ee..8a8fbc274b73 100644
> --- a/drivers/staging/most/net/net.c
> +++ b/drivers/staging/most/net/net.c
> @@ -36,8 +36,8 @@
>  #define PMS_TELID_MASK		0x0F
>  #define PMS_TELID_SHIFT		4
>  
> -#define HB(value)		((u8)((u16)(value) >> 8))
> -#define LB(value)		((u8)(value))
> +static inline u8 HB(unsigned int value)		{ return ((u8)((u16)(value) >> 8)); }
> +static inline u8 LB(unsigned int value)		{ return ((u8)(value)); }
>  
>  #define EXTRACT_BIT_SET(bitset_name, value) \
>  	(((value) >> bitset_name##_SHIFT) & bitset_name##_MASK) 

Sorry but I still can't apply your patch :(. I think you accidentally
added a trailing space character (at the last line).

Perhaps it's a good idea to send the patch to yourself, download the
email and try applying if it works, before sending it out.

Best regards,
Nam

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

* [PATCH v3] Replace macros HB and LB with static inline functions
  2022-10-06 17:44         ` Nam Cao
@ 2022-10-06 23:07           ` Brent Pappas
  2022-10-20 15:25             ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Brent Pappas @ 2022-10-06 23:07 UTC (permalink / raw)
  To: namcaov
  Cc: cai.huoqing, gregkh, kuba, linux-kernel, linux-staging,
	pappasbrent, Brent Pappas

Replace function-like macros "HB" and "LB" with static inline functions
to comply with preferred Linux coding style standards.

Signed-off-by: Brent Pappas <bpappas@pappasbrent.com>
---
Changelog:
V1 -> V2: Resent diff from a mail client that would not replace tabs
          with spaces so that patch can be successfully applied.
V2 -> V3: Created patch using git format-patch.
		  Tested downloading and applying patch.
          Sent patch using git send-email.

 drivers/staging/most/net/net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
index 1d1fe8bff7ee..8a8fbc274b73 100644
--- a/drivers/staging/most/net/net.c
+++ b/drivers/staging/most/net/net.c
@@ -36,8 +36,8 @@
 #define PMS_TELID_MASK		0x0F
 #define PMS_TELID_SHIFT		4
 
-#define HB(value)		((u8)((u16)(value) >> 8))
-#define LB(value)		((u8)(value))
+static inline u8 HB(unsigned int value)		{ return ((u8)((u16)(value) >> 8)); }
+static inline u8 LB(unsigned int value)		{ return ((u8)(value)); }
 
 #define EXTRACT_BIT_SET(bitset_name, value) \
 	(((value) >> bitset_name##_SHIFT) & bitset_name##_MASK)
-- 
2.34.1


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

* Re: [PATCH v3] Replace macros HB and LB with static inline functions
  2022-10-06 23:07           ` [PATCH v3] " Brent Pappas
@ 2022-10-20 15:25             ` Greg KH
  0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2022-10-20 15:25 UTC (permalink / raw)
  To: Brent Pappas
  Cc: namcaov, cai.huoqing, kuba, linux-kernel, linux-staging, pappasbrent

On Thu, Oct 06, 2022 at 07:07:57PM -0400, Brent Pappas wrote:
> Replace function-like macros "HB" and "LB" with static inline functions
> to comply with preferred Linux coding style standards.
> 
> Signed-off-by: Brent Pappas <bpappas@pappasbrent.com>
> ---
> Changelog:
> V1 -> V2: Resent diff from a mail client that would not replace tabs
>           with spaces so that patch can be successfully applied.
> V2 -> V3: Created patch using git format-patch.
> 		  Tested downloading and applying patch.
>           Sent patch using git send-email.
> 
>  drivers/staging/most/net/net.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/most/net/net.c b/drivers/staging/most/net/net.c
> index 1d1fe8bff7ee..8a8fbc274b73 100644
> --- a/drivers/staging/most/net/net.c
> +++ b/drivers/staging/most/net/net.c
> @@ -36,8 +36,8 @@
>  #define PMS_TELID_MASK		0x0F
>  #define PMS_TELID_SHIFT		4
>  
> -#define HB(value)		((u8)((u16)(value) >> 8))
> -#define LB(value)		((u8)(value))
> +static inline u8 HB(unsigned int value)		{ return ((u8)((u16)(value) >> 8)); }
> +static inline u8 LB(unsigned int value)		{ return ((u8)(value)); }

If you use one less tab, you will not go over the 90 column limit,
right?

Only 1 tab is needed.

thanks,

greg k-h

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

end of thread, other threads:[~2022-10-20 15:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 16:10 [PATCH] staging: most: net: Replace macros HB and LB with static inline functions Brent Pappas
2022-10-05 23:57 ` Nam Cao
2022-10-06  1:39   ` Brent Pappas
2022-10-06 13:21   ` Brent Pappas
2022-10-06 13:42     ` Nam Cao
2022-10-06 17:02       ` [PATCH v2] " Brent Pappas
2022-10-06 17:44         ` Nam Cao
2022-10-06 23:07           ` [PATCH v3] " Brent Pappas
2022-10-20 15:25             ` 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.