linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org, Arnd Bergmann <arnd.bergmann@de.ibm.com>
Subject: [RFC/PATCH 1/9] Fix sparse warning in xmon Cell code
Date: Thu, 16 Nov 2006 18:23:20 +1100	[thread overview]
Message-ID: <20061116072322.70A6D67BC6@ozlabs.org> (raw)
In-Reply-To: <1163661800.406227.631357998554.qpush@cradle>

My patch to add spu helpers to xmon (a898497088f46252e6750405504064e2dce53117)
introduced a few sparse warnings, because I was dereferencing an __iomem
pointer.

I think the best way to handle it is to actually use the appropriate in_beXX
functions. Need to rejigger the DUMP macro a little to accomodate that.

---

 arch/powerpc/xmon/xmon.c |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

Index: cell/arch/powerpc/xmon/xmon.c
===================================================================
--- cell.orig/arch/powerpc/xmon/xmon.c
+++ cell/arch/powerpc/xmon/xmon.c
@@ -2746,13 +2746,13 @@ static void restart_spus(void)
 }
 
 #define DUMP_WIDTH	23
-#define DUMP_FIELD(obj, format, field)					\
+#define DUMP_VALUE(format, field, value)				\
 do {									\
 	if (setjmp(bus_error_jmp) == 0) {				\
 		catch_memory_errors = 1;				\
 		sync();							\
 		printf("  %-*s = "format"\n", DUMP_WIDTH,		\
-				#field, obj->field);			\
+				#field, value);				\
 		sync();							\
 		__delay(200);						\
 	} else {							\
@@ -2763,6 +2763,9 @@ do {									\
 	catch_memory_errors = 0;					\
 } while (0)
 
+#define DUMP_FIELD(obj, format, field)	\
+	DUMP_VALUE(format, field, obj->field)
+
 static void dump_spu_fields(struct spu *spu)
 {
 	printf("Dumping spu fields at address %p:\n", spu);
@@ -2791,13 +2794,18 @@ static void dump_spu_fields(struct spu *
 	DUMP_FIELD(spu, "0x%p", timestamp);
 	DUMP_FIELD(spu, "0x%lx", problem_phys);
 	DUMP_FIELD(spu, "0x%p", problem);
-	DUMP_FIELD(spu, "0x%x", problem->spu_runcntl_RW);
-	DUMP_FIELD(spu, "0x%x", problem->spu_status_R);
-	DUMP_FIELD(spu, "0x%x", problem->spu_npc_RW);
+	DUMP_VALUE("0x%x", problem->spu_runcntl_RW,
+			in_be32(&spu->problem->spu_runcntl_RW));
+	DUMP_VALUE("0x%x", problem->spu_status_R,
+			in_be32(&spu->problem->spu_status_R));
+	DUMP_VALUE("0x%x", problem->spu_npc_RW,
+			in_be32(&spu->problem->spu_npc_RW));
 	DUMP_FIELD(spu, "0x%p", priv1);
 
-	if (spu->priv1)
-		DUMP_FIELD(spu, "0x%lx", priv1->mfc_sr1_RW);
+	if (spu->priv1) {
+		DUMP_VALUE("0x%lx", priv1->mfc_sr1_RW,
+				in_be64(&spu->priv1->mfc_sr1_RW));
+	}
 
 	DUMP_FIELD(spu, "0x%p", priv2);
 }

  reply	other threads:[~2006-11-16  7:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-16  7:23 [RFC/PATCH 0/9] More xmon cell patches Michael Ellerman
2006-11-16  7:23 ` Michael Ellerman [this message]
2006-11-16  7:23 ` [RFC/PATCH 2/9] Show state of spus as they're stopped in Cell xmon helper Michael Ellerman
2006-11-16  7:23 ` [RFC/PATCH 3/9] Add a 'sd' command (spu dump) to xmon to dump spu local store Michael Ellerman
2006-11-16  7:23 ` [RFC/PATCH 4/9] Prepare for spu disassembly in xmon Michael Ellerman
2006-11-16  7:23 ` [RFC/PATCH 5/9] Import spu disassembly code into xmon Michael Ellerman
2006-11-16  7:23 ` [RFC/PATCH 7/9] Make xmon disassembly optional Michael Ellerman
2006-11-16  7:23 ` [RFC/PATCH 6/9] Add spu disassembly to xmon Michael Ellerman
2006-11-16  7:23 ` [RFC/PATCH 8/9] Make 64-bit cpu features defined on 32-bit Michael Ellerman
2006-11-16 10:17   ` Stephen Rothwell
2006-11-16 23:03     ` Michael Ellerman
2006-11-16  7:23 ` [RFC/PATCH 9/9] Import updated version of ppc disassembly code for xmon Michael Ellerman
2006-11-16 21:20 ` [RFC/PATCH 0/9] More xmon cell patches Arnd Bergmann
2006-11-20 22:06   ` Paul Mackerras
2006-11-21 10:24 ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061116072322.70A6D67BC6@ozlabs.org \
    --to=michael@ellerman.id.au \
    --cc=arnd.bergmann@de.ibm.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).