aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2007-07-20 15:39:35 -0400
committerArnd Bergmann <arnd@klappe.arndb.de>2007-07-20 15:41:53 -0400
commitdaced0f718b92b0bcdb9790622c255d4660f51ce (patch)
tree49c32f0eb96df42c3867879d2723a45d44f9e42f /arch
parent27b1ea091f0c088ecad0d492f37fbe7b8d54d7dc (diff)
[CELL] spufs: fix array size of channel index
Based on a fix from Masato Noguchi <Masato.Noguchi@jp.sony.com>. Remove the (incorrect) array size declarations in the spufs channel arrays, and use ARRAY_SIZE rather than hardcoded values. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/cell/spufs/switch.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c
index 827aada391f2..861336e99448 100644
--- a/arch/powerpc/platforms/cell/spufs/switch.c
+++ b/arch/powerpc/platforms/cell/spufs/switch.c
@@ -616,7 +616,7 @@ static inline void save_ppuint_mb(struct spu_state *csa, struct spu *spu)
616static inline void save_ch_part1(struct spu_state *csa, struct spu *spu) 616static inline void save_ch_part1(struct spu_state *csa, struct spu *spu)
617{ 617{
618 struct spu_priv2 __iomem *priv2 = spu->priv2; 618 struct spu_priv2 __iomem *priv2 = spu->priv2;
619 u64 idx, ch_indices[7] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL }; 619 u64 idx, ch_indices[] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL };
620 int i; 620 int i;
621 621
622 /* Save, Step 42: 622 /* Save, Step 42:
@@ -627,7 +627,7 @@ static inline void save_ch_part1(struct spu_state *csa, struct spu *spu)
627 csa->spu_chnldata_RW[1] = in_be64(&priv2->spu_chnldata_RW); 627 csa->spu_chnldata_RW[1] = in_be64(&priv2->spu_chnldata_RW);
628 628
629 /* Save the following CH: [0,3,4,24,25,27] */ 629 /* Save the following CH: [0,3,4,24,25,27] */
630 for (i = 0; i < 7; i++) { 630 for (i = 0; i < ARRAY_SIZE(ch_indices); i++) {
631 idx = ch_indices[i]; 631 idx = ch_indices[i];
632 out_be64(&priv2->spu_chnlcntptr_RW, idx); 632 out_be64(&priv2->spu_chnlcntptr_RW, idx);
633 eieio(); 633 eieio();
@@ -1091,7 +1091,7 @@ static inline void clear_spu_status(struct spu_state *csa, struct spu *spu)
1091static inline void reset_ch_part1(struct spu_state *csa, struct spu *spu) 1091static inline void reset_ch_part1(struct spu_state *csa, struct spu *spu)
1092{ 1092{
1093 struct spu_priv2 __iomem *priv2 = spu->priv2; 1093 struct spu_priv2 __iomem *priv2 = spu->priv2;
1094 u64 ch_indices[7] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL }; 1094 u64 ch_indices[] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL };
1095 u64 idx; 1095 u64 idx;
1096 int i; 1096 int i;
1097 1097
@@ -1103,7 +1103,7 @@ static inline void reset_ch_part1(struct spu_state *csa, struct spu *spu)
1103 out_be64(&priv2->spu_chnldata_RW, 0UL); 1103 out_be64(&priv2->spu_chnldata_RW, 0UL);
1104 1104
1105 /* Reset the following CH: [0,3,4,24,25,27] */ 1105 /* Reset the following CH: [0,3,4,24,25,27] */
1106 for (i = 0; i < 7; i++) { 1106 for (i = 0; i < ARRAY_SIZE(ch_indices); i++) {
1107 idx = ch_indices[i]; 1107 idx = ch_indices[i];
1108 out_be64(&priv2->spu_chnlcntptr_RW, idx); 1108 out_be64(&priv2->spu_chnlcntptr_RW, idx);
1109 eieio(); 1109 eieio();
@@ -1563,7 +1563,7 @@ static inline void restore_decr_wrapped(struct spu_state *csa, struct spu *spu)
1563static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu) 1563static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu)
1564{ 1564{
1565 struct spu_priv2 __iomem *priv2 = spu->priv2; 1565 struct spu_priv2 __iomem *priv2 = spu->priv2;
1566 u64 idx, ch_indices[7] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL }; 1566 u64 idx, ch_indices[] = { 0UL, 3UL, 4UL, 24UL, 25UL, 27UL };
1567 int i; 1567 int i;
1568 1568
1569 /* Restore, Step 59: 1569 /* Restore, Step 59:
@@ -1574,7 +1574,7 @@ static inline void restore_ch_part1(struct spu_state *csa, struct spu *spu)
1574 out_be64(&priv2->spu_chnldata_RW, csa->spu_chnldata_RW[1]); 1574 out_be64(&priv2->spu_chnldata_RW, csa->spu_chnldata_RW[1]);
1575 1575
1576 /* Restore the following CH: [0,3,4,24,25,27] */ 1576 /* Restore the following CH: [0,3,4,24,25,27] */
1577 for (i = 0; i < 7; i++) { 1577 for (i = 0; i < ARRAY_SIZE(ch_indices); i++) {
1578 idx = ch_indices[i]; 1578 idx = ch_indices[i];
1579 out_be64(&priv2->spu_chnlcntptr_RW, idx); 1579 out_be64(&priv2->spu_chnlcntptr_RW, idx);
1580 eieio(); 1580 eieio();