mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Schoyswohl, Roland" <Roland.Schoyswohl@ife-doors.com>
To: "barebox@lists.infradead.org" <barebox@lists.infradead.org>
Subject: [PATCH] mmc: fix calculation of Max Enhanced Area
Date: Thu, 23 Mar 2023 13:42:46 +0000	[thread overview]
Message-ID: <AM6PR04MB472829B69D627CA15218927EA2879@AM6PR04MB4728.eurprd04.prod.outlook.com> (raw)

According extcsd documentation, the HC_ERASE_GRP_SIZE must be multiplied by
HC_ERASE_GRP_SIZE and not added.

Signed-off-by: Roland Schoyswohl roland.schoyswohl@ife-doors.com
---
commands/mmc_extcsd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/mmc_extcsd.c b/commands/mmc_extcsd.c
index 7ae068348d..f67c48404a 100644
--- a/commands/mmc_extcsd.c
+++ b/commands/mmc_extcsd.c
@@ -1427,7 +1427,7 @@ static int print_field(u8 *reg, int index)

            case EXT_CSD_MAX_ENH_SIZE_MULT:
                       tmp = get_field_val(EXT_CSD_HC_WP_GRP_SIZE, 0, 0xFF);
-                      tmp = tmp + get_field_val(EXT_CSD_HC_ERASE_GRP_SIZE, 0, 0xFF);
+                      tmp = tmp * get_field_val(EXT_CSD_HC_ERASE_GRP_SIZE, 0, 0xFF);
                       tmp64 *= tmp;
                       tmp64 *= SZ_512K;
                       printf("\tMax Enhanced Area: %llu B\n", tmp64);
--
2.25.1


Knorr-Bremse GmbH
FN 38565p, LG Wr. Neustadt

This transmission is intended solely for the addressee and contains confidential information.
If you are not the intended recipient, please immediately inform the sender and delete the message and any attachments from your system.
Furthermore, please do not copy the message or disclose the contents to anyone unless agreed otherwise. To the extent permitted by law we shall in no way be liable for any damages, whatever their nature, arising out of transmission failures, viruses, external influence, delays and the like.



             reply	other threads:[~2023-03-23 13:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 13:42 Schoyswohl, Roland [this message]
2023-03-24 12:21 ` Sascha Hauer

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=AM6PR04MB472829B69D627CA15218927EA2879@AM6PR04MB4728.eurprd04.prod.outlook.com \
    --to=roland.schoyswohl@ife-doors.com \
    --cc=barebox@lists.infradead.org \
    /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