Skip to contentSkip to conversation

mmc: mxs-mmc: Fix warning due to incorrect type

PATCH In review Fabio Estevam 3 participants 3 messages Jan 8, 2013 – Jan 28, 2013

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/1 mmc: mxs-mmc: Fix warning due to incorrect type

From: Fabio Estevam <[email protected]>

Fixes the following warning when building with W=1 option:

drivers/mmc/host/mxs-mmc.c: In function 'mxs_mmc_adtc':
drivers/mmc/host/mxs-mmc.c:401:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

The warning happens because 'i' is used in 'for_each_sg(sgl, sg, sg_len, i)' and should be made unsigned.

---
 drivers/mmc/host/mxs-mmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/mxs-mmc.c +1 -1
index 206fe49..eb33cb1 100644
@@ -354,7 +354,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
 	struct dma_async_tx_descriptor *desc;
 	struct scatterlist *sgl = data->sg, *sg;
 	unsigned int sg_len = data->sg_len;
-	int i;
+	unsigned int i;
 
 	unsigned short dma_data_dir, timeout;
 	enum dma_transfer_direction slave_dirn;
Signature · 1 line
1.7.9.5
Acked-by on v1 1/1
#1 lore raw

Dear Fabio Estevam,

Quoted 4 lines

From: Fabio Estevam <[email protected]>

Fixes the following warning when building with W=1 option:

Quoted 8 lines

drivers/mmc/host/mxs-mmc.c: In function 'mxs_mmc_adtc':
drivers/mmc/host/mxs-mmc.c:401:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

The warning happens because 'i' is used in 'for_each_sg(sgl, sg, sg_len, i)' and should be made unsigned.

Nice

Quoted 9 lines
---
 drivers/mmc/host/mxs-mmc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mmc/host/mxs-mmc.c +0 -0
index 206fe49..eb33cb1 100644

drivers/mmc/host/mxs-mmc.c static void mxs_mmc_adtc(struct mxs_mmc_host *host) · line 360

Quoted 8 lines
drivers/mmc/host/mxs-mmc.c +1 -1
@@ -354,7 +354,7 @@ static void mxs_mmc_adtc(struct mxs_mmc_host *host)
 	struct dma_async_tx_descriptor *desc;
 	struct scatterlist *sgl = data->sg, *sg;
 	unsigned int sg_len = data->sg_len;
-	int i;
+	unsigned int i;
 
 	unsigned short dma_data_dir, timeout;
 	enum dma_transfer_direction slave_dirn;

Best regards,
Marek Vasut

#2 lore raw

Hi,

Quoted 6 lines · Marek Vasut
Quoted 6 lines

Fixes the following warning when building with W=1 option:

drivers/mmc/host/mxs-mmc.c: In function 'mxs_mmc_adtc':
drivers/mmc/host/mxs-mmc.c:401:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Quoted 8 lines
Quoted 4 lines

The warning happens because 'i' is used in 'for_each_sg(sgl, sg, sg_len, i)' and should be made unsigned.

Nice

Thanks, pushed to mmc-next for 3.9.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child