aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-09-19 00:38:12 -0400
committerPaul Mackerras <paulus@samba.org>2007-09-19 01:12:18 -0400
commit936d5bf1d7dc69c56bf79ad68819e597307a1884 (patch)
tree44ddc4a6785cb1f5a9c7387ff8d97c6881517de0 /arch
parentc1a72173ab156306666cb531f891f32e4e21d592 (diff)
[POWERPC] spufs: Get rid of spufs_coredump_num_notes, it's not needed if we NULL terminate
The spufs_coredump_read array is NULL terminated, and we also store the size. We only need one or the other, and the other arrays in file.c are NULL terminated, so do that. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/cell/spufs/coredump.c4
-rw-r--r--arch/powerpc/platforms/cell/spufs/file.c4
2 files changed, 3 insertions, 5 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index 52d62193fd83..fc988fd1ffb6 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -72,7 +72,7 @@ static int spufs_ctx_note_size(struct spu_context *ctx, int dfd)
72 char *name; 72 char *name;
73 char fullname[80]; 73 char fullname[80];
74 74
75 for (i = 0; spufs_coredump_read[i].name; i++) { 75 for (i = 0; spufs_coredump_read[i].name != NULL; i++) {
76 name = spufs_coredump_read[i].name; 76 name = spufs_coredump_read[i].name;
77 sz = spufs_coredump_read[i].size; 77 sz = spufs_coredump_read[i].size;
78 78
@@ -194,7 +194,7 @@ static void spufs_arch_write_notes(struct file *file)
194 while ((ctx = coredump_next_context(&fd)) != NULL) { 194 while ((ctx = coredump_next_context(&fd)) != NULL) {
195 spu_acquire_saved(ctx); 195 spu_acquire_saved(ctx);
196 196
197 for (j = 0; j < spufs_coredump_num_notes; j++) 197 for (j = 0; spufs_coredump_read[j].name != NULL; j++)
198 spufs_arch_write_note(ctx, j, file, fd); 198 spufs_arch_write_note(ctx, j, file, fd);
199 199
200 spu_release_saved(ctx); 200 spu_release_saved(ctx);
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c
index 85edbecf5062..6095fb18dbb5 100644
--- a/arch/powerpc/platforms/cell/spufs/file.c
+++ b/arch/powerpc/platforms/cell/spufs/file.c
@@ -2250,7 +2250,5 @@ struct spufs_coredump_reader spufs_coredump_read[] = {
2250 { "proxydma_info", __spufs_proxydma_info_read, 2250 { "proxydma_info", __spufs_proxydma_info_read,
2251 NULL, sizeof(struct spu_proxydma_info)}, 2251 NULL, sizeof(struct spu_proxydma_info)},
2252 { "object-id", NULL, __spufs_object_id_get, 19 }, 2252 { "object-id", NULL, __spufs_object_id_get, 19 },
2253 { }, 2253 { NULL },
2254}; 2254};
2255int spufs_coredump_num_notes = ARRAY_SIZE(spufs_coredump_read) - 1;
2256