Skip to contentSkip to conversation

drivers: mmc: Change buffer type in ALLOC_CACHE_ALIGN_BUFFER macro

PATCH New sunil.m at techveda.org 2 participants 6 messages Jun 19, 2017 – Oct 20, 2017 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: mmc: Change buffer type in ALLOC_CACHE_ALIGN_BUFFER macro

From: Suniel Mahesh <[email protected]>

__be32_to_cpu() accepts argument of type __be32. This patch changes type of the buffer in ALLOC_CACHE_ALIGN_BUFFER macro to __be32, which is then passed to __be32_to_cpu().
This prevents sparse build warnings.
drivers/mmc/mmc.c: warning: cast to restricted __be32

---
Note:
- Build was carried out with the above changes, no build errors reported.

---
 drivers/mmc/mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/mmc.c +2 -2
index 3cdf6a4..3d4da4c 100644
@@ -882,8 +882,8 @@ static int sd_change_freq(struct mmc *mmc)
 {
 	int err;
 	struct mmc_cmd cmd;
-	ALLOC_CACHE_ALIGN_BUFFER(uint, scr, 2);
-	ALLOC_CACHE_ALIGN_BUFFER(uint, switch_status, 16);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, scr, 2);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, switch_status, 16);
 	struct mmc_data data;
 	int timeout;
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 drivers: mmc: Change buffer type in ALLOC_CACHE_ALIGN_BUFFER macro

Quoted 10 lines · sunil.m at techveda.org

From: Suniel Mahesh <[email protected]>

__be32_to_cpu() accepts argument of type __be32. This patch changes type of the buffer in ALLOC_CACHE_ALIGN_BUFFER macro to __be32, which is then passed to __be32_to_cpu().
This prevents sparse build warnings.
drivers/mmc/mmc.c: warning: cast to restricted __be32

Applied to u-boot-mmc.

Best Regards,
Jaehoon Chung

Quoted 24 lines

---
Note:
- Build was carried out with the above changes, no build errors reported.

---
 drivers/mmc/mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/mmc.c +2 -2
index 3cdf6a4..3d4da4c 100644
@@ -882,8 +882,8 @@ static int sd_change_freq(struct mmc *mmc)
 {
 	int err;
 	struct mmc_cmd cmd;
-	ALLOC_CACHE_ALIGN_BUFFER(uint, scr, 2);
-	ALLOC_CACHE_ALIGN_BUFFER(uint, switch_status, 16);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, scr, 2);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, switch_status, 16);
 	struct mmc_data data;
 	int timeout;
 
#2 lore raw

PATCH 1/1 drivers: mmc: Change buffer type in ALLOC_CACHE_ALIGN_BUFFER macro

Quoted 9 lines · Jaehoon Chung
Quoted 8 lines · sunil.m at techveda.org

From: Suniel Mahesh <[email protected]>

__be32_to_cpu() accepts argument of type __be32. This patch changes type of the buffer in ALLOC_CACHE_ALIGN_BUFFER macro to __be32, which is then passed to __be32_to_cpu().
This prevents sparse build warnings.
drivers/mmc/mmc.c: warning: cast to restricted __be32

Quoted 4 lines
Quoted 2 lines

Applied to u-boot-mmc.

Hi, It says the patch has been applied to u-boot-mmc git tree, but I couldn't find it there applied.
http://git.denx.de/?p=u-boot/u-boot-mmc.git;a=summary

are there any issues with the patch or am I looking at the wrong place ?

Thanks
suniel

Quoted 29 lines

Best Regards,
Jaehoon Chung

Quoted 24 lines

---
Note:
- Build was carried out with the above changes, no build errors reported.

---
 drivers/mmc/mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/mmc.c +2 -2
index 3cdf6a4..3d4da4c 100644
@@ -882,8 +882,8 @@ static int sd_change_freq(struct mmc *mmc)
 {
 	int err;
 	struct mmc_cmd cmd;
-	ALLOC_CACHE_ALIGN_BUFFER(uint, scr, 2);
-	ALLOC_CACHE_ALIGN_BUFFER(uint, switch_status, 16);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, scr, 2);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, switch_status, 16);
 	struct mmc_data data;
 	int timeout;
 
#3 lore raw

PATCH 1/1 drivers: mmc: Change buffer type in ALLOC_CACHE_ALIGN_BUFFER macro

Quoted 13 lines · Suniel Mahesh
Quoted 12 lines · Jaehoon Chung
Quoted 10 lines · sunil.m at techveda.org

From: Suniel Mahesh <[email protected]>

__be32_to_cpu() accepts argument of type __be32. This patch changes type of the buffer in ALLOC_CACHE_ALIGN_BUFFER macro to __be32, which is then passed to __be32_to_cpu().
This prevents sparse build warnings.
drivers/mmc/mmc.c: warning: cast to restricted __be32

Quoted 7 lines
Quoted 1 line

Applied to u-boot-mmc.

Hi, It says the patch has been applied to u-boot-mmc git tree, but I couldn't find it there applied.
http://git.denx.de/?p=u-boot/u-boot-mmc.git;a=summary

are there any issues with the patch or am I looking at the wrong place ?

Will re-apply.
Thanks for pointing out.

Best Regards,
Jaehoon Chung

Quoted 36 lines

Thanks
suniel

Quoted 29 lines

Best Regards,
Jaehoon Chung

Quoted 24 lines

---
Note:
- Build was carried out with the above changes, no build errors reported.

---
 drivers/mmc/mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/mmc.c +2 -2
index 3cdf6a4..3d4da4c 100644
@@ -882,8 +882,8 @@ static int sd_change_freq(struct mmc *mmc)
 {
 	int err;
 	struct mmc_cmd cmd;
-	ALLOC_CACHE_ALIGN_BUFFER(uint, scr, 2);
-	ALLOC_CACHE_ALIGN_BUFFER(uint, switch_status, 16);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, scr, 2);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, switch_status, 16);
 	struct mmc_data data;
 	int timeout;
 
#4 lore raw

PATCH v2 1/1 drivers: mmc: Change buffer type in ALLOC_CACHE_ALIGN_BUFFER macro

From: Suniel Mahesh <[email protected]>

__be32_to_cpu() accepts argument of type __be32. This patch changes type of the buffer in ALLOC_CACHE_ALIGN_BUFFER macro to __be32, which is then passed to __be32_to_cpu().
This prevents sparse build warnings.
drivers/mmc/mmc.c: warning: cast to restricted __be32

---
Changes for v2:
- rebased on latest u-boot tree (2017.11.rc1)
- patch was accepted long time ago, but not applied to u-boot-mmc, please apply.
---
Note:
Tested on latest u-boot mainline tree, no build issues.

---
 drivers/mmc/mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/mmc.c +2 -2
index 38d2e07..8716ac7 100644
@@ -882,8 +882,8 @@ static int sd_change_freq(struct mmc *mmc)
 {
 	int err;
 	struct mmc_cmd cmd;
-	ALLOC_CACHE_ALIGN_BUFFER(uint, scr, 2);
-	ALLOC_CACHE_ALIGN_BUFFER(uint, switch_status, 16);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, scr, 2);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, switch_status, 16);
 	struct mmc_data data;
 	int timeout;
 
Signature · 1 line
1.9.1
#5 lore raw

PATCH v2 1/1 drivers: mmc: Change buffer type in ALLOC_CACHE_ALIGN_BUFFER macro

Quoted 10 lines · sunil.m at techveda.org

From: Suniel Mahesh <[email protected]>

__be32_to_cpu() accepts argument of type __be32. This patch changes type of the buffer in ALLOC_CACHE_ALIGN_BUFFER macro to __be32, which is then passed to __be32_to_cpu().
This prevents sparse build warnings.
drivers/mmc/mmc.c: warning: cast to restricted __be32

Applied to u-boot-mmc!

Best Regards,
Jaehoon Chung

Quoted 28 lines

---
Changes for v2:
- rebased on latest u-boot tree (2017.11.rc1)
- patch was accepted long time ago, but not applied to u-boot-mmc, please apply.
---
Note:
Tested on latest u-boot mainline tree, no build issues.

---
 drivers/mmc/mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/mmc/mmc.c +2 -2
index 38d2e07..8716ac7 100644
@@ -882,8 +882,8 @@ static int sd_change_freq(struct mmc *mmc)
 {
 	int err;
 	struct mmc_cmd cmd;
-	ALLOC_CACHE_ALIGN_BUFFER(uint, scr, 2);
-	ALLOC_CACHE_ALIGN_BUFFER(uint, switch_status, 16);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, scr, 2);
+	ALLOC_CACHE_ALIGN_BUFFER(__be32, switch_status, 16);
 	struct mmc_data data;
 	int timeout;