[PATCH 1/1] mmc: Standardise capability type

Subsystems: multimedia card (mmc), secure digital (sd) and sdio subsystem, the rest

STALE5040d

3 messages, 2 authors, 2012-10-24 · open the first message on its own page

[PATCH 1/1] mmc: Standardise capability type

From: Lee Jones <hidden>
Date: 2012-10-24 13:17:55

There are discrepancies with regards to how MMC capabilities
are carried throughout the subsystem. Let's standardise them
to elevate any confusion.

Cc: Chris Ball <redacted>
Cc: linux-mmc at vger.kernel.org
Signed-off-by: Lee Jones <redacted>
---
 drivers/mmc/core/mmc.c     |    2 +-
 include/linux/mmc/dw_mmc.h |    4 ++--
 include/linux/mmc/host.h   |    2 +-
 include/linux/mmc/sdhci.h  |    4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 7cc4638..f31bf80 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -239,7 +239,7 @@ static void mmc_select_card_type(struct mmc_card *card)
 {
 	struct mmc_host *host = card->host;
 	u8 card_type = card->ext_csd.raw_card_type & EXT_CSD_CARD_TYPE_MASK;
-	unsigned int caps = host->caps, caps2 = host->caps2;
+	unsigned long caps = host->caps, caps2 = host->caps2;
 	unsigned int hs_max_dtr = 0;
 
 	if (card_type & EXT_CSD_CARD_TYPE_26)
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index 7c6a113..60b71ae 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -229,8 +229,8 @@ struct dw_mci_board {
 	u32 quirks; /* Workaround / Quirk flags */
 	unsigned int bus_hz; /* Clock speed at the cclk_in pad */
 
-	unsigned int caps;	/* Capabilities */
-	unsigned int caps2;	/* More capabilities */
+	unsigned long caps;	/* Capabilities */
+	unsigned long caps2;	/* More capabilities */
 	/*
 	 * Override fifo depth. If 0, autodetect it from the FIFOTH register,
 	 * but note that this may not be reliable after a bootloader has used
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 7abb0e1..f89c968 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -241,7 +241,7 @@ struct mmc_host {
 #define MMC_CAP_CMD23		(1 << 30)	/* CMD23 supported. */
 #define MMC_CAP_HW_RESET	(1 << 31)	/* Hardware reset */
 
-	unsigned int		caps2;		/* More host capabilities */
+	unsigned long		caps2;		/* More host capabilities */
 
 #define MMC_CAP2_BOOTPART_NOACC	(1 << 0)	/* Boot partition no access */
 #define MMC_CAP2_CACHE_CTRL	(1 << 1)	/* Allow cache control */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index fa8529a..8c20910 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -157,8 +157,8 @@ struct sdhci_host {
 
 	struct timer_list timer;	/* Timer for timeouts */
 
-	unsigned int caps;	/* Alternative CAPABILITY_0 */
-	unsigned int caps1;	/* Alternative CAPABILITY_1 */
+	unsigned long caps;	/* Alternative CAPABILITY_0 */
+	unsigned long caps1;	/* Alternative CAPABILITY_1 */
 
 	unsigned int            ocr_avail_sdio;	/* OCR bit masks */
 	unsigned int            ocr_avail_sd;
-- 
1.7.9.5

Re: [PATCH 1/1] mmc: Standardise capability type

From: Arnd Bergmann <arnd@arndb.de>
Date: 2012-10-24 13:21:38

On Wednesday 24 October 2012, Lee Jones wrote:
There are discrepancies with regards to how MMC capabilities
are carried throughout the subsystem. Let's standardise them
to elevate any confusion.

Cc: Chris Ball <redacted>
Cc: linux-mmc at vger.kernel.org
Signed-off-by: Lee Jones <redacted>
Why make it "unsigned long" then? I think that adds to the
confusion because it's sometimes 32 bits and sometimes 64 bits,
depending on the CPU. Since it's a bitmask, I would suggest
using u32 to make the size explicit.

	Arnd

Re: [PATCH 1/1] mmc: Standardise capability type

From: Lee Jones <hidden>
Date: 2012-10-24 14:53:15

On Wed, 24 Oct 2012, Arnd Bergmann wrote:
On Wednesday 24 October 2012, Lee Jones wrote:
quoted
There are discrepancies with regards to how MMC capabilities
are carried throughout the subsystem. Let's standardise them
to elevate any confusion.

Cc: Chris Ball <redacted>
Cc: linux-mmc at vger.kernel.org
Signed-off-by: Lee Jones <redacted>
Why make it "unsigned long" then? I think that adds to the
confusion because it's sometimes 32 bits and sometimes 64 bits,
depending on the CPU. Since it's a bitmask, I would suggest
using u32 to make the size explicit.
I'm not sure that it leaves any confusion. It perhaps wastes a little
space on 64bit architectures, but that also applies to a great deal
of other bitmasks floating around.

I can do it if you feel that passionate about it, but it's a bigger
job to hunt down all occurrences and change them over. I only felt
strongly enough about it to craft this patch because I noticed the
inconsistency as I created new populate caps for OF functionality.

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help