qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH 01/10] pflash_cfi02: fix incorrect TARGET_FMT_lx/d use
Date: Fri, 26 Mar 2010 21:02:39 +0200	[thread overview]
Message-ID: <f43fc5581003261202w512cefeckeb1193b0e9b8472@mail.gmail.com> (raw)

Also use target_phys_addr_t for addresses.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
---
 hw/pflash_cfi02.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/hw/pflash_cfi02.c b/hw/pflash_cfi02.c
index 135c850..50b4c6c 100644
--- a/hw/pflash_cfi02.c
+++ b/hw/pflash_cfi02.c
@@ -103,13 +103,13 @@ static void pflash_timer (void *opaque)
     pfl->cmd = 0;
 }

-static uint32_t pflash_read (pflash_t *pfl, uint32_t offset, int width)
+static uint32_t pflash_read (pflash_t *pfl, target_phys_addr_t
offset, int width)
 {
-    uint32_t boff;
+    target_phys_addr_t boff;
     uint32_t ret;
     uint8_t *p;

-    DPRINTF("%s: offset " TARGET_FMT_lx "\n", __func__, offset);
+    DPRINTF("%s: offset " TARGET_FMT_plx "\n", __func__, offset);
     ret = -1;
     if (pfl->rom_mode) {
         /* Lazy reset of to ROMD mode */
@@ -184,7 +184,7 @@ static uint32_t pflash_read (pflash_t *pfl,
uint32_t offset, int width)
         default:
             goto flash_read;
         }
-        DPRINTF("%s: ID " TARGET_FMT_ld " %x\n", __func__, boff, ret);
+        DPRINTF("%s: ID " TARGET_FMT_pld " %x\n", __func__, boff, ret);
         break;
     case 0xA0:
     case 0x10:
@@ -222,10 +222,10 @@ static void pflash_update(pflash_t *pfl, int offset,
     }
 }

-static void pflash_write (pflash_t *pfl, uint32_t offset, uint32_t value,
-                          int width)
+static void pflash_write (pflash_t *pfl, target_phys_addr_t offset,
+                          uint32_t value, int width)
 {
-    uint32_t boff;
+    target_phys_addr_t boff;
     uint8_t *p;
     uint8_t cmd;

@@ -237,11 +237,11 @@ static void pflash_write (pflash_t *pfl,
uint32_t offset, uint32_t value,
 #endif
         goto reset_flash;
     }
-    DPRINTF("%s: offset " TARGET_FMT_lx " %08x %d %d\n", __func__,
+    DPRINTF("%s: offset " TARGET_FMT_plx " %08x %d %d\n", __func__,
             offset, value, width, pfl->wcycle);
     offset &= pfl->chip_len - 1;

-    DPRINTF("%s: offset " TARGET_FMT_lx " %08x %d\n", __func__,
+    DPRINTF("%s: offset " TARGET_FMT_plx " %08x %d\n", __func__,
             offset, value, width);
     boff = offset & (pfl->sector_len - 1);
     if (pfl->width == 2)
@@ -263,7 +263,7 @@ static void pflash_write (pflash_t *pfl, uint32_t
offset, uint32_t value,
             return;
         }
         if (boff != pfl->unlock_addr[0] || cmd != 0xAA) {
-            DPRINTF("%s: unlock0 failed " TARGET_FMT_lx " %02x %04x\n",
+            DPRINTF("%s: unlock0 failed " TARGET_FMT_plx " %02x %04x\n",
                     __func__, boff, cmd, pfl->unlock_addr[0]);
             goto reset_flash;
         }
@@ -273,7 +273,7 @@ static void pflash_write (pflash_t *pfl, uint32_t
offset, uint32_t value,
         /* We started an unlock sequence */
     check_unlock1:
         if (boff != pfl->unlock_addr[1] || cmd != 0x55) {
-            DPRINTF("%s: unlock1 failed " TARGET_FMT_lx " %02x\n", __func__,
+            DPRINTF("%s: unlock1 failed " TARGET_FMT_plx " %02x\n", __func__,
                     boff, cmd);
             goto reset_flash;
         }
@@ -282,7 +282,7 @@ static void pflash_write (pflash_t *pfl, uint32_t
offset, uint32_t value,
     case 2:
         /* We finished an unlock sequence */
         if (!pfl->bypass && boff != pfl->unlock_addr[0]) {
-            DPRINTF("%s: command failed " TARGET_FMT_lx " %02x\n", __func__,
+            DPRINTF("%s: command failed " TARGET_FMT_plx " %02x\n", __func__,
                     boff, cmd);
             goto reset_flash;
         }
@@ -307,7 +307,7 @@ static void pflash_write (pflash_t *pfl, uint32_t
offset, uint32_t value,
             /* We need another unlock sequence */
             goto check_unlock0;
         case 0xA0:
-            DPRINTF("%s: write data offset " TARGET_FMT_lx " %08x %d\n",
+            DPRINTF("%s: write data offset " TARGET_FMT_plx " %08x %d\n",
                     __func__, offset, value, width);
             p = pfl->storage;
             switch (width) {
@@ -378,7 +378,7 @@ static void pflash_write (pflash_t *pfl, uint32_t
offset, uint32_t value,
         switch (cmd) {
         case 0x10:
             if (boff != pfl->unlock_addr[0]) {
-                DPRINTF("%s: chip erase: invalid address " TARGET_FMT_lx "\n",
+                DPRINTF("%s: chip erase: invalid address " TARGET_FMT_plx "\n",
                         __func__, offset);
                 goto reset_flash;
             }
@@ -395,7 +395,7 @@ static void pflash_write (pflash_t *pfl, uint32_t
offset, uint32_t value,
             /* Sector erase */
             p = pfl->storage;
             offset &= ~(pfl->sector_len - 1);
-            DPRINTF("%s: start sector erase at " TARGET_FMT_lx "\n", __func__,
+            DPRINTF("%s: start sector erase at " TARGET_FMT_plx "\n", __func__,
                     offset);
             memset(p + offset, 0xFF, pfl->sector_len);
             pflash_update(pfl, offset, pfl->sector_len);
-- 
1.6.2.4

                 reply	other threads:[~2010-03-26 19:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=f43fc5581003261202w512cefeckeb1193b0e9b8472@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.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).