From: Don Mullis <don.mullis@gmail.com>
To: linux-mmc@vger.kernel.org
Subject: [PATCH 2.6.31-rc5 2/3] mmc: Clean up mmc_decode_scr() implementation
Date: Thu, 05 Nov 2009 19:01:59 -0800 [thread overview]
Message-ID: <4AF391A7.4040908@gmail.com> (raw)
In-Reply-To: <4AF38EA0.4080604@gmail.com>
In mmc_decode_scr(), back out coercion of 128-bit-oriented
UNSTUFF_BITS() macro to work on 64-bit raw_scr field; invoke
UNSTUFF_BITS_ARRAY() instead.
Tested by verifying that /sys output for scr register is unchanged.
Signed-off-by: don.mullis@gmail.com
---
drivers/mmc/core/sd.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
Index: linux-2.6/drivers/mmc/core/sd.c
===================================================================
--- linux-2.6.orig/drivers/mmc/core/sd.c 2009-09-29 12:50:36.000000000 -0700
+++ linux-2.6/drivers/mmc/core/sd.c 2009-11-01 22:30:37.000000000 -0800
@@ -163,20 +163,16 @@ static int mmc_decode_scr(struct mmc_car
{
struct sd_scr *scr = &card->scr;
unsigned int scr_struct;
- u32 resp[4];
- resp[3] = card->raw_scr[1];
- resp[2] = card->raw_scr[0];
-
- scr_struct = UNSTUFF_BITS(resp, 60, 4);
+ scr_struct = UNSTUFF_BITS_ARRAY(card->raw_scr, 60, 4);
if (scr_struct != 0) {
printk(KERN_ERR "%s: unrecognised SCR structure version %d\n",
mmc_hostname(card->host), scr_struct);
return -EINVAL;
}
- scr->sda_vsn = UNSTUFF_BITS(resp, 56, 4);
- scr->bus_widths = UNSTUFF_BITS(resp, 48, 4);
+ scr->sda_vsn = UNSTUFF_BITS_ARRAY(card->raw_scr, 56, 4);
+ scr->bus_widths = UNSTUFF_BITS_ARRAY(card->raw_scr, 48, 4);
return 0;
}
next prev parent reply other threads:[~2009-11-06 3:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-06 2:49 [PATCH 2.6.31-rc5 1/3] mmc: Unify and generalize UNSTUFF_BITS macro Don Mullis
2009-11-06 3:01 ` Don Mullis [this message]
2009-11-06 3:03 ` [PATCH 2.6.31-rc5 3/3] mmc: Add SD_STATUS register dump to debugfs Don Mullis
2009-11-06 3:17 ` [PATCH 2.6.31-rc5 1/3] mmc: Unify and generalize UNSTUFF_BITS macro Don Mullis
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=4AF391A7.4040908@gmail.com \
--to=don.mullis@gmail.com \
--cc=linux-mmc@vger.kernel.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