qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/arm/virt.c: Remove newline from error_report() string
@ 2024-01-18 13:16 Peter Maydell
  2024-01-18 15:17 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2024-01-18 13:16 UTC (permalink / raw)
  To: qemu-arm, qemu-devel

error_report() strings should not include trailing newlines; remove
the newline from the error we print when devices won't fit into the
address space of the CPU.

This commit also fixes the accidental hardcoded tabs that were in
this line, since we have to touch the line anyway.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/arm/virt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 2793121cb41..da6cea30534 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1771,8 +1771,8 @@ static void virt_set_memmap(VirtMachineState *vms, int pa_bits)
     /* Base address of the high IO region */
     memtop = base = device_memory_base + ROUND_UP(device_memory_size, GiB);
     if (memtop > BIT_ULL(pa_bits)) {
-	    error_report("Addressing limited to %d bits, but memory exceeds it by %llu bytes\n",
-			 pa_bits, memtop - BIT_ULL(pa_bits));
+        error_report("Addressing limited to %d bits, but memory exceeds it by %llu bytes",
+                     pa_bits, memtop - BIT_ULL(pa_bits));
         exit(EXIT_FAILURE);
     }
     if (base < device_memory_base) {
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/arm/virt.c: Remove newline from error_report() string
  2024-01-18 13:16 [PATCH] hw/arm/virt.c: Remove newline from error_report() string Peter Maydell
@ 2024-01-18 15:17 ` Philippe Mathieu-Daudé
  2024-01-18 15:30   ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 15:17 UTC (permalink / raw)
  To: Peter Maydell, qemu-arm, qemu-devel

On 18/1/24 14:16, Peter Maydell wrote:
> error_report() strings should not include trailing newlines; remove
> the newline from the error we print when devices won't fit into the
> address space of the CPU.
> 
> This commit also fixes the accidental hardcoded tabs that were in
> this line, since we have to touch the line anyway.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   hw/arm/virt.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/arm/virt.c: Remove newline from error_report() string
  2024-01-18 15:17 ` Philippe Mathieu-Daudé
@ 2024-01-18 15:30   ` Philippe Mathieu-Daudé
  2024-01-18 16:09     ` Peter Maydell
  0 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 15:30 UTC (permalink / raw)
  To: Peter Maydell, qemu-arm, qemu-devel
  Cc: Thomas Huth, Daniel P. Berrangé, Markus Armbruster,
	Alex Bennée

On 18/1/24 16:17, Philippe Mathieu-Daudé wrote:
> On 18/1/24 14:16, Peter Maydell wrote:
>> error_report() strings should not include trailing newlines; remove
>> the newline from the error we print when devices won't fit into the
>> address space of the CPU.
>>
>> This commit also fixes the accidental hardcoded tabs that were in
>> this line, since we have to touch the line anyway.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>>   hw/arm/virt.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

BTW there is another case:

$ spatch \
   --macro-file scripts/cocci-macro-file.h \
   --sp-file scripts/coccinelle/err-bad-newline.cocci \
   --keep-comments --use-gitgrep --dir .
./hw/arm/virt.c:1775:38:"Addressing limited to %d bits, but memory 
exceeds it by %llu bytes\n"
./ui/gtk.c:1094:56:"gtk: unexpected touch event type\n"

We could run this some of these coccinelle scripts on CI,
as a new job in .gitlab-ci.d/static_checks.yml or extending
the check-patch job...

Patch on the way for ui/gtk.c.



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/arm/virt.c: Remove newline from error_report() string
  2024-01-18 15:30   ` Philippe Mathieu-Daudé
@ 2024-01-18 16:09     ` Peter Maydell
  2024-01-18 16:56       ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Maydell @ 2024-01-18 16:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-arm, qemu-devel, Thomas Huth, Daniel P. Berrangé,
	Markus Armbruster, Alex Bennée

On Thu, 18 Jan 2024 at 15:30, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> On 18/1/24 16:17, Philippe Mathieu-Daudé wrote:
> > On 18/1/24 14:16, Peter Maydell wrote:
> >> error_report() strings should not include trailing newlines; remove
> >> the newline from the error we print when devices won't fit into the
> >> address space of the CPU.
> >>
> >> This commit also fixes the accidental hardcoded tabs that were in
> >> this line, since we have to touch the line anyway.
> >>
> >> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> >> ---
> >>   hw/arm/virt.c | 4 ++--
> >>   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
> BTW there is another case:
>
> $ spatch \
>    --macro-file scripts/cocci-macro-file.h \
>    --sp-file scripts/coccinelle/err-bad-newline.cocci \
>    --keep-comments --use-gitgrep --dir .
> ./hw/arm/virt.c:1775:38:"Addressing limited to %d bits, but memory
> exceeds it by %llu bytes\n"
> ./ui/gtk.c:1094:56:"gtk: unexpected touch event type\n"
>
> We could run this some of these coccinelle scripts on CI,
> as a new job in .gitlab-ci.d/static_checks.yml or extending
> the check-patch job...

checkpatch catches it, if you read the output, which is
how I noticed this in the first place (I was originally
touching the line to fix the tab damage).

-- PMM


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] hw/arm/virt.c: Remove newline from error_report() string
  2024-01-18 16:09     ` Peter Maydell
@ 2024-01-18 16:56       ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 16:56 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-arm, qemu-devel, Thomas Huth, Daniel P. Berrangé,
	Markus Armbruster, Alex Bennée

On 18/1/24 17:09, Peter Maydell wrote:
> On Thu, 18 Jan 2024 at 15:30, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> On 18/1/24 16:17, Philippe Mathieu-Daudé wrote:
>>> On 18/1/24 14:16, Peter Maydell wrote:
>>>> error_report() strings should not include trailing newlines; remove
>>>> the newline from the error we print when devices won't fit into the
>>>> address space of the CPU.
>>>>
>>>> This commit also fixes the accidental hardcoded tabs that were in
>>>> this line, since we have to touch the line anyway.
>>>>
>>>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>>>> ---
>>>>    hw/arm/virt.c | 4 ++--
>>>>    1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>>
>> BTW there is another case:
>>
>> $ spatch \
>>     --macro-file scripts/cocci-macro-file.h \
>>     --sp-file scripts/coccinelle/err-bad-newline.cocci \
>>     --keep-comments --use-gitgrep --dir .
>> ./hw/arm/virt.c:1775:38:"Addressing limited to %d bits, but memory
>> exceeds it by %llu bytes\n"
>> ./ui/gtk.c:1094:56:"gtk: unexpected touch event type\n"
>>
>> We could run this some of these coccinelle scripts on CI,
>> as a new job in .gitlab-ci.d/static_checks.yml or extending
>> the check-patch job...
> 
> checkpatch catches it, if you read the output, which is
> how I noticed this in the first place (I was originally
> touching the line to fix the tab damage).

Ah, no need to waste more CI minutes then :)

Thanks!


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-18 16:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-18 13:16 [PATCH] hw/arm/virt.c: Remove newline from error_report() string Peter Maydell
2024-01-18 15:17 ` Philippe Mathieu-Daudé
2024-01-18 15:30   ` Philippe Mathieu-Daudé
2024-01-18 16:09     ` Peter Maydell
2024-01-18 16:56       ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).