Commit 7fb71adc authored by Randy Dunlap's avatar Randy Dunlap Committed by Greg Kroah-Hartman

staging/keucr: eliminate sparse warnings in ms.c

Eliminate sparse warnings in ms.c:

drivers/staging/keucr/ms.c:28:58: warning: right shift by bigger than source value
drivers/staging/keucr/ms.c:31:58: warning: right shift by bigger than source value
drivers/staging/keucr/ms.c:789:59: warning: cast truncates bits from constant value (ffffff7f becomes 7f)
Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d8aba9d5
...@@ -9,5 +9,7 @@ typedef u16 *PWORD; ...@@ -9,5 +9,7 @@ typedef u16 *PWORD;
typedef u32 DWORD; typedef u32 DWORD;
typedef u32 *PDWORD; typedef u32 *PDWORD;
#define BYTE_MASK 0xff
#endif #endif
...@@ -25,10 +25,10 @@ int MS_ReaderCopyBlock(struct us_data *us, WORD oldphy, WORD newphy, WORD PhyBlo ...@@ -25,10 +25,10 @@ int MS_ReaderCopyBlock(struct us_data *us, WORD oldphy, WORD newphy, WORD PhyBlo
bcb->CDB[1] = 0x08; bcb->CDB[1] = 0x08;
bcb->CDB[4] = (BYTE)(oldphy); bcb->CDB[4] = (BYTE)(oldphy);
bcb->CDB[3] = (BYTE)(oldphy>>8); bcb->CDB[3] = (BYTE)(oldphy>>8);
bcb->CDB[2] = (BYTE)(oldphy>>16); bcb->CDB[2] = 0; /* (BYTE)(oldphy>>16) */
bcb->CDB[7] = (BYTE)(newphy); bcb->CDB[7] = (BYTE)(newphy);
bcb->CDB[6] = (BYTE)(newphy>>8); bcb->CDB[6] = (BYTE)(newphy>>8);
bcb->CDB[5] = (BYTE)(newphy>>16); bcb->CDB[5] = 0; /* (BYTE)(newphy>>16) */
bcb->CDB[9] = (BYTE)(PhyBlockAddr); bcb->CDB[9] = (BYTE)(PhyBlockAddr);
bcb->CDB[8] = (BYTE)(PhyBlockAddr>>8); bcb->CDB[8] = (BYTE)(PhyBlockAddr>>8);
bcb->CDB[10] = PageNum; bcb->CDB[10] = PageNum;
...@@ -786,7 +786,8 @@ int MS_LibErrorPhyBlock(struct us_data *us, WORD phyblk) ...@@ -786,7 +786,8 @@ int MS_LibErrorPhyBlock(struct us_data *us, WORD phyblk)
MS_LibSetAcquiredErrorBlock(us, phyblk); MS_LibSetAcquiredErrorBlock(us, phyblk);
if (MS_LibIsWritable(us)) if (MS_LibIsWritable(us))
return MS_LibOverwriteExtra(us, phyblk, 0, (BYTE)(~MS_REG_OVR_BKST)); return MS_LibOverwriteExtra(us, phyblk, 0,
(BYTE)(~MS_REG_OVR_BKST & BYTE_MASK));
return MS_STATUS_SUCCESS; return MS_STATUS_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment