linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Nam Cao <namcaov@gmail.com>,
	linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
	phil@philpotter.co.uk
Subject: Re: [PATCH v2 1/2] staging: r8188eu: replace LE_BITS_TO_1BYTE with clearer codes
Date: Tue, 14 Jun 2022 11:34:26 +0200	[thread overview]
Message-ID: <YqhWIiXadDC3hzel@kroah.com> (raw)
In-Reply-To: <20220613143024.GE2146@kadam>

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@gmail.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

  reply	other threads:[~2022-06-14  9:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-12  1:05 [PATCH 0/2] Clean up some macros Nam Cao
2022-06-12  1:05 ` [PATCH 1/2] staging: r8188eu: simplify " Nam Cao
2022-06-12  4:56   ` Greg KH
2022-06-12  8:11     ` [PATCH v2 0/2] " Nam Cao
2022-06-12  8:11       ` [PATCH v2 1/2] staging: r8188eu: replace LE_BITS_TO_1BYTE with clearer codes Nam Cao
2022-06-13 14:30         ` Dan Carpenter
2022-06-14  9:34           ` Greg KH [this message]
2022-06-14 15:58             ` [PATCH v3 0/2] get rid of confusing macros Nam Cao
2022-06-14 15:58               ` [PATCH v3 1/2] staging: r8188eu: replace " Nam Cao
2022-06-14 15:58               ` [PATCH v3 2/2] staging: r8188eu: remove unused macros Nam Cao
2022-06-15  8:29               ` [PATCH v3 0/2] get rid of confusing macros Dan Carpenter
2022-06-12  8:11       ` [PATCH v2 2/2] staging: r8188eu: remove unused macros Nam Cao
2022-06-12  1:05 ` [PATCH 2/2] staging: r8188eu: replace FIELD_OFFSET with offsetof Nam Cao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YqhWIiXadDC3hzel@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=namcaov@gmail.com \
    --cc=phil@philpotter.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).