Fixed a printf format error again. Rev.127 was clobbered in rev.1.128

by removing parentheses.  The main bug is in gcc: on machines with
64-bit longs and 64-bit long longs,

    (unsigned long long)rdp->total_sectors / ((1024L * 1024L) / DEV_BSIZE))

has type plain unsigned long instead of the correctly promoted type
unsigned long long, so it can not be printfed using %llu format.  Even
1ULL / 1L is mispromoted.  Anyway, casting the correct operand
automatically avoids the problem.  We do not want to to pessimize the
division; we just want to convert to a common maximal type for printing.
This commit is contained in:
Bruce Evans 2002-03-06 06:33:33 +00:00
parent a956ec3bed
commit d4621eac57

View File

@ -194,7 +194,7 @@ ata_raid_attach()
printf("ar%d: %lluMB <ATA ", printf("ar%d: %lluMB <ATA ",
rdp->lun, (unsigned long long) rdp->lun, (unsigned long long)
rdp->total_sectors / ((1024L * 1024L) / DEV_BSIZE)); (rdp->total_sectors / ((1024L * 1024L) / DEV_BSIZE)));
switch (rdp->flags & (AR_F_RAID0 | AR_F_RAID1 | AR_F_SPAN)) { switch (rdp->flags & (AR_F_RAID0 | AR_F_RAID1 | AR_F_SPAN)) {
case AR_F_RAID0: case AR_F_RAID0:
printf("RAID0 "); break; printf("RAID0 "); break;