[Qemu-devel] [PATCH] oslib: strip trailing '\n' from error_setg() string argument

Philippe Mathieu-Daudé posted 1 patch 6 years, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170516001150.11508-1-f4bug@amsat.org
Test checkpatch passed
Test docker passed
Test s390x passed
util/oslib-posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] oslib: strip trailing '\n' from error_setg() string argument
Posted by Philippe Mathieu-Daudé 6 years, 11 months ago
spotted by Coccinelle script scripts/coccinelle/err-bad-newline.cocci

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 util/oslib-posix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index 4d9189e9ef..7ca02f0103 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -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);
-- 
2.11.0


Re: [Qemu-devel] [Qemu-trivial] [PATCH] oslib: strip trailing '\n' from error_setg() string argument
Posted by Laurent Vivier 6 years, 11 months ago
On 16/05/2017 02:11, Philippe Mathieu-Daudé wrote:
> spotted by Coccinelle script scripts/coccinelle/err-bad-newline.cocci
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  util/oslib-posix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/util/oslib-posix.c b/util/oslib-posix.c
> index 4d9189e9ef..7ca02f0103 100644
> --- a/util/oslib-posix.c
> +++ b/util/oslib-posix.c
> @@ -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);
> 
Reviewed-by: Laurent Vivier <lvivier@redhat.com>


Re: [Qemu-devel] [PATCH] oslib: strip trailing '\n' from error_setg() string argument
Posted by Stefan Hajnoczi 6 years, 11 months ago
On Mon, May 15, 2017 at 09:11:49PM -0300, Philippe Mathieu-Daudé wrote:
> spotted by Coccinelle script scripts/coccinelle/err-bad-newline.cocci
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  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
Re: [Qemu-devel] [PATCH] oslib: strip trailing '\n' from error_setg() string argument
Posted by Philippe Mathieu-Daudé 6 years, 11 months ago
On 05/17/2017 09:48 AM, Stefan Hajnoczi wrote:
> On Mon, May 15, 2017 at 09:11:49PM -0300, Philippe Mathieu-Daudé wrote:
>> spotted by Coccinelle script scripts/coccinelle/err-bad-newline.cocci
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  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.

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!

> 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.

>
> Stefan
>

Regards,

Phil.

[Qemu-devel] [PATCH] coccinelle: fix typo in comment
Posted by Philippe Mathieu-Daudé 6 years, 11 months ago
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 scripts/coccinelle/return_directly.cocci | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/coccinelle/return_directly.cocci b/scripts/coccinelle/return_directly.cocci
index 48680f2c2a..4cf50e75ea 100644
--- a/scripts/coccinelle/return_directly.cocci
+++ b/scripts/coccinelle/return_directly.cocci
@@ -1,4 +1,4 @@
-// replace 'R = X; return R;' with 'return R;'
+// replace 'R = X; return R;' with 'return X;'
 @@
 identifier VAR;
 expression E;
-- 
2.11.0


Re: [Qemu-devel] [PATCH] coccinelle: fix typo in comment
Posted by Eric Blake 6 years, 11 months ago
On 05/15/2017 07:11 PM, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  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,
Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/scripts/coccinelle/return_directly.cocci b/scripts/coccinelle/return_directly.cocci
> index 48680f2c2a..4cf50e75ea 100644
> --- a/scripts/coccinelle/return_directly.cocci
> +++ b/scripts/coccinelle/return_directly.cocci
> @@ -1,4 +1,4 @@
> -// replace 'R = X; return R;' with 'return R;'
> +// replace 'R = X; return R;' with 'return X;'
>  @@
>  identifier VAR;
>  expression E;
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PATCH] coccinelle: fix typo in comment
Posted by Philippe Mathieu-Daudé 6 years, 11 months ago
On 05/16/2017 11:35 AM, Eric Blake wrote:
> On 05/15/2017 07:11 PM, Philippe Mathieu-Daudé wrote:
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  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!

>
> At any rate,
> Reviewed-by: Eric Blake <eblake@redhat.com>

Thanks!

>
>>
>> diff --git a/scripts/coccinelle/return_directly.cocci b/scripts/coccinelle/return_directly.cocci
>> index 48680f2c2a..4cf50e75ea 100644
>> --- a/scripts/coccinelle/return_directly.cocci
>> +++ b/scripts/coccinelle/return_directly.cocci
>> @@ -1,4 +1,4 @@
>> -// replace 'R = X; return R;' with 'return R;'
>> +// replace 'R = X; return R;' with 'return X;'
>>  @@
>>  identifier VAR;
>>  expression E;
>>
>