Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/dev/pci



Hi, tsutsui.

(2012/10/09 21:20), Izumi Tsutsui wrote:
>> Modified Files:
>>      src/sys/dev/pci: if_wm.c
>>
>> Log Message:
>> Use PRIxPADDR to print a DMA address. This fix a problem that if_wm.c
>> can't compile with WM_DEBUG on non-64bit platforms.
> 
> sizeof(paddr_t) != sizeof(bus_addr_t) at least on sparc,
> so using PRIx64 with an explicit (uint64_t) cast is safer,
> I think.
> (someone might claim we should add PRIxBUSADDRfoo, though)
> 
> ---
> Izumi Tsutsui
> 

 Is the following patch OK?

 And, I've noticed that cz, sk and yds have the same problem...

> (someone might claim we should add PRIxBUSADDRfoo, though)

I prefer this.



Index: if_wm.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_wm.c,v
retrieving revision 1.235
diff -u -r1.235 if_wm.c
--- if_wm.c     9 Oct 2012 10:25:44 -0000       1.235
+++ if_wm.c     9 Oct 2012 14:24:41 -0000
@@ -2693,10 +2693,10 @@
                                lasttx = nexttx;

                                DPRINTF(WM_DEBUG_TX,
-                                   ("%s: TX: desc %d: low %#" PRIxPADDR ", "
+                                   ("%s: TX: desc %d: low %#" PRIx64 ", "
                                     "len %#04zx\n",
                                    device_xname(sc->sc_dev), nexttx,
-                                   curaddr & 0xffffffffUL, curlen));
+                                   (uint64_t)curaddr, curlen));
                        }
                }

@@ -3154,9 +3154,9 @@
                        sc->sc_nq_txdescs[nexttx].nqtx_data.nqtxd_fields =
                            htole32(fields);
                        DPRINTF(WM_DEBUG_TX,
-                           ("%s: TX: adv data desc %d 0x%" PRIxPADDR "\n",
+                           ("%s: TX: adv data desc %d 0x%" PRIx64 "\n",
                            device_xname(sc->sc_dev), nexttx,
-                           dmamap->dm_segs[0].ds_addr));
+                           (uint64_t)dmamap->dm_segs[0].ds_addr));
                        DPRINTF(WM_DEBUG_TX,
                            ("\t 0x%08x%08x\n", fields,
                            (uint32_t)dmamap->dm_segs[0].ds_len | cmdlen));
@@ -3180,10 +3180,10 @@
                        lasttx = nexttx;

                        DPRINTF(WM_DEBUG_TX,
-                           ("%s: TX: desc %d: %#" PRIxPADDR ", "
+                           ("%s: TX: desc %d: %#" PRIx64 ", "
                             "len %#04zx\n",
                            device_xname(sc->sc_dev), nexttx,
-                           dmamap->dm_segs[seg].ds_addr,
+                           (uint64_t)dmamap->dm_segs[seg].ds_addr,
                            dmamap->dm_segs[seg].ds_len));
                }



-- 
-----------------------------------------------
                SAITOH Masanobu (msaitoh%execsw.org@localhost
                                 msaitoh%netbsd.org@localhost)


Home | Main Index | Thread Index | Old Index