[02/10] staging: rtl8192e: Calculate definition of MSR_LINK_MASK

Message ID 8c8a126a83683bae69d0fd20a93bdea8f810f6d0.1675792435.git.philipp.g.hortmann@gmail.com
State New
Headers
Series staging: rtl8192e: Rename constants and variables from rtl_dm.h |

Commit Message

Philipp Hortmann Feb. 7, 2023, 6:16 p.m. UTC
  Calculate definition of MSR_LINK_MASK ((1<<0)|(1<<1)) = 3. Equation is not
accepted by checkpatch because of missing spaces.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Greg KH Feb. 8, 2023, 12:31 p.m. UTC | #1
On Tue, Feb 07, 2023 at 07:16:22PM +0100, Philipp Hortmann wrote:
> Calculate definition of MSR_LINK_MASK ((1<<0)|(1<<1)) = 3. Equation is not
> accepted by checkpatch because of missing spaces.
> 
> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
> index 1546bb575293..20a35c9caee8 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
> +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
> @@ -170,7 +170,7 @@ enum _RTL8192PCI_HW {
>  #define	BW_OPMODE_20MHZ			BIT2
>  	IC_VERRSION		= 0x301,
>  	MSR			= 0x303,
> -#define MSR_LINK_MASK      ((1<<0)|(1<<1))
> +#define MSR_LINK_MASK      3

This is a bit field, it should be:
	#define MSR_LINK_MASK	(BIT(1) | BIT(0))
right?

thanks,

greg k-h
  
Joe Perches Feb. 8, 2023, 3:56 p.m. UTC | #2
On Wed, 2023-02-08 at 13:31 +0100, Greg Kroah-Hartman wrote:
> On Tue, Feb 07, 2023 at 07:16:22PM +0100, Philipp Hortmann wrote:
> > Calculate definition of MSR_LINK_MASK ((1<<0)|(1<<1)) = 3. Equation is not
> > accepted by checkpatch because of missing spaces.
[]
> > diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
[]
> > @@ -170,7 +170,7 @@ enum _RTL8192PCI_HW {
> >  #define	BW_OPMODE_20MHZ			BIT2
> >  	IC_VERRSION		= 0x301,
> >  	MSR			= 0x303,
> > -#define MSR_LINK_MASK      ((1<<0)|(1<<1))
> > +#define MSR_LINK_MASK      3
> 
> This is a bit field, it should be:
> 	#define MSR_LINK_MASK	(BIT(1) | BIT(0))
> right?

Perhaps better as GENMASK(1, 0)
  

Patch

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
index 1546bb575293..20a35c9caee8 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_hw.h
@@ -170,7 +170,7 @@  enum _RTL8192PCI_HW {
 #define	BW_OPMODE_20MHZ			BIT2
 	IC_VERRSION		= 0x301,
 	MSR			= 0x303,
-#define MSR_LINK_MASK      ((1<<0)|(1<<1))
+#define MSR_LINK_MASK      3
 #define MSR_LINK_MANAGED   2
 #define MSR_LINK_ADHOC     1
 #define MSR_LINK_MASTER    3