[Qemu-devel] [PATCH] arm_gicv3_kvm: Fix compile warning

Pranith Kumar posted 1 patch 8 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170829173226.7625-1-bobby.prani@gmail.com
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
hw/intc/arm_gicv3_kvm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[Qemu-devel] [PATCH] arm_gicv3_kvm: Fix compile warning
Posted by Pranith Kumar 8 years, 2 months ago
Fix the following warning:

/home/pranith/qemu/hw/intc/arm_gicv3_kvm.c:296:17: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
            if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
                ^             ~
/home/pranith/qemu/hw/intc/arm_gicv3_kvm.c:296:17: note: add parentheses after the '!' to evaluate the bitwise operator first
            if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
                ^
/home/pranith/qemu/hw/intc/arm_gicv3_kvm.c:296:17: note: add parentheses around left hand side expression to silence this warning
            if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
                ^

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 hw/intc/arm_gicv3_kvm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
index 6051c77705..481fe5405a 100644
--- a/hw/intc/arm_gicv3_kvm.c
+++ b/hw/intc/arm_gicv3_kvm.c
@@ -293,7 +293,7 @@ static void kvm_arm_gicv3_put(GICv3State *s)
             kvm_gicr_access(s, GICR_PROPBASER + 4, ncpu, &regh, true);
 
             reg64 = c->gicr_pendbaser;
-            if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
+            if (!(c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS)) {
                 /* Setting PTZ is advised if LPIs are disabled, to reduce
                  * GIC initialization time.
                  */
-- 
2.11.0


Re: [Qemu-devel] [PATCH] arm_gicv3_kvm: Fix compile warning
Posted by Pranith Kumar 8 years, 2 months ago
I should have worded the subject better. The warning is pointing to an
actual bug.

On Tue, Aug 29, 2017 at 1:32 PM, Pranith Kumar <bobby.prani@gmail.com> wrote:
> Fix the following warning:
>
> /home/pranith/qemu/hw/intc/arm_gicv3_kvm.c:296:17: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
>             if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
>                 ^             ~
> /home/pranith/qemu/hw/intc/arm_gicv3_kvm.c:296:17: note: add parentheses after the '!' to evaluate the bitwise operator first
>             if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
>                 ^
> /home/pranith/qemu/hw/intc/arm_gicv3_kvm.c:296:17: note: add parentheses around left hand side expression to silence this warning
>             if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
>                 ^
>
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> ---
>  hw/intc/arm_gicv3_kvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
> index 6051c77705..481fe5405a 100644
> --- a/hw/intc/arm_gicv3_kvm.c
> +++ b/hw/intc/arm_gicv3_kvm.c
> @@ -293,7 +293,7 @@ static void kvm_arm_gicv3_put(GICv3State *s)
>              kvm_gicr_access(s, GICR_PROPBASER + 4, ncpu, &regh, true);
>
>              reg64 = c->gicr_pendbaser;
> -            if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
> +            if (!(c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS)) {
>                  /* Setting PTZ is advised if LPIs are disabled, to reduce
>                   * GIC initialization time.
>                   */
> --
> 2.11.0
>



-- 
Pranith

Re: [Qemu-devel] [PATCH] arm_gicv3_kvm: Fix compile warning
Posted by Pranith Kumar 8 years, 2 months ago
CC'ing stable for 2.10.

On Tue, Aug 29, 2017 at 1:32 PM, Pranith Kumar <bobby.prani@gmail.com> wrote:
> Fix the following warning:
>
> /home/pranith/qemu/hw/intc/arm_gicv3_kvm.c:296:17: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
>             if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
>                 ^             ~
> /home/pranith/qemu/hw/intc/arm_gicv3_kvm.c:296:17: note: add parentheses after the '!' to evaluate the bitwise operator first
>             if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
>                 ^
> /home/pranith/qemu/hw/intc/arm_gicv3_kvm.c:296:17: note: add parentheses around left hand side expression to silence this warning
>             if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
>                 ^
>
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> ---
>  hw/intc/arm_gicv3_kvm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c
> index 6051c77705..481fe5405a 100644
> --- a/hw/intc/arm_gicv3_kvm.c
> +++ b/hw/intc/arm_gicv3_kvm.c
> @@ -293,7 +293,7 @@ static void kvm_arm_gicv3_put(GICv3State *s)
>              kvm_gicr_access(s, GICR_PROPBASER + 4, ncpu, &regh, true);
>
>              reg64 = c->gicr_pendbaser;
> -            if (!c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS) {
> +            if (!(c->gicr_ctlr & GICR_CTLR_ENABLE_LPIS)) {
>                  /* Setting PTZ is advised if LPIs are disabled, to reduce
>                   * GIC initialization time.
>                   */
> --
> 2.11.0
>



-- 
Pranith

Re: [Qemu-stable] [PATCH] arm_gicv3_kvm: Fix compile warning
Posted by Peter Maydell 8 years, 2 months ago
On 31 August 2017 at 17:56, Pranith Kumar <bobby.prani@gmail.com> wrote:
> CC'ing stable for 2.10.

Thanks; applied to target-arm.next (with a tweaked commit message).

-- PMM