All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.32-rc8 2/3] mmc: Clean up mmc_decode_scr() implementation
@ 2009-11-30  3:38 don.mullis
  0 siblings, 0 replies; only message in thread
From: don.mullis @ 2009-11-30  3:38 UTC (permalink / raw)
  To: linux-mmc; +Cc: don.mullis

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;
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-11-30  3:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-30  3:38 [PATCH 2.6.32-rc8 2/3] mmc: Clean up mmc_decode_scr() implementation don.mullis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.