[Cbe-oss-dev] [PATCH 6/9] Pass the ctx, not the ctx_info to spufs_arch_write_note()

Michael Ellerman michael at ellerman.id.au
Fri Aug 17 17:19:14 EST 2007


Signed-off-by: Michael Ellerman <michael at ellerman.id.au>
---
 arch/powerpc/platforms/cell/spufs/coredump.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c
index 631555b..3385515 100644
--- a/arch/powerpc/platforms/cell/spufs/coredump.c
+++ b/arch/powerpc/platforms/cell/spufs/coredump.c
@@ -156,10 +156,9 @@ static int spufs_arch_notes_size(void)
 	return size;
 }
 
-static void spufs_arch_write_note(struct spufs_ctx_info *ctx_info, int i,
+static void spufs_arch_write_note(struct spu_context *ctx, int i,
 				struct file *file, int dfd)
 {
-	struct spu_context *ctx;
 	loff_t pos = 0;
 	int sz, rc, total = 0;
 	const int bufsz = PAGE_SIZE;
@@ -174,14 +173,10 @@ static void spufs_arch_write_note(struct spufs_ctx_info *ctx_info, int i,
 	name = spufs_coredump_read[i].name;
 
 	if (!strcmp(name, "mem"))
-		sz = ctx_ls_size(ctx_info->ctx);
+		sz = ctx_ls_size(ctx);
 	else
 		sz = spufs_coredump_read[i].size;
 
-	ctx = ctx_info->ctx;
-	if (!ctx)
-		goto out;
-
 	sprintf(fullname, "SPU/%d/%s", dfd, name);
 	en.n_namesz = strlen(fullname) + 1;
 	en.n_descsz = sz;
@@ -217,7 +212,8 @@ static void spufs_arch_write_notes(struct file *file)
 	list_for_each_entry_safe(ctx_info, next, &ctx_info_list, list) {
 		spu_acquire_saved(ctx_info->ctx);
 		for (j = 0; j < spufs_coredump_num_notes; j++)
-			spufs_arch_write_note(ctx_info, j, file, ctx_info->dfd);
+			spufs_arch_write_note(ctx_info->ctx, j, file,
+					      ctx_info->dfd);
 		spu_release_saved(ctx_info->ctx);
 		list_del(&ctx_info->list);
 		kfree(ctx_info);
-- 
1.5.1.3.g7a33b




More information about the cbe-oss-dev mailing list