[Cbe-oss-dev] [PATCH 1/9] spufs: fix array size of channel index

Masakazu Mokuno mokuno at sm.sony.co.jp
Fri Jul 13 21:14:51 EST 2007


	Hi
	
On Fri, 13 Jul 2007 16:35:04 +0900
Masato Noguchi <Masato.Noguchi at jp.sony.com> wrote:

> 
> fixed array size of channel index in {save,restore,clear}_ch_part1().
> 
> Signed-off-by: Masato Noguchi <Masato.Noguchi at jp.sony.com>
> ---
> 
>  arch/powerpc/platforms/cell/spufs/switch.c |   12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> Index: linux-2.6/arch/powerpc/platforms/cell/spufs/switch.c
> ===================================================================
> --- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/switch.c
> +++ linux-2.6/arch/powerpc/platforms/cell/spufs/switch.c
> @@ -603,7 +603,7 @@ static inline void save_ppuint_mb(struct
>  static inline void save_ch_part1(struct spu_state *csa, struct spu *spu)
>  {
>  	struct spu_priv2 __iomem *priv2 = spu->priv2;
> -	u64 idx, ch_indices[7] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL };
> +	u64 idx, ch_indices[6] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL };

Is there any reason specifying explicit array size?  To emphasise the
number of the related registers?

>  	int i;
>  
>  	/* Save, Step 42:
> @@ -614,7 +614,7 @@ static inline void save_ch_part1(struct 
>  	csa->spu_chnldata_RW[1] = in_be64(&priv2->spu_chnldata_RW);
>  
>  	/* Save the following CH: [0,3,4,24,25,27] */
> -	for (i = 0; i < 7; i++) {
> +	for (i = 0; i < 6; i++) {

How about ARRAY_SIZE() here?

--
Masakazu MOKUNO




More information about the cbe-oss-dev mailing list