If x86 architecture, an unsigned variable shift more than 31 times means a
rotation.
But in some architecture, shift 32 bit or more will give a zero value.
For example,
An unsigned int variable of 0x11223344 runs the operation "<< 32",
In x86 architecture, its value is still 0x11223344
But its value will change as 0x00000000 in ARM.
This patch try to fix those architecture-specific code, and made it both
work in x86 and the other architecture.
Signed-off-by: Aries Lee <[email protected]>
---
diff --git a/drivers/memstick/host/jmb38x_ms.c
b/drivers/memstick/host/jmb38x_ms.c
index d89d925..272e89c 100644
--- a/drivers/memstick/host/jmb38x_ms.c
+++ b/drivers/memstick/host/jmb38x_ms.c
@@ -287,8 +287,8 @@ static unsigned int jmb38x_ms_write_reg_data(struct
jmb38x_ms_host *host,
return off;
while (host->io_pos < 8 && length) {
- host->io_word[1] &= ~(0xff << (host->io_pos * 8));
- host->io_word[1] |= buf[off++] << (host->io_pos * 8);
+ host->io_word[1] &= ~(0xff << ((host->io_pos-4) * 8));
+ host->io_word[1] |= buf[off++] << ((host->io_pos-4) * 8);
host->io_pos++;
length--;
}