Skip to contentSkip to conversation

sdhci: use PRIx64 for uint64_t type

PATCH Superseded Sai Pavan Boddu 2 participants 3 messages Sep 5, 2015

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sdhci: use PRIx64 for uint64_t type

Fix compile time warnings, because of type missmatch for unsigned long long type.

---
 hw/sd/sdhci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/sd/sdhci.c +3 -2
index 2469077..bd1de7d 100644
@@ -22,6 +22,7 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <inttypes.h>
 #include "hw/hw.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"
@@ -719,7 +720,7 @@ static void sdhci_do_adma(SDHCIState *s)
             break;
         case SDHC_ADMA_ATTR_ACT_LINK:   /* link to next descriptor table */
             s->admasysaddr = dscr.addr;
-            DPRINT_L1("ADMA link: admasysaddr=0x%lx\n", s->admasysaddr);
+            DPRINT_L1("ADMA link: admasysaddr=0x%" PRIx64 "\n", s->admasysaddr);
             break;
         default:
             s->admasysaddr += dscr.incr;
@@ -727,7 +728,7 @@ static void sdhci_do_adma(SDHCIState *s)
         }
 
         if (dscr.attr & SDHC_ADMA_ATTR_INT) {
-            DPRINT_L1("ADMA interrupt: admasysaddr=0x%lx\n", s->admasysaddr);
+            DPRINT_L1("ADMA interrupt: admasysaddr=0x%" PRIx64 "\n", s->admasysaddr);
             if (s->norintstsen & SDHC_NISEN_DMA) {
                 s->norintsts |= SDHC_NIS_DMA;
             }
Signature · 1 line
1.9.1
#1 lore raw
Quoted 2 lines · Sai Pavan Boddu

Fix compile time warnings, because of type missmatch for unsigned long long type.

Commit message body should wrap to 72 chars. "mismatch".

Quoted 18 lines
---
 hw/sd/sdhci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/sd/sdhci.c +1 -0
index 2469077..bd1de7d 100644
@@ -22,6 +22,7 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <inttypes.h>
 #include "hw/hw.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"

hw/sd/sdhci.c static void sdhci_do_adma(SDHCIState *s) · line 723

Quoted 5 lines
hw/sd/sdhci.c +1 -1
@@ -719,7 +720,7 @@ static void sdhci_do_adma(SDHCIState *s)
             break;
         case SDHC_ADMA_ATTR_ACT_LINK:   /* link to next descriptor table */
             s->admasysaddr = dscr.addr;
-            DPRINT_L1("ADMA link: admasysaddr=0x%lx\n", s->admasysaddr);
+            DPRINT_L1("ADMA link: admasysaddr=0x%" PRIx64 "\n", s->admasysaddr);

This is just 80 chars. Some posts I saw last few days suggests you should return if there is only a few (or 0 in this case) chars slack. As you need to return the one below, I'd do this one too.

hw/sd/sdhci.c static void sdhci_do_adma(SDHCIState *s) · line 731

Quoted 9 lines
hw/sd/sdhci.c +1 -1
             break;
         default:
             s->admasysaddr += dscr.incr;
@@ -727,7 +728,7 @@ static void sdhci_do_adma(SDHCIState *s)
         }
 
         if (dscr.attr & SDHC_ADMA_ATTR_INT) {
-            DPRINT_L1("ADMA interrupt: admasysaddr=0x%lx\n", s->admasysaddr);
+            DPRINT_L1("ADMA interrupt: admasysaddr=0x%" PRIx64 "\n", s->admasysaddr);

80+ line.

Regards,
Peter

Quoted 6 lines
hw/sd/sdhci.c +0 -1
             if (s->norintstsen & SDHC_NISEN_DMA) {
                 s->norintsts |= SDHC_NIS_DMA;
             }
--

1.9.1

#2 lore raw
Quoted 53 lines

-----Original Message-----
From: Peter Crosthwaite [mailto:[email protected]]
Sent: Saturday, September 05, 2015 1:54 PM
To: Sai Pavan Boddu
Cc: [email protected] Developers; Peter Maydell; Alistair Francis; Edgar Iglesias; Sai Pavan Boddu
Subject: Re: [PATCH V1] sdhci: use PRIx64 for uint64_t type

Quoted 1 line · Sai Pavan Boddu

Fix compile time warnings, because of type missmatch for unsigned long

long type.

Quoted 1 line

Commit message body should wrap to 72 chars. "mismatch".

Quoted 18 lines
---
 hw/sd/sdhci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
hw/sd/sdhci.c +1 -0
index 2469077..bd1de7d 100644
@@ -22,6 +22,7 @@
  * with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <inttypes.h>
 #include "hw/hw.h"
 #include "sysemu/block-backend.h"
 #include "sysemu/blockdev.h"

hw/sd/sdhci.c static void sdhci_do_adma(SDHCIState *s) · line 724

Quoted 6 lines
hw/sd/sdhci.c +1 -1
@@ -719,7 +720,7 @@ static void sdhci_do_adma(SDHCIState *s)
             break;
         case SDHC_ADMA_ATTR_ACT_LINK:   /* link to next descriptor table */
             s->admasysaddr = dscr.addr;
-            DPRINT_L1("ADMA link: admasysaddr=0x%lx\n", s->admasysaddr);
+            DPRINT_L1("ADMA link: admasysaddr=0x%" PRIx64 "\n", s-
 admasysaddr);

This is just 80 chars. Some posts I saw last few days suggests you should return if there is only a few (or 0 in this case) chars slack. As you need to return the one below, I'd do this one too.

Quoted 6 lines
hw/sd/sdhci.c +0 -0
             break;
         default:
             s->admasysaddr += dscr.incr;
hw/sd/sdhci.c +0 -0
@@ -727,7 +728,7 @@ static void sdhci_do_adma(SDHCIState *s)
         }
 
Quoted 7 lines

hw/sd/sdhci.c static void sdhci_do_adma(SDHCIState *s) · line 733

Quoted 5 lines
hw/sd/sdhci.c +1 -1
         if (dscr.attr & SDHC_ADMA_ATTR_INT) {
-            DPRINT_L1("ADMA interrupt: admasysaddr=0x%lx\n", s-
 admasysaddr);
+            DPRINT_L1("ADMA interrupt: admasysaddr=0x%" PRIx64 "\n", s-
 admasysaddr);

80+ line.

[Sai Pavan ] Thanks, Sending out V2 for the same.

Regards,
Sai

Quoted 10 lines

Regards,
Peter

Quoted 6 lines
hw/sd/sdhci.c +0 -0
             if (s->norintstsen & SDHC_NISEN_DMA) {
                 s->norintsts |= SDHC_NIS_DMA;
             }

--
1.9.1