[SCSI] sd: fix computation of the full size of the device

When computing the full size of the device, we need to cast
sdkp->capacity before shifting, since in some configurations sector_t
can be a 32-bit number.

Also, change ffz(~x) to the more idiomatic ilog2(x).

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by

H. Peter Anvin and committed by
James Bottomley
520a2c27 a8659597

+1 -1
+1 -1
drivers/scsi/sd.c
··· 1436 1436 1437 1437 { 1438 1438 char cap_str_2[10], cap_str_10[10]; 1439 - u64 sz = sdkp->capacity << ffz(~sector_size); 1439 + u64 sz = (u64)sdkp->capacity << ilog2(sector_size); 1440 1440 1441 1441 string_get_size(sz, STRING_UNITS_2, cap_str_2, 1442 1442 sizeof(cap_str_2));