All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Adding ifdefs to call the respective routines only when their configs are enabled
@ 2021-05-24 22:56 Swetha Joshi
  2021-05-25  0:48 ` no-reply
  2021-05-25  1:53 ` Richard Henderson
  0 siblings, 2 replies; 4+ messages in thread
From: Swetha Joshi @ 2021-05-24 22:56 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Swetha

From: Swetha <swjoshi@microsoft.com>

Signed-off-by: Swetha <swjoshi@microsoft.com>
---
 target/arm/kvm64.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/target/arm/kvm64.c b/target/arm/kvm64.c
index dff85f6db9..724ce78265 100644
--- a/target/arm/kvm64.c
+++ b/target/arm/kvm64.c
@@ -1403,7 +1403,10 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr)
     hwaddr paddr;
     Object *obj = qdev_get_machine();
     VirtMachineState *vms = VIRT_MACHINE(obj);
+    bool acpi_enabled = false;
+#ifdef CONFIG_ARM_VIRT
     bool acpi_enabled = virt_is_acpi_enabled(vms);
+    #endif /* CONFIG_ARM_VIRT */
 
     assert(code == BUS_MCEERR_AR || code == BUS_MCEERR_AO);
 
@@ -1426,12 +1429,13 @@ void kvm_arch_on_sigbus_vcpu(CPUState *c, int code, void *addr)
              */
             if (code == BUS_MCEERR_AR) {
                 kvm_cpu_synchronize_state(c);
-                if (!acpi_ghes_record_errors(ACPI_HEST_SRC_ID_SEA, paddr)) {
-                    kvm_inject_arm_sea(c);
-                } else {
-                    error_report("failed to record the error");
-                    abort();
+#ifdef CONFIG_ACPI_APEI
+                if (acpi_ghes_record_errors(ACPI_HEST_SRC_ID_SEA, paddr)) {
+                  error_report("failed to record the error");
+                  abort();
                 }
+#endif /* CONFIG_ACPI_APEI */
+                kvm_inject_arm_sea(c);
             }
             return;
         }
-- 
2.25.1



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

* Re: [PATCH] Adding ifdefs to call the respective routines only when their configs are enabled
  2021-05-24 22:56 [PATCH] Adding ifdefs to call the respective routines only when their configs are enabled Swetha Joshi
@ 2021-05-25  0:48 ` no-reply
  2021-05-25  1:53 ` Richard Henderson
  1 sibling, 0 replies; 4+ messages in thread
From: no-reply @ 2021-05-25  0:48 UTC (permalink / raw)
  To: swethajoshi139; +Cc: qemu-trivial, swjoshi, qemu-devel

Patchew URL: https://patchew.org/QEMU/20210524225608.3191809-1-swethajoshi139@gmail.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20210524225608.3191809-1-swethajoshi139@gmail.com
Subject: [PATCH] Adding ifdefs to call the respective routines only when their configs are enabled

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20210524225608.3191809-1-swethajoshi139@gmail.com -> patchew/20210524225608.3191809-1-swethajoshi139@gmail.com
Switched to a new branch 'test'
18cab39 Adding ifdefs to call the respective routines only when their configs are enabled

=== OUTPUT BEGIN ===
ERROR: suspect code indent for conditional statements (16, 18)
#38: FILE: target/arm/kvm64.c:1433:
+                if (acpi_ghes_record_errors(ACPI_HEST_SRC_ID_SEA, paddr)) {
+                  error_report("failed to record the error");

total: 1 errors, 0 warnings, 28 lines checked

Commit 18cab39bcd46 (Adding ifdefs to call the respective routines only when their configs are enabled) has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20210524225608.3191809-1-swethajoshi139@gmail.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH] Adding ifdefs to call the respective routines only when their configs are enabled
  2021-05-24 22:56 [PATCH] Adding ifdefs to call the respective routines only when their configs are enabled Swetha Joshi
  2021-05-25  0:48 ` no-reply
@ 2021-05-25  1:53 ` Richard Henderson
  2021-05-25  2:14   ` Swetha Joshi
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Henderson @ 2021-05-25  1:53 UTC (permalink / raw)
  To: Swetha Joshi, qemu-devel; +Cc: qemu-trivial, Swetha

On 5/24/21 3:56 PM, Swetha Joshi wrote:
> From: Swetha <swjoshi@microsoft.com>
> 
> Signed-off-by: Swetha <swjoshi@microsoft.com>

What are you trying to accomplish?
That's what belongs in the commit message that you omitted.

> +    bool acpi_enabled = false;
> +#ifdef CONFIG_ARM_VIRT
>       bool acpi_enabled = virt_is_acpi_enabled(vms);

Of course this doesn't compile, having declared acpi_enabled twice.  So you 
have clearly not tested this patch sufficiently.

The cc to qemu-trivial is unwarranted.


r~


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

* Re: [PATCH] Adding ifdefs to call the respective routines only when their configs are enabled
  2021-05-25  1:53 ` Richard Henderson
@ 2021-05-25  2:14   ` Swetha Joshi
  0 siblings, 0 replies; 4+ messages in thread
From: Swetha Joshi @ 2021-05-25  2:14 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Swetha, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]

Hey Richard,

I think I submitted the wrong patch, sorry about that. I will go ahead and
submit the correct commit id now. What I was trying to do was, when kvm is
enabled and if we don't want to include CONFIG_ARM_VIRT or
CONFIG_ACPI_APEI, compilation fails as virt_is_acpi_enabled() routine is
defined in virt.h and acpi_ghes_record_errors() is defined in ghes.h.

~ Swetha

On Mon, May 24, 2021 at 6:53 PM Richard Henderson <
richard.henderson@linaro.org> wrote:

> On 5/24/21 3:56 PM, Swetha Joshi wrote:
> > From: Swetha <swjoshi@microsoft.com>
> >
> > Signed-off-by: Swetha <swjoshi@microsoft.com>
>
> What are you trying to accomplish?
> That's what belongs in the commit message that you omitted.
>
> > +    bool acpi_enabled = false;
> > +#ifdef CONFIG_ARM_VIRT
> >       bool acpi_enabled = virt_is_acpi_enabled(vms);
>
> Of course this doesn't compile, having declared acpi_enabled twice.  So
> you
> have clearly not tested this patch sufficiently.
>
> The cc to qemu-trivial is unwarranted.
>
>
> r~
>


-- 
Regards

Swetha Joshi.

[-- Attachment #2: Type: text/html, Size: 1853 bytes --]

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

end of thread, other threads:[~2021-05-25  2:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 22:56 [PATCH] Adding ifdefs to call the respective routines only when their configs are enabled Swetha Joshi
2021-05-25  0:48 ` no-reply
2021-05-25  1:53 ` Richard Henderson
2021-05-25  2:14   ` Swetha Joshi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.