public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] fix drivers/scsi/sd.c warnings
@ 2002-12-19  6:04 Andrew Morton
  2002-12-19 16:07 ` James Bottomley
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2002-12-19  6:04 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi

Somebody forgot to test with CONFIG_LBD=n:

drivers/scsi/sd.c: In function `sd_init_command':
drivers/scsi/sd.c:304: warning: right shift count >= width of type
drivers/scsi/sd.c:305: warning: right shift count >= width of type
drivers/scsi/sd.c:306: warning: right shift count >= width of type
drivers/scsi/sd.c:307: warning: right shift count >= width of type
drivers/scsi/sd.c: In function `sd_read_capacity':
drivers/scsi/sd.c:1016: warning: left shift count >= width of type
drivers/scsi/sd.c:1017: warning: left shift count >= width of type
drivers/scsi/sd.c:1018: warning: left shift count >= width of type
drivers/scsi/sd.c:1019: warning: left shift count >= width of type



--- 25/drivers/scsi/sd.c~scsi-warnings	Wed Dec 18 22:01:40 2002
+++ 25-akpm/drivers/scsi/sd.c	Wed Dec 18 22:02:41 2002
@@ -174,7 +174,7 @@ static int sd_init_command(struct scsi_c
 {
 	unsigned int this_count, timeout;
 	struct gendisk *disk;
-	sector_t block;
+	u64 block;
 	struct scsi_device *sdp = SCpnt->device;
 
 	timeout = SD_TIMEOUT;
@@ -1013,10 +1013,10 @@ repeat:
 			(buffer[2] << 8) |
 			buffer[3]);			
 	} else {
-		sdkp->capacity = 1 + (((sector_t)buffer[0] << 56) |
-			((sector_t)buffer[1] << 48) |
-			((sector_t)buffer[2] << 40) |
-			((sector_t)buffer[3] << 32) |
+		sdkp->capacity = 1 + (((u64)buffer[0] << 56) |
+			((u64)buffer[1] << 48) |
+			((u64)buffer[2] << 40) |
+			((u64)buffer[3] << 32) |
 			((sector_t)buffer[4] << 24) |
 			((sector_t)buffer[5] << 16) |
 			((sector_t)buffer[6] << 8)  |

_

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

end of thread, other threads:[~2002-12-19 16:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-19  6:04 [patch] fix drivers/scsi/sd.c warnings Andrew Morton
2002-12-19 16:07 ` James Bottomley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox