Skip to contentSkip to conversation

oslib: strip trailing '\n' from error_setg() string argument

PATCH Applied Philippe Mathieu-Daudé 4 participants 7 messages May 16, 2017 – May 20, 2017 Coccinelle/Semantic Patches (SmPL)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 oslib: strip trailing '\n' from error_setg() string argument

spotted by Coccinelle script scripts/coccinelle/err-bad-newline.cocci

---
 util/oslib-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/oslib-posix.c +1 -1
index 4d9189e9ef..7ca02f0103 100644
@@ -447,7 +447,7 @@ void os_mem_prealloc(int fd, char *area, size_t memory, int smp_cpus,
     /* touch pages simultaneously */
     if (touch_all_pages(area, hpagesize, numpages, smp_cpus)) {
         error_setg(errp, "os_mem_prealloc: Insufficient free host memory "
-            "pages available to allocate guest RAM\n");
+            "pages available to allocate guest RAM");
     }
 
     ret = sigaction(SIGBUS, &oldact, NULL);
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/1 coccinelle: fix typo in comment

---
 scripts/coccinelle/return_directly.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/coccinelle/return_directly.cocci +1 -1
index 48680f2c2a..4cf50e75ea 100644
@@ -1,4 +1,4 @@
-// replace 'R = X; return R;' with 'return R;'
+// replace 'R = X; return R;' with 'return X;'
 @@
 identifier VAR;
 expression E;
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#2 lore raw

Re: [Qemu-devel] [PATCH] coccinelle: fix typo in comment

Quoted 4 lines · Philippe Mathieu-Daudé
---
 scripts/coccinelle/return_directly.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Did you intend for this to be threaded with your other 'oslib: strip trailing '\n'...' patch? If so, where's the 0/2 cover letter and proper subject lines?

At any rate,

Quoted 12 lines
scripts/coccinelle/return_directly.cocci +1 -1
index 48680f2c2a..4cf50e75ea 100644
@@ -1,4 +1,4 @@
-// replace 'R = X; return R;' with 'return R;'
+// replace 'R = X; return R;' with 'return X;'
 @@
 identifier VAR;
 expression E;
Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org
#3 lore raw

Re: [Qemu-devel] [PATCH] coccinelle: fix typo in comment

Quoted 9 lines · Eric Blake
Quoted 4 lines · Philippe Mathieu-Daudé
---
 scripts/coccinelle/return_directly.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Did you intend for this to be threaded with your other 'oslib: strip trailing '\n'...' patch? If so, where's the 0/2 cover letter and proper subject lines?

Hi Eric, I think I did a mistake in my command, I intended to generate the patches in the same branch but wanted to send them as unrelated (without cover). I didn't noticed while sending until your remark, I'll double-check next time!

Quoted 3 lines

At any rate,

Thanks!

Quoted 14 lines
Quoted 13 lines
scripts/coccinelle/return_directly.cocci +1 -1
index 48680f2c2a..4cf50e75ea 100644
@@ -1,4 +1,4 @@
-// replace 'R = X; return R;' with 'return R;'
+// replace 'R = X; return R;' with 'return X;'
 @@
 identifier VAR;
 expression E;
Reviewed-by on v1 1/1
#4 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 13 lines · Philippe Mathieu-Daudé

spotted by Coccinelle script scripts/coccinelle/err-bad-newline.cocci

---
 util/oslib-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/oslib-posix.c +0 -0
index 4d9189e9ef..7ca02f0103 100644

util/oslib-posix.c void os_mem_prealloc(int fd, char *area, size_t memory, int smp_cpus, · line 453

Quoted 8 lines
util/oslib-posix.c +1 -1
@@ -447,7 +447,7 @@ void os_mem_prealloc(int fd, char *area, size_t memory, int smp_cpus,
     /* touch pages simultaneously */
     if (touch_all_pages(area, hpagesize, numpages, smp_cpus)) {
         error_setg(errp, "os_mem_prealloc: Insufficient free host memory "
-            "pages available to allocate guest RAM\n");
+            "pages available to allocate guest RAM");
     }
 
     ret = sigaction(SIGBUS, &oldact, NULL);
#5 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 6 lines · Philippe Mathieu-Daudé

spotted by Coccinelle script scripts/coccinelle/err-bad-newline.cocci

---
 util/oslib-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Please send multi-patch series with a cover letter and proper patch numbering ([PATCH 0/2], [PATCH 1/2], [PATCH 2/2]). git-format-patch and git-send-email normally do this. It's important so that patch management tools and continuous integration systems can track your patches.

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

#6 lore raw
Quoted 8 lines · Stefan Hajnoczi
Quoted 6 lines · Philippe Mathieu-Daudé

spotted by Coccinelle script scripts/coccinelle/err-bad-newline.cocci

---
 util/oslib-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 5 lines

Please send multi-patch series with a cover letter and proper patch numbering ([PATCH 0/2], [PATCH 1/2], [PATCH 2/2]). git-format-patch and git-send-email normally do this. It's important so that patch management tools and continuous integration systems can track your patches.

Hi Stefan, I intended one command to generate unrelated patches from the same branch at once and send them individually without cover letter. I didn't noticed they'd go as a serie. I'll double-check next time!

Quoted 2 lines

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Hmm I can't see it there maybe this part was not for this patch, I'll resend it soon with r-b tags.

Quoted 3 lines

Stefan

Regards,

Phil.