2022-11-06 01:59:50

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] staging: rtl8192e: remove unnecesscary macro defines

On Sun, 2022-11-06 at 12:11 +1100, Jacob Bai wrote:
> remove useless macro defines
[]
> diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
> index eabb4187d907..aad1842857c0 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
> @@ -307,12 +307,12 @@ void rtl92e_config_mac(struct net_device *dev)
> struct r8192_priv *priv = rtllib_priv(dev);
>
> if (priv->bTXPowerDataReadFromEEPORM) {
> - dwArrayLen = MACPHY_Array_PGLength;
> - pdwArray = Rtl819XMACPHY_Array_PG;
> + dwArrayLen = RTL8192E_MAC_ARRAY_PG_LEN;
> + pdwArray = RTL8192E_MAC_ARRAY_PG;

Perhaps use ARRAY_SIZE instead.



2022-11-06 02:01:10

by Jacob Bai

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] staging: rtl8192e: remove unnecesscary macro defines

On Sat, Nov 05, 2022 at 06:18:41PM -0700, Joe Perches wrote:
> On Sun, 2022-11-06 at 12:11 +1100, Jacob Bai wrote:
> > remove useless macro defines
> []
> > diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
> > index eabb4187d907..aad1842857c0 100644
> > --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
> > +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
> > @@ -307,12 +307,12 @@ void rtl92e_config_mac(struct net_device *dev)
> > struct r8192_priv *priv = rtllib_priv(dev);
> >
> > if (priv->bTXPowerDataReadFromEEPORM) {
> > - dwArrayLen = MACPHY_Array_PGLength;
> > - pdwArray = Rtl819XMACPHY_Array_PG;
> > + dwArrayLen = RTL8192E_MAC_ARRAY_PG_LEN;
> > + pdwArray = RTL8192E_MAC_ARRAY_PG;
>
> Perhaps use ARRAY_SIZE instead.
>
As the other drivers under rtlwifi are using ARRAY_LEN or ARRAY_LENGTH,
maybe it's better to keep the same format?

2022-11-06 02:17:36

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] staging: rtl8192e: remove unnecesscary macro defines

On Sun, 2022-11-06 at 12:31 +1100, Jacob Bai wrote:
> On Sat, Nov 05, 2022 at 06:18:41PM -0700, Joe Perches wrote:
> > On Sun, 2022-11-06 at 12:11 +1100, Jacob Bai wrote:
> > > remove useless macro defines
> > []
> > > diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
> > > index eabb4187d907..aad1842857c0 100644
> > > --- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
> > > +++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
> > > @@ -307,12 +307,12 @@ void rtl92e_config_mac(struct net_device *dev)
> > > struct r8192_priv *priv = rtllib_priv(dev);
> > >
> > > if (priv->bTXPowerDataReadFromEEPORM) {
> > > - dwArrayLen = MACPHY_Array_PGLength;
> > > - pdwArray = Rtl819XMACPHY_Array_PG;
> > > + dwArrayLen = RTL8192E_MAC_ARRAY_PG_LEN;
> > > + pdwArray = RTL8192E_MAC_ARRAY_PG;
> >
> > Perhaps use ARRAY_SIZE instead.
> >
> As the other drivers under rtlwifi are using ARRAY_LEN or ARRAY_LENGTH,
> maybe it's better to keep the same format?

Maybe it's better to use the typical kernel style.

$ git grep ARRAY_SIZE drivers/net/wireless/realtek/rtlwifi/
vs
$ git grep ARRAY_SIZE drivers/staging/rtl*