[PATCH] Fix MMC warnings

From: Pierre Ossman
Date: Sat Jan 01 2005 - 19:08:59 EST


Here's a patch that fixes the compiler warnings in mmc.c. Index: linux-wbsd/drivers/mmc/mmc.c
===================================================================
--- linux-wbsd/drivers/mmc/mmc.c (revision 117)
+++ linux-wbsd/drivers/mmc/mmc.c (working copy)
@@ -428,14 +428,14 @@

#define UNSTUFF_BITS(resp,start,size) \
({ \
- const u32 __mask = (1 << (size)) - 1; \
+ const u32 __mask = ((size >= 32)?0:(1 << (size))) - 1; \
const int __off = 3 - ((start) / 32); \
const int __shft = (start) & 31; \
u32 __res; \
\
__res = resp[__off] >> __shft; \
if ((size) + __shft >= 32) \
- __res |= resp[__off-1] << (32 - __shft); \
+ __res |= resp[__off-1] << ((32 - __shft) % 32); \
__res & __mask; \
})