linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Nam Cao <namcaov@gmail.com>
Cc: gregkh@linuxfoundation.org, 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: Mon, 13 Jun 2022 17:30:24 +0300	[thread overview]
Message-ID: <20220613143024.GE2146@kadam> (raw)
In-Reply-To: <4cdacd703158029c0b0f706e3cf1eb8daf4121c0.1655019752.git.namcaov@gmail.com>

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].

regards,
dan carpenter


  reply	other threads:[~2022-06-13 14:30 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 [this message]
2022-06-14  9:34           ` Greg KH
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=20220613143024.GE2146@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --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).