diff options
Diffstat (limited to 'arch/ia64/hp/sim/simscsi.c')
-rw-r--r-- | arch/ia64/hp/sim/simscsi.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c index a18983a3c934..a3fe97531134 100644 --- a/arch/ia64/hp/sim/simscsi.c +++ b/arch/ia64/hp/sim/simscsi.c | |||
@@ -205,10 +205,11 @@ simscsi_get_disk_size (int fd) | |||
205 | char buf[512]; | 205 | char buf[512]; |
206 | 206 | ||
207 | /* | 207 | /* |
208 | * This is a bit kludgey: the simulator doesn't provide a direct way of determining | 208 | * This is a bit kludgey: the simulator doesn't provide a |
209 | * the disk size, so we do a binary search, assuming a maximum disk size of 4GB. | 209 | * direct way of determining the disk size, so we do a binary |
210 | * search, assuming a maximum disk size of 128GB. | ||
210 | */ | 211 | */ |
211 | for (bit = (4UL << 30)/512; bit != 0; bit >>= 1) { | 212 | for (bit = (128UL << 30)/512; bit != 0; bit >>= 1) { |
212 | req.addr = __pa(&buf); | 213 | req.addr = __pa(&buf); |
213 | req.len = sizeof(buf); | 214 | req.len = sizeof(buf); |
214 | ia64_ssc(fd, 1, __pa(&req), ((sectors | bit) - 1)*512, SSC_READ); | 215 | ia64_ssc(fd, 1, __pa(&req), ((sectors | bit) - 1)*512, SSC_READ); |
@@ -225,8 +226,10 @@ simscsi_readwrite10 (struct scsi_cmnd *sc, int mode) | |||
225 | { | 226 | { |
226 | unsigned long offset; | 227 | unsigned long offset; |
227 | 228 | ||
228 | offset = ( (sc->cmnd[2] << 24) | (sc->cmnd[3] << 16) | 229 | offset = (((unsigned long)sc->cmnd[2] << 24) |
229 | | (sc->cmnd[4] << 8) | (sc->cmnd[5] << 0))*512; | 230 | | ((unsigned long)sc->cmnd[3] << 16) |
231 | | ((unsigned long)sc->cmnd[4] << 8) | ||
232 | | ((unsigned long)sc->cmnd[5] << 0))*512UL; | ||
230 | if (sc->use_sg > 0) | 233 | if (sc->use_sg > 0) |
231 | simscsi_sg_readwrite(sc, mode, offset); | 234 | simscsi_sg_readwrite(sc, mode, offset); |
232 | else | 235 | else |