diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-03-11 13:54:33 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-03-11 13:54:59 -0400 |
commit | 4ea67e9b853e9ed61557780b87bd184fc81fd731 (patch) | |
tree | 36c32aee859a028272b7904711784042930b8cc7 /src | |
parent | 9fd13e6773371c82b9799a5bda7c96ffa5cafe8c (diff) |
Crack down on warnings.
Fix printf formatting warnings, wrap a couple of long lines, nuke
unused variables, add missing #include <unistd.h>.
Diffstat (limited to 'src')
-rw-r--r-- | src/bios_reader/bios_dumper.c | 1 | ||||
-rw-r--r-- | src/i830.h | 7 | ||||
-rw-r--r-- | src/i830_debug.c | 28 | ||||
-rw-r--r-- | src/i830_lvds.c | 2 | ||||
-rw-r--r-- | src/i830_video.c | 11 |
5 files changed, 31 insertions, 18 deletions
diff --git a/src/bios_reader/bios_dumper.c b/src/bios_reader/bios_dumper.c index 6f163d56..e2f3064e 100644 --- a/src/bios_reader/bios_dumper.c +++ b/src/bios_reader/bios_dumper.c @@ -31,6 +31,7 @@ #include <stdarg.h> #include <sys/stat.h> #include <fcntl.h> +#include <unistd.h> #include <errno.h> #include <pciaccess.h> #include <err.h> @@ -843,4 +843,11 @@ extern const int I830CopyROP[16]; #define QUIRK_IVCH_NEED_DVOB 0x00000010 extern void i830_fixup_devices(ScrnInfoPtr); +/* Mirrors CARD32 definition in Xmd.h */ +#ifdef LONG64 +#define CARD32_HEX "x" +#else +#define CARD32_HEX "lx" +#endif + #endif /* _I830_H_ */ diff --git a/src/i830_debug.c b/src/i830_debug.c index f589de73..2e8c8514 100644 --- a/src/i830_debug.c +++ b/src/i830_debug.c @@ -957,13 +957,14 @@ i830_dump_error_state(ScrnInfoPtr pScrn) { I830Ptr pI830 = I830PTR(pScrn); - ErrorF("pgetbl_ctl: 0x%" PRIx32 "getbl_err: 0x%" PRIx32 "\n", + ErrorF("pgetbl_ctl: 0x%" CARD32_HEX "getbl_err: 0x%" CARD32_HEX "\n", INREG(PGETBL_CTL), INREG(PGE_ERR)); - ErrorF("ipeir: %" PRIx32 " iphdr: %" PRIx32 "\n", INREG(IPEIR), + ErrorF("ipeir: %" CARD32_HEX " iphdr: %" CARD32_HEX "\n", INREG(IPEIR), INREG(IPEHR)); - ErrorF("LP ring tail: %" PRIx32 " head: %" PRIx32 " len: %" PRIx32 " start %" PRIx32 "\n", + ErrorF("LP ring tail: %" CARD32_HEX " head: %" CARD32_HEX + " len: %" CARD32_HEX " start %" CARD32_HEX "\n", INREG(LP_RING + RING_TAIL), INREG(LP_RING + RING_HEAD) & HEAD_ADDR, INREG(LP_RING + RING_LEN), @@ -974,8 +975,8 @@ i830_dump_error_state(ScrnInfoPtr pScrn) ErrorF("instdone: %x instpm: %x\n", INREG16(INST_DONE), INREG8(INST_PM)); - ErrorF("memmode: %" PRIx32 " instps: %" PRIx32 "\n", INREG(MEMMODE), - INREG(INST_PS)); + ErrorF("memmode: %" CARD32_HEX " instps: %" CARD32_HEX "\n", + INREG(MEMMODE), INREG(INST_PS)); ErrorF("hwstam: %x ier: %x imr: %x iir: %x\n", INREG16(HWSTAM), INREG16(IER), INREG16(IMR), INREG16(IIR)); @@ -987,12 +988,14 @@ i965_dump_error_state(ScrnInfoPtr pScrn) { I830Ptr pI830 = I830PTR(pScrn); - ErrorF("pgetbl_ctl: 0x%" PRIx32 " pgetbl_err: 0x%" PRIx32 "\n", + ErrorF("pgetbl_ctl: 0x%" CARD32_HEX " pgetbl_err: 0x%" CARD32_HEX "\n", INREG(PGETBL_CTL), INREG(PGE_ERR)); - ErrorF("ipeir: %" PRIx32 " iphdr: %" PRIx32 "\n", INREG(IPEIR_I965), INREG(IPEHR_I965)); + ErrorF("ipeir: %" CARD32_HEX " iphdr: %" CARD32_HEX "\n", + INREG(IPEIR_I965), INREG(IPEHR_I965)); - ErrorF("LP ring tail: %" PRIx32 " head: %" PRIx32 " len: %" PRIx32 " start %" PRIx32 "\n", + ErrorF("LP ring tail: %" CARD32_HEX " head: %" CARD32_HEX + " len: %" CARD32_HEX " start %" CARD32_HEX "\n", INREG(LP_RING + RING_TAIL), INREG(LP_RING + RING_HEAD) & HEAD_ADDR, INREG(LP_RING + RING_LEN), INREG(LP_RING + RING_START)); @@ -1004,15 +1007,18 @@ i965_dump_error_state(ScrnInfoPtr pScrn) (int)INREG(INST_DONE_1)); ErrorF("instpm: %x\n", (int)INREG(INST_PM)); - ErrorF("memmode: %" PRIx32 " instps: %" PRIx32 "\n", INREG(MEMMODE), INREG(INST_PS_I965)); + ErrorF("memmode: %" CARD32_HEX " instps: %" CARD32_HEX "\n", + INREG(MEMMODE), INREG(INST_PS_I965)); ErrorF("HW Status mask (hwstam): %x\nIRQ enable (ier): %x " "imr: %x iir: %x\n", (int)INREG(HWSTAM), (int)INREG(IER), (int)INREG(IMR), (int)INREG(IIR)); - ErrorF("acthd: %" PRIx32 " dma_fadd_p: %" PRIx32 "\n", INREG(ACTHD), INREG(DMA_FADD_P)); - ErrorF("ecoskpd: %" PRIx32 " excc: %" PRIx32 "\n", INREG(ECOSKPD), INREG(EXCC)); + ErrorF("acthd: %" CARD32_HEX " dma_fadd_p: %" CARD32_HEX "\n", + INREG(ACTHD), INREG(DMA_FADD_P)); + ErrorF("ecoskpd: %" CARD32_HEX " excc: %" CARD32_HEX "\n", + INREG(ECOSKPD), INREG(EXCC)); ErrorF("cache_mode: %x/%x\n", (int)INREG(CACHE_MODE_0), (int)INREG(CACHE_MODE_1)); diff --git a/src/i830_lvds.c b/src/i830_lvds.c index 8359e39f..eefb08b1 100644 --- a/src/i830_lvds.c +++ b/src/i830_lvds.c @@ -855,8 +855,6 @@ i830_lvds_set_property(xf86OutputPtr output, Atom property, static Bool i830_lvds_get_property(xf86OutputPtr output, Atom property) { - ScrnInfoPtr pScrn = output->scrn; - I830Ptr pI830 = I830PTR(pScrn); I830OutputPrivatePtr intel_output = output->driver_private; struct i830_lvds_priv *dev_priv = intel_output->dev_priv; int ret; diff --git a/src/i830_video.c b/src/i830_video.c index bf260e46..aa10cac6 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -463,8 +463,8 @@ i830_overlay_continue(ScrnInfoPtr pScrn, Bool update_filter) flip_addr = pI830->overlay_regs->bus_addr; if (update_filter) flip_addr |= OFC_UPDATE; - OVERLAY_DEBUG ("overlay_continue cmd 0x%08" PRIx32 " -> 0x%08" PRIx32 - " sta 0x%08" PRIx32 "\n", + OVERLAY_DEBUG ("overlay_continue cmd 0x%08" CARD32_HEX + " -> 0x%08" CARD32_HEX " sta 0x%08" CARD32_HEX "\n", overlay->OCMD, INREG(OCMD_REGISTER), INREG(DOVSTA)); BEGIN_LP_RING(4); OUT_RING(MI_FLUSH | MI_WRITE_DIRTY_STATE); @@ -504,7 +504,8 @@ i830_overlay_off(ScrnInfoPtr pScrn) */ { overlay->OCMD &= ~OVERLAY_ENABLE; - OVERLAY_DEBUG ("overlay_off cmd 0x%08" PRIx32 " -> 0x%08" PRIx32 " sta 0x%08" PRIx32 "\n", + OVERLAY_DEBUG ("overlay_off cmd 0x%08" CARD32_HEX + " -> 0x%08" CARD32_HEX " sta 0x%08" CARD32_HEX "\n", overlay->OCMD, INREG(OCMD_REGISTER), INREG(DOVSTA)); BEGIN_LP_RING(6); OUT_RING(MI_FLUSH | MI_WRITE_DIRTY_STATE); @@ -1913,7 +1914,7 @@ i830_display_video(ScrnInfoPtr pScrn, xf86CrtcPtr crtc, overlay->OBUF_1V = pPriv->VBuf1offset; } - OVERLAY_DEBUG("pos: 0x%" PRIx32 ", size: 0x%" PRIx32 "\n", + OVERLAY_DEBUG("pos: 0x%" CARD32_HEX ", size: 0x%" CARD32_HEX "\n", overlay->DWINPOS, overlay->DWINSZ); OVERLAY_DEBUG("dst: %d x %d, src: %d x %d\n", drw_w, drw_h, src_w, src_h); @@ -2075,7 +2076,7 @@ i830_display_video(ScrnInfoPtr pScrn, xf86CrtcPtr crtc, OCMD |= BUFFER1; overlay->OCMD = OCMD; - OVERLAY_DEBUG("OCMD is 0x%" PRIx32 "\n", OCMD); + OVERLAY_DEBUG("OCMD is 0x%" CARD32_HEX "\n", OCMD); /* make sure the overlay is on */ i830_overlay_on (pScrn); |