mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nam Cao <namcaov@gmail.com>
To: gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev,
	namcaov@gmail.com, phil@philpotter.co.uk
Subject: [PATCH v2 1/2] staging: r8188eu: replace LE_BITS_TO_1BYTE with clearer codes
Date: Sun, 12 Jun 2022 10:11:43 +0200	[thread overview]
Message-ID: <4cdacd703158029c0b0f706e3cf1eb8daf4121c0.1655019752.git.namcaov@gmail.com> (raw)
In-Reply-To: <cover.1655019752.git.namcaov@gmail.com>

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]
 #define GET_TX_REPORT_TYPE1_RERTY_2(__paddr)			\
-	LE_BITS_TO_1BYTE(__paddr + 3, 0, 8)
+	((u8 *)__paddr)[3]
 #define GET_TX_REPORT_TYPE1_RERTY_3(__paddr)			\
-	LE_BITS_TO_1BYTE(__paddr + 4, 0, 8)
+	((u8 *)__paddr)[4]
 #define GET_TX_REPORT_TYPE1_RERTY_4(__paddr)			\
-	LE_BITS_TO_1BYTE(__paddr + 5, 0, 8)
+	((u8 *)__paddr)[5]
 #define GET_TX_REPORT_TYPE1_DROP_0(__paddr)			\
-	LE_BITS_TO_1BYTE(__paddr + 6, 0, 8)
+	((u8 *)__paddr)[6]
 /*  End rate adaptive define */
 
 int ODM_RAInfo_Init_all(struct odm_dm_struct *dm_odm);
-- 
2.25.1


  reply	other threads:[~2022-06-12  8:13 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       ` Nam Cao [this message]
2022-06-13 14:30         ` [PATCH v2 1/2] staging: r8188eu: replace LE_BITS_TO_1BYTE with clearer codes Dan Carpenter
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=4cdacd703158029c0b0f706e3cf1eb8daf4121c0.1655019752.git.namcaov@gmail.com \
    --to=namcaov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --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

all inboxes | Powered by JetHome®