The change seems unnecessary since we only compute the address of the
element before the bounds check, we don't actually access the
element. I believe that is legal in C.
If you have an array a[N], taking &a[0] .. &a[N] are legal C, everything
else is not.
Segher
On Mon, Aug 03, 2009 at 10:57:17PM +1000, Paul Mackerras wrote:
> Roel Kluin writes:
>
> > Check whether index is within bounds before grabbing the element.
>
> The change seems unnecessary since we only compute the address of the
> element before the bounds check, we don't actually access the
>
Roel Kluin writes:
> Check whether index is within bounds before grabbing the element.
The change seems unnecessary since we only compute the address of the
element before the bounds check, we don't actually access the
element. I believe that is legal in C.
Paul.
___
Check whether index is within bounds before grabbing the element.
Signed-off-by: Roel Kluin
---
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index a0f6838..588a5b0 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -294,10 +294,11 @