public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@digeo.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: linux-scsi@vger.kernel.org
Subject: [patch] fix drivers/scsi/sd.c warnings
Date: Wed, 18 Dec 2002 22:04:08 -0800	[thread overview]
Message-ID: <3E016158.CC3D9909@digeo.com> (raw)

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)  |

_

             reply	other threads:[~2002-12-19  6:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-19  6:04 Andrew Morton [this message]
2002-12-19 16:07 ` [patch] fix drivers/scsi/sd.c warnings James Bottomley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3E016158.CC3D9909@digeo.com \
    --to=akpm@digeo.com \
    --cc=James.Bottomley@SteelEye.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox