[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YqhWIiXadDC3hzel@kroah.com>
Date: Tue, 14 Jun 2022 11:34:26 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Nam Cao <namcaov@...il.com>, linux-kernel@...r.kernel.org,
linux-staging@...ts.linux.dev, phil@...lpotter.co.uk
Subject: Re: [PATCH v2 1/2] staging: r8188eu: replace LE_BITS_TO_1BYTE with
clearer codes
On Mon, Jun 13, 2022 at 05:30:24PM +0300, Dan Carpenter wrote:
> On Sun, Jun 12, 2022 at 10:11:43AM +0200, Nam Cao wrote:
> > The statement LE_BITS_TO_1BYTE(__paddr + n, 0, 8) is not obvious on
> > what it is doing, while in truth it is simply reading one byte.
> > Replace these with clearer codes.
> >
> > Signed-off-by: Nam Cao <namcaov@...il.com>
> > ---
> > drivers/staging/r8188eu/include/Hal8188ERateAdaptive.h | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/staging/r8188eu/include/Hal8188ERateAdaptive.h b/drivers/staging/r8188eu/include/Hal8188ERateAdaptive.h
> > index 20d73ca781e8..79e4210c6b65 100644
> > --- a/drivers/staging/r8188eu/include/Hal8188ERateAdaptive.h
> > +++ b/drivers/staging/r8188eu/include/Hal8188ERateAdaptive.h
> > @@ -26,15 +26,15 @@
> > #define GET_TX_REPORT_TYPE1_RERTY_0(__paddr) \
> > le16_get_bits(*(__le16 *)__paddr, GENMASK(15, 0))
> > #define GET_TX_REPORT_TYPE1_RERTY_1(__paddr) \
> > - LE_BITS_TO_1BYTE(__paddr + 2, 0, 8)
> > + ((u8 *)__paddr)[2]
>
> Instead of doing this, I would prefer to just get rid of
> GET_TX_REPORT_TYPE1_RERTY_[1234].
Yes, I agree, that's a mess and almost impossible to understand...
thanks,
greg k-h
Powered by blists - more mailing lists