From d4621eac57c18087b52f834233f144e5e9055602 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Wed, 6 Mar 2002 06:33:33 +0000 Subject: [PATCH] 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. --- sys/dev/ata/ata-raid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ata/ata-raid.c b/sys/dev/ata/ata-raid.c index 11789bbd4952..75ee196cedc3 100644 --- a/sys/dev/ata/ata-raid.c +++ b/sys/dev/ata/ata-raid.c @@ -194,7 +194,7 @@ ata_raid_attach() printf("ar%d: %lluMB 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)) { case AR_F_RAID0: printf("RAID0 "); break;