]> xenbits.xensource.com Git - seabios.git/commitdiff
block: Report drive->sectors using "%u" instead of "%d"
authorKevin O'Connor <kevin@koconnor.net>
Wed, 23 Dec 2015 20:42:35 +0000 (15:42 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Mon, 28 Dec 2015 16:48:27 +0000 (11:48 -0500)
The sector count is a 64bit number that is often reported as a 32bit
number (due to limitations in dprintf).  Consistently use "%u"
reporting to avoid confusing negative numbers.

Reported-by: Tobias Diedrich <tobiasdiedrich@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/block.c
src/hw/blockcmd.c

index 1762e2a33f9160bc633d5528365dd41749643416..b4530fc88916aa5e86538f5a6ae61cbc8cd23f0f 100644 (file)
@@ -162,7 +162,7 @@ setup_translation(struct drive_s *drive)
     // clip to 1024 cylinders in lchs
     if (cylinders > 1024)
         cylinders = 1024;
-    dprintf(1, "drive %p: PCHS=%u/%d/%d translation=%s LCHS=%d/%d/%d s=%d\n"
+    dprintf(1, "drive %p: PCHS=%u/%d/%d translation=%s LCHS=%d/%d/%d s=%u\n"
             , drive
             , drive->pchs.cylinder, drive->pchs.head, drive->pchs.sector
             , desc
index 0725b46db6b464016054fe86e51d0c9fee9cc325..093c5d73e934a09e3c88f4c9f0c17320a44a437b 100644 (file)
@@ -232,7 +232,7 @@ scsi_drive_setup(struct drive_s *drive, const char *s, int prio)
         return -1;
     }
     drive->sectors = (u64)be32_to_cpu(capdata.sectors) + 1;
-    dprintf(1, "%s blksize=%d sectors=%d\n"
+    dprintf(1, "%s blksize=%d sectors=%u\n"
             , s, drive->blksize, (unsigned)drive->sectors);
 
     // We do not recover from USB stalls, so try to be safe and avoid