Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jan 2011 15:42:11 -0500
From:      Michael Butler <imb@protected-networks.net>
To:        current@FreeBSD.org
Subject:   cosmetic nit in mmc.c
Message-ID:  <4D335823.3060109@protected-networks.net>

next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------030203080106080105020304
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

In the process of making the sdhci driver work with my laptop, I noted a
cosmetic issue where the SD card's serial number is not correctly
reported (it's always zero). Possible patch attached,

	imb

--------------030203080106080105020304
Content-Type: text/x-diff;
 name="mmc_get_bits.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="mmc_get_bits.patch"

Index: mmc.c
===================================================================
--- mmc.c	(revision 217480)
+++ mmc.c	(working copy)
@@ -749,7 +749,10 @@
 	uint32_t retval = bits[i] >> shift;
 	if (size + shift > 32)
 		retval |= bits[i - 1] << (32 - shift);
-	return (retval & ((1 << size) - 1));
+        if (size < 32)
+		return (retval & ((1 << size) - 1));
+	else 
+		return (retval);
 }
 
 static void

--------------030203080106080105020304--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D335823.3060109>