Skip to contentSkip to conversation

trivial: remove trailing newline from error_report

PATCH In review John Snow 4 participants 6 messages Jun 29, 2015 – Sep 6, 2015 Networking

lore
Share & tools
lore

John Snow

author
#0 lore raw

PATCH v2 1/1 trivial: remove trailing newline from error_report

Minor cleanup.

---
 hw/ide/ahci.c      | 2 +-
 hw/vfio/platform.c | 2 +-
 net/tap-linux.c    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)
hw/ide/ahci.c +1 -1
index b4b65c1..8478d25 100644
@@ -885,7 +885,7 @@ static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
                             prdt_tbl_entry_size(&tbl[i]));
             if (sglist->size > INT32_MAX) {
                 error_report("AHCI Physical Region Descriptor Table describes "
-                             "more than 2 GiB.\n");
+                             "more than 2 GiB.");
                 qemu_sglist_destroy(sglist);
                 r = -1;
                 goto out;
hw/vfio/platform.c +1 -1
index 5c678b9..932d631 100644
@@ -225,7 +225,7 @@ static void vfio_intp_interrupt(VFIOINTp *intp)
 
     ret = event_notifier_test_and_clear(&intp->interrupt);
     if (!ret) {
-        error_report("Error when clearing fd=%d (ret = %d)\n",
+        error_report("Error when clearing fd=%d (ret = %d)",
                      event_notifier_get_fd(&intp->interrupt), ret);
     }
 
net/tap-linux.c +2 -2
index 394f2a6..5bd9d21 100644
@@ -211,7 +211,7 @@ int tap_fd_set_vnet_le(int fd, int is_le)
         return -errno;
     }
 
-    error_report("TUNSETVNETLE ioctl() failed: %s.\n", strerror(errno));
+    error_report("TUNSETVNETLE ioctl() failed: %s.", strerror(errno));
     abort();
 }
 
@@ -228,7 +228,7 @@ int tap_fd_set_vnet_be(int fd, int is_be)
         return -errno;
     }
 
-    error_report("TUNSETVNETBE ioctl() failed: %s.\n", strerror(errno));
+    error_report("TUNSETVNETBE ioctl() failed: %s.", strerror(errno));
     abort();
 }
 
Signature · 1 line
2.1.0
Reviewed-by on v2 1/1
#2 lore raw
In reply to John Snow
Quoted 8 lines · John Snow

Minor cleanup.

---
 hw/ide/ahci.c      | 2 +-
 hw/vfio/platform.c | 2 +-
 net/tap-linux.c    | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Laszlo Ersek suggested a compile-time check (e.g. BUILD_BUG_ON()). Have you looked into this?

Perhaps something along the lines of:

BUILD_BUG_ON(__builtin_constant_p(fmt) &&

             __builtin_strlen(fmt) > 0 &&
	     fmt[__builtin_strlen(fmt) - 1] == '\n')
author
#3 lore raw
Quoted 9 lines · Stefan Hajnoczi
Quoted 5 lines · John Snow

Minor cleanup.

| 2 +- hw/vfio/platform.c | 2 +- net/tap-linux.c | 4 ++-- 3
files changed, 4 insertions(+), 4 deletions(-)

Quoted 8 lines

Laszlo Ersek suggested a compile-time check (e.g. BUILD_BUG_ON()). Have you looked into this?

Perhaps something along the lines of:

BUILD_BUG_ON(__builtin_constant_p(fmt) && __builtin_strlen(fmt) > 0 && fmt[__builtin_strlen(fmt) - 1] == '\n')

ping for 2.5; I don't think this ever made it in.

#4 lore raw
Quoted 15 lines · John Snow
Quoted 12 lines · Stefan Hajnoczi
Quoted 5 lines · John Snow

Minor cleanup.

| 2 +- hw/vfio/platform.c | 2 +- net/tap-linux.c | 4 ++-- 3
files changed, 4 insertions(+), 4 deletions(-)

Laszlo Ersek suggested a compile-time check (e.g. BUILD_BUG_ON()). Have you looked into this?

Quoted 7 lines
Quoted 5 lines

Perhaps something along the lines of:

BUILD_BUG_ON(__builtin_constant_p(fmt) && __builtin_strlen(fmt) > 0 && fmt[__builtin_strlen(fmt) - 1] == '\n')

ping for 2.5; I don't think this ever made it in.

CCing Michael explicitly since this is for the trivial tree