cciss: use upper_32_bits() macro to eliminate warnings
authorRandy Dunlap <randy.dunlap@oracle.com>
Wed, 6 Feb 2008 09:36:54 +0000 (01:36 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Wed, 6 Feb 2008 18:41:03 +0000 (10:41 -0800)
Use upper_32_bits(x) macro to handle shifts that may be >= the width of
the data type.

drivers/block/cciss.c: In function 'do_cciss_request':
drivers/block/cciss.c:2655: warning: right shift count >= width of type
drivers/block/cciss.c:2656: warning: right shift count >= width of type
drivers/block/cciss.c:2657: warning: right shift count >= width of type
drivers/block/cciss.c:2658: warning: right shift count >= width of type

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: <mike.miller@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/block/cciss.c

index 855ce8e..9715be3 100644 (file)
@@ -2630,12 +2630,14 @@ static void do_cciss_request(struct request_queue *q)
                        c->Request.CDB[8] = creq->nr_sectors & 0xff;
                        c->Request.CDB[9] = c->Request.CDB[11] = c->Request.CDB[12] = 0;
                } else {
+                       u32 upper32 = upper_32_bits(start_blk);
+
                        c->Request.CDBLen = 16;
                        c->Request.CDB[1]= 0;
-                       c->Request.CDB[2]= (start_blk >> 56) & 0xff;    //MSB
-                       c->Request.CDB[3]= (start_blk >> 48) & 0xff;
-                       c->Request.CDB[4]= (start_blk >> 40) & 0xff;
-                       c->Request.CDB[5]= (start_blk >> 32) & 0xff;
+                       c->Request.CDB[2]= (upper32 >> 24) & 0xff;      //MSB
+                       c->Request.CDB[3]= (upper32 >> 16) & 0xff;
+                       c->Request.CDB[4]= (upper32 >>  8) & 0xff;
+                       c->Request.CDB[5]= upper32 & 0xff;
                        c->Request.CDB[6]= (start_blk >> 24) & 0xff;
                        c->Request.CDB[7]= (start_blk >> 16) & 0xff;
                        c->Request.CDB[8]= (start_blk >>  8) & 0xff;