public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] ArmPkg/ArmGicLib: use correct loop variable
@ 2016-09-07  7:04 Ard Biesheuvel
  2016-09-08  9:39 ` Ard Biesheuvel
  2016-09-09 15:45 ` Leif Lindholm
  0 siblings, 2 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2016-09-07  7:04 UTC (permalink / raw)
  To: edk2-devel, leif.lindholm; +Cc: vishalo, Ard Biesheuvel

The ArmGicLib API function GicGetCpuRedistributorBase () declares
GicCpuRedistributorBase to iterate over the redistributors of all
CPUs, but then inadvertently advances GicRedistributorBase instead.

Reported-by: "Oliyil Kunnil, Vishal" <vishalo@qti.qualcomm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 ArmPkg/Drivers/ArmGic/ArmGicLib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
index 73795ed4e56c..e658e9bff5d8 100644
--- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c
+++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
@@ -76,7 +76,7 @@ GicGetCpuRedistributorBase (
     }
 
     // Move to the next GIC Redistributor frame
-    GicRedistributorBase += GicRedistributorGranularity;
+    GicCpuRedistributorBase += GicRedistributorGranularity;
   }
 
   // The Redistributor has not been found for the current CPU
-- 
2.7.4



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

* Re: [PATCH] ArmPkg/ArmGicLib: use correct loop variable
  2016-09-07  7:04 [PATCH] ArmPkg/ArmGicLib: use correct loop variable Ard Biesheuvel
@ 2016-09-08  9:39 ` Ard Biesheuvel
  2016-09-09 15:45 ` Leif Lindholm
  1 sibling, 0 replies; 3+ messages in thread
From: Ard Biesheuvel @ 2016-09-08  9:39 UTC (permalink / raw)
  To: edk2-devel-01, Leif Lindholm; +Cc: Oliyil Kunnil, Vishal, Ard Biesheuvel

On 7 September 2016 at 08:04, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> The ArmGicLib API function GicGetCpuRedistributorBase () declares
> GicCpuRedistributorBase to iterate over the redistributors of all
> CPUs, but then inadvertently advances GicRedistributorBase instead.
>
> Reported-by: "Oliyil Kunnil, Vishal" <vishalo@qti.qualcomm.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
>  ArmPkg/Drivers/ArmGic/ArmGicLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> index 73795ed4e56c..e658e9bff5d8 100644
> --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> @@ -76,7 +76,7 @@ GicGetCpuRedistributorBase (
>      }
>
>      // Move to the next GIC Redistributor frame
> -    GicRedistributorBase += GicRedistributorGranularity;
> +    GicCpuRedistributorBase += GicRedistributorGranularity;
>    }
>
>    // The Redistributor has not been found for the current CPU
> --
> 2.7.4
>

Leif?


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

* Re: [PATCH] ArmPkg/ArmGicLib: use correct loop variable
  2016-09-07  7:04 [PATCH] ArmPkg/ArmGicLib: use correct loop variable Ard Biesheuvel
  2016-09-08  9:39 ` Ard Biesheuvel
@ 2016-09-09 15:45 ` Leif Lindholm
  1 sibling, 0 replies; 3+ messages in thread
From: Leif Lindholm @ 2016-09-09 15:45 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: edk2-devel, vishalo

On Wed, Sep 07, 2016 at 08:04:50AM +0100, Ard Biesheuvel wrote:
> The ArmGicLib API function GicGetCpuRedistributorBase () declares
> GicCpuRedistributorBase to iterate over the redistributors of all
> CPUs, but then inadvertently advances GicRedistributorBase instead.
> 
> Reported-by: "Oliyil Kunnil, Vishal" <vishalo@qti.qualcomm.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Right, so I was contemplating a minor rewrite of the gic driver to
make this sort of thing less likely in the future ... but quickly
realised it wouldn't be a minor one. So:

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  ArmPkg/Drivers/ArmGic/ArmGicLib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> index 73795ed4e56c..e658e9bff5d8 100644
> --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c
> @@ -76,7 +76,7 @@ GicGetCpuRedistributorBase (
>      }
>  
>      // Move to the next GIC Redistributor frame
> -    GicRedistributorBase += GicRedistributorGranularity;
> +    GicCpuRedistributorBase += GicRedistributorGranularity;
>    }
>  
>    // The Redistributor has not been found for the current CPU
> -- 
> 2.7.4
> 


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

end of thread, other threads:[~2016-09-09 15:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-07  7:04 [PATCH] ArmPkg/ArmGicLib: use correct loop variable Ard Biesheuvel
2016-09-08  9:39 ` Ard Biesheuvel
2016-09-09 15:45 ` Leif Lindholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox