linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tmscsim: Fix big left-shifts of unsigned char
@ 2009-06-18 12:14 Roel Kluin
  2009-06-18 13:03 ` James Bottomley
  2009-06-18 14:40 ` Roel Kluin
  0 siblings, 2 replies; 8+ messages in thread
From: Roel Kluin @ 2009-06-18 12:14 UTC (permalink / raw)
  To: garloff, linux-scsi, Andrew Morton

Shifting of u8 causes promotion to signed 'int'

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
I believe this was not intentionally?
see http://osdir.com/ml/git/2009-06/msg01347.html

diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
index 9a42734..09a3c12 100644
--- a/drivers/scsi/tmscsim.c
+++ b/drivers/scsi/tmscsim.c
@@ -894,7 +894,7 @@ din_1:
 	    if (!i) printk (KERN_ERR "DC390: DMA Blast aborted unfinished!\n");
 	    //DC390_write8 (DMA_Cmd, READ_DIRECTION+DMA_IDLE_CMD);
 	    dc390_laststatus &= ~0xff000000;
-	    dc390_laststatus |= bval << 24;
+	    dc390_laststatus |= (unsigned)bval << 24;
 
 	    DEBUG1(printk (KERN_DEBUG "Blast: Read %i times DMA_Status %02x", 0xa000-i, bval));
 	    ResidCnt = (((u32) DC390_read8 (CtcReg_High) << 16) |

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-06-18 14:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-18 12:14 [PATCH] tmscsim: Fix big left-shifts of unsigned char Roel Kluin
2009-06-18 13:03 ` James Bottomley
2009-06-18 13:16   ` Matthew Wilcox
2009-06-18 13:27     ` Boaz Harrosh
2009-06-18 13:36       ` Matthew Wilcox
2009-06-18 14:45         ` James Bottomley
2009-06-18 14:55           ` Matthew Wilcox
2009-06-18 14:40 ` Roel Kluin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).