Skip to contentSkip to conversation

block/iscsi.c: Fix printf format error.

PATCH Applied Richard W.M. Jones 4 participants 4 messages Jul 31, 2013 – Aug 2, 2013 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 block/iscsi.c: Fix printf format error.

From: "Richard W.M. Jones" <[email protected]>

The error on armv7hl was:

block/iscsi.c: In function ‘is_request_lun_aligned’:
block/iscsi.c:251:26: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int64_t’ [-Werror=format=]

                          iscsilun->block_size, sector_num, nb_sectors);
                          ^

This also splits the long line to comply with qemu coding guidelines.

---
 block/iscsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
block/iscsi.c +3 -1
index 5f28c6a..e7c1c2b 100644
@@ -247,7 +247,9 @@ static bool is_request_lun_aligned(int64_t sector_num, int nb_sectors,
 {
     if ((sector_num * BDRV_SECTOR_SIZE) % iscsilun->block_size ||
         (nb_sectors * BDRV_SECTOR_SIZE) % iscsilun->block_size) {
-            error_report("iSCSI misaligned request: iscsilun->block_size %u, sector_num %ld, nb_sectors %d",
+            error_report("iSCSI misaligned request: "
+                         "iscsilun->block_size %u, sector_num %" PRIi64
+                         ", nb_sectors %d",
                          iscsilun->block_size, sector_num, nb_sectors);
             return 0;
     }
Signature · 1 line
1.8.3.1
Reviewed-by on v3 1/1
#1 lore raw

Am 31.07.2013 23:20, schrieb Richard W.M. Jones:

Quoted 21 lines

From: "Richard W.M. Jones" <[email protected]>

The error on armv7hl was:

block/iscsi.c: In function ‘is_request_lun_aligned’:
block/iscsi.c:251:26: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int64_t’ [-Werror=format=]

                          iscsilun->block_size, sector_num, nb_sectors);
                          ^

This also splits the long line to comply with qemu coding guidelines.

---
 block/iscsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
block/iscsi.c +0 -0
index 5f28c6a..e7c1c2b 100644

block/iscsi.c static bool is_request_lun_aligned(int64_t sector_num, int nb_sectors, · line 255

Quoted 10 lines
block/iscsi.c +3 -1
@@ -247,7 +247,9 @@ static bool is_request_lun_aligned(int64_t sector_num, int nb_sectors,
 {
     if ((sector_num * BDRV_SECTOR_SIZE) % iscsilun->block_size ||
         (nb_sectors * BDRV_SECTOR_SIZE) % iscsilun->block_size) {
-            error_report("iSCSI misaligned request: iscsilun->block_size %u, sector_num %ld, nb_sectors %d",
+            error_report("iSCSI misaligned request: "
+                         "iscsilun->block_size %u, sector_num %" PRIi64
+                         ", nb_sectors %d",
                          iscsilun->block_size, sector_num, nb_sectors);
             return 0;
     }
Reviewed-by on v3 1/1
#2 lore raw
In reply to Richard W.M. Jones
Quoted 9 lines · Richard W.M. Jones

From: "Richard W.M. Jones" <[email protected]>

The error on armv7hl was:

block/iscsi.c: In function ‘is_request_lun_aligned’:
block/iscsi.c:251:26: error: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘int64_t’ [-Werror=format=]

                          iscsilun->block_size, sector_num, nb_sectors);
                          ^
Quoted 6 lines

This also splits the long line to comply with qemu coding guidelines.

---
 block/iscsi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)