All of lore.kernel.org
 help / color / mirror / Atom feed
From: don.mullis@gmail.com
To: linux-mmc@vger.kernel.org
Cc: don.mullis@gmail.com
Subject: [PATCH 2.6.32-rc8 2/3] mmc: Clean up mmc_decode_scr() implementation
Date: Sun, 29 Nov 2009 19:38:36 -0800	[thread overview]
Message-ID: <87zl64r8ar.fsf@gmail.com> (raw)

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

                 reply	other threads:[~2009-11-30  3:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87zl64r8ar.fsf@gmail.com \
    --to=don.mullis@gmail.com \
    --cc=873a3wsncj.fsf@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 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.