[POWERPC] spufs: Get rid of spufs_coredump_num_notes, it's not needed if we NULL...
authorMichael Ellerman <michael@ellerman.id.au>
Wed, 19 Sep 2007 04:38:12 +0000 (14:38 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 19 Sep 2007 05:12:18 +0000 (15:12 +1000)
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>
arch/powerpc/platforms/cell/spufs/coredump.c
arch/powerpc/platforms/cell/spufs/file.c

index 52d62193fd8390e108f9f90ccf37826827da75da..fc988fd1ffb62d7c9dabe16a1bb55e21dff7bb92 100644 (file)
@@ -72,7 +72,7 @@ static int spufs_ctx_note_size(struct spu_context *ctx, int dfd)
        char *name;
        char fullname[80];
 
-       for (i = 0; spufs_coredump_read[i].name; i++) {
+       for (i = 0; spufs_coredump_read[i].name != NULL; i++) {
                name = spufs_coredump_read[i].name;
                sz = spufs_coredump_read[i].size;
 
@@ -194,7 +194,7 @@ static void spufs_arch_write_notes(struct file *file)
        while ((ctx = coredump_next_context(&fd)) != NULL) {
                spu_acquire_saved(ctx);
 
-               for (j = 0; j < spufs_coredump_num_notes; j++)
+               for (j = 0; spufs_coredump_read[j].name != NULL; j++)
                        spufs_arch_write_note(ctx, j, file, fd);
 
                spu_release_saved(ctx);
index 85edbecf506285db593ea45559a0139a71c46b90..6095fb18dbb5bbc146e99f88fbbf653f1a0aafc1 100644 (file)
@@ -2250,7 +2250,5 @@ struct spufs_coredump_reader spufs_coredump_read[] = {
        { "proxydma_info", __spufs_proxydma_info_read,
                           NULL, sizeof(struct spu_proxydma_info)},
        { "object-id", NULL, __spufs_object_id_get, 19 },
-       { },
+       { NULL },
 };
-int spufs_coredump_num_notes = ARRAY_SIZE(spufs_coredump_read) - 1;
-