From: Neil Armstrong <neil.armstrong@linaro.org>
To: Stephan Gerhold <stephan.gerhold@linaro.org>,
Caleb Connolly <caleb.connolly@linaro.org>
Cc: Tom Rini <trini@konsulko.com>, Ramon Fried <rfried.dev@gmail.com>,
Sumit Garg <sumit.garg@kernel.org>,
u-boot@lists.denx.de, u-boot-qcom@groups.io,
Sam Day <me@samcday.com>
Subject: Re: [PATCH 04/13] board: dragonboard410c: Drop UNSTUFF_BITS() macro
Date: Mon, 7 Apr 2025 20:07:42 +0200 [thread overview]
Message-ID: <d54331c8-3da3-40b5-b984-d07156c39f34@linaro.org> (raw)
In-Reply-To: <20250407-db410c-fixes-v1-4-524aefbc8bb4@linaro.org>
On 07/04/2025 18:59, Stephan Gerhold wrote:
> This was originally taken from Linux, but at this point it's an inline
> function upstream and no longer a macro. Given that we just want to extract
> the serial number from the MMC CID, let's just inline that specifically.
> This is also the style used in the MMC core code within U-Boot.
>
> Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
> ---
> board/qualcomm/dragonboard410c/dragonboard410c.c | 18 ++----------------
> 1 file changed, 2 insertions(+), 16 deletions(-)
>
> diff --git a/board/qualcomm/dragonboard410c/dragonboard410c.c b/board/qualcomm/dragonboard410c/dragonboard410c.c
> index c33529d31869b17c7a30ec83af1199d01db472f5..61d68e7f0c6bed16861e6ceaefd2c7dc94807d65 100644
> --- a/board/qualcomm/dragonboard410c/dragonboard410c.c
> +++ b/board/qualcomm/dragonboard410c/dragonboard410c.c
> @@ -22,21 +22,6 @@
>
> DECLARE_GLOBAL_DATA_PTR;
>
> -/* UNSTUFF_BITS macro taken from Linux Kernel: drivers/mmc/core/sd.c */
> -#define UNSTUFF_BITS(resp, start, size) \
> - ({ \
> - const int __size = size; \
> - const u32 __mask = (__size < 32 ? 1 << __size : 0) - 1; \
> - const int __off = 3 - ((start) / 32); \
> - const int __shft = (start) & 31; \
> - u32 __res; \
> - \
> - __res = resp[__off] >> __shft; \
> - if (__size + __shft > 32) \
> - __res |= resp[__off - 1] << ((32 - __shft) % 32); \
> - __res & __mask; \
> - })
> -
> static u32 msm_board_serial(void)
> {
> struct mmc *mmc_dev;
> @@ -48,7 +33,8 @@ static u32 msm_board_serial(void)
> if (mmc_init(mmc_dev))
> return 0;
>
> - return UNSTUFF_BITS(mmc_dev->cid, 16, 32);
> + /* MMC serial number */
> + return mmc_dev->cid[2] << 16 | mmc_dev->cid[3] >> 16;
> }
>
> static void msm_generate_mac_addr(u8 *mac)
>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
next prev parent reply other threads:[~2025-04-07 18:07 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 16:59 [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Stephan Gerhold
2025-04-07 16:59 ` [PATCH 01/13] mach-snapdragon: Fix EL2 boot on DragonBoard 410c Stephan Gerhold
2025-04-07 18:12 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 02/13] board: dragonboard410c: Fix RAM size Stephan Gerhold
2025-04-07 18:06 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 03/13] board: dragonboard410c: Fix BD address Stephan Gerhold
2025-04-07 18:11 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 04/13] board: dragonboard410c: Drop UNSTUFF_BITS() macro Stephan Gerhold
2025-04-07 18:07 ` Neil Armstrong [this message]
2025-04-07 16:59 ` [PATCH 05/13] board: dragonboard410c: Drop reflash functionality Stephan Gerhold
2025-04-07 18:12 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 06/13] board: dragonboard410c: Drop unused linux_image Stephan Gerhold
2025-04-07 18:08 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 07/13] board: dragonboard410c: Use dynamically allocated load addresses Stephan Gerhold
2025-04-07 18:08 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 08/13] board: dragonboard410c: Fix counter frequency Stephan Gerhold
2025-04-07 18:08 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 09/13] board: dragonboard410c: Enable RTL8152 ethernet Stephan Gerhold
2025-04-07 18:09 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 10/13] board: dragonboard410c: Use BOOTSTD instead of DISTRO_DEFAULTS Stephan Gerhold
2025-04-07 18:09 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 11/13] board: dragonboard410c: Enable support for Android boot images Stephan Gerhold
2025-04-07 18:10 ` Neil Armstrong
2025-04-08 7:01 ` Stephan Gerhold
2025-04-08 7:18 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 12/13] board: dragonboard410c: Use button_cmd instead of custom code Stephan Gerhold
2025-04-07 18:10 ` Neil Armstrong
2025-04-07 16:59 ` [PATCH 13/13] board: dragonboard410c: Update maintainers Stephan Gerhold
2025-04-07 18:11 ` Neil Armstrong
2025-04-09 15:23 ` [PATCH 00/13] board: dragonboard410c: Various fixes and cleanup Caleb Connolly
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=d54331c8-3da3-40b5-b984-d07156c39f34@linaro.org \
--to=neil.armstrong@linaro.org \
--cc=caleb.connolly@linaro.org \
--cc=me@samcday.com \
--cc=rfried.dev@gmail.com \
--cc=stephan.gerhold@linaro.org \
--cc=sumit.garg@kernel.org \
--cc=trini@konsulko.com \
--cc=u-boot-qcom@groups.io \
--cc=u-boot@lists.denx.de \
/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