Patchwork fix /proc/self/maps output

login
register
mail settings
Submitter Christophe Lyon
Date March 29, 2013, 4:01 p.m.
Message ID <CAKdteOY+vnGOFHQAsihxqO2YTzoexj3p7i4kTVbVro+8fqgxow@mail.gmail.com>
Download mbox | patch
Permalink /patch/232450/
State New
Headers show

Comments

Christophe Lyon - March 29, 2013, 4:01 p.m.
Add a space at end of line when there is no filename to print, to
conform to linux kernel format.

Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>
---
 linux-user/syscall.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
1.7.10.4

On 29 March 2013 16:18, Eric Blake <eblake@redhat.com> wrote:
> On 03/29/2013 09:13 AM, Christophe Lyon wrote:
>> Hi,
>>
>> Sorry I wasn't aware of such restrictions (I'm used to gcc/binutils
>> conventions), and my thunderbird does display my patch as if it were
>> inline :-)
>> So.... trying a cut-and-paste approach in gmail, for this one character patch:
>
> Still not ideal.  The commentary above should not be part of the final
> commit message, so you should move it...
>
>>
>>
>> /proc/self/maps: Add a space at end of line when there is no filename
>> to print, to conform to linux kernel format.
>>
>> Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>
>
> ...here, after a --- line that tells 'git am' where to stop reading
> commit message.  'git send-email' is your friend.  Then whether or not
> you use 'git send-email', it is always wise to test if your patch is
> usable by first sending it to yourself, and seeing if 'git am' will do
> the right thing with it.
>
> http://wiki.qemu.org/Contribute/SubmitAPatch has more hints.
>
> --
> Eric Blake   eblake redhat com    +1-919-301-3266
> Libvirt virtualization library http://libvirt.org
>
Peter Maydell - March 29, 2013, 5:53 p.m.
On 29 March 2013 16:01, Christophe Lyon <christophe.lyon@linaro.org> wrote:
> Add a space at end of line when there is no filename to print, to
> conform to linux kernel format.
>
> Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>


> ---
>  linux-user/syscall.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a148d9f..3b0ca86 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -5016,7 +5016,7 @@ static int open_self_maps(void *cpu_env, int fd)
>                      " %c%c%c%c %08" PRIx64 " %02x:%02x %d%s%s\n",
>                      h2g(min), h2g(max), flag_r, flag_w,
>                      flag_x, flag_p, offset, dev_maj, dev_min, inode,
> -                    path[0] ? "          " : "", path);
> +                    path[0] ? "          " : " ", path);
>          }
>      }
>
> --
> 1.7.10.4
H. Peter Anvin - March 29, 2013, 10:35 p.m.
On 03/29/2013 09:01 AM, Christophe Lyon wrote:
> Add a space at end of line when there is no filename to print, to
> conform to linux kernel format.
> 
> Signed-off-by: Christophe Lyon <christophe.lyon@linaro.org>
> ---
>  linux-user/syscall.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a148d9f..3b0ca86 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -5016,7 +5016,7 @@ static int open_self_maps(void *cpu_env, int fd)
>                      " %c%c%c%c %08" PRIx64 " %02x:%02x %d%s%s\n",
>                      h2g(min), h2g(max), flag_r, flag_w,
>                      flag_x, flag_p, offset, dev_maj, dev_min, inode,
> -                    path[0] ? "          " : "", path);
> +                    path[0] ? "          " : " ", path);
>          }
>      }
> 

Please move the fixed space into the format.  Perhaps even use a %-123s
type format even...

	-hpa

Patch

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index a148d9f..3b0ca86 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5016,7 +5016,7 @@  static int open_self_maps(void *cpu_env, int fd)
                     " %c%c%c%c %08" PRIx64 " %02x:%02x %d%s%s\n",
                     h2g(min), h2g(max), flag_r, flag_w,
                     flag_x, flag_p, offset, dev_maj, dev_min, inode,
-                    path[0] ? "          " : "", path);
+                    path[0] ? "          " : " ", path);
         }
     }