From c95af1da49841d721d81d9d24293f07c041ef43c Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Tue, 27 Jan 2009 00:29:45 +0000 Subject: While printing is turned off by default, the debug code was still compiled into drm. I'd forgotten about that. if DRMDEBUG is defined, build in the printfs, else no-op them. Shaves a bunch of string from the kernel Fix two cases in mach64_irq.c where this would lead to unused variable warnings. Reminded by an entirely different comment by djm@. --- sys/dev/pci/drm/drmP.h | 4 ++++ sys/dev/pci/drm/mach64_irq.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'sys') diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h index d36eed410f3..46ea5008043 100644 --- a/sys/dev/pci/drm/drmP.h +++ b/sys/dev/pci/drm/drmP.h @@ -248,12 +248,16 @@ DRM_SPINUNLOCK(&dev->irq_lock) #define DRM_INFO(fmt, arg...) printf("%s: " fmt, dev_priv->dev.dv_xname, ## arg) +#ifdef DRMDEBUG #undef DRM_DEBUG #define DRM_DEBUG(fmt, arg...) do { \ if (drm_debug_flag) \ printf("[" DRM_NAME ":pid%d:%s] " fmt, DRM_CURRENTPID, \ __func__ , ## arg); \ } while (0) +#else +#define DRM_DEBUG(fmt, arg...) do { } while(/* CONSTCOND */ 0) +#endif typedef struct drm_pci_id_list { diff --git a/sys/dev/pci/drm/mach64_irq.c b/sys/dev/pci/drm/mach64_irq.c index 9713f38cafe..b8d279d75d5 100644 --- a/sys/dev/pci/drm/mach64_irq.c +++ b/sys/dev/pci/drm/mach64_irq.c @@ -81,7 +81,6 @@ u32 mach64_get_vblank_counter(struct drm_device * dev, int crtc) int mach64_enable_vblank(struct drm_device * dev, int crtc) { drm_mach64_private_t *dev_priv = dev->dev_private; - u32 status = MACH64_READ(MACH64_CRTC_INT_CNTL); if (crtc != 0) { DRM_ERROR("tried to enable vblank on non-existent crtc %d\n", @@ -89,7 +88,8 @@ int mach64_enable_vblank(struct drm_device * dev, int crtc) return EINVAL; } - DRM_DEBUG("before enable vblank CRTC_INT_CTNL: 0x%08x\n", status); + DRM_DEBUG("before enable vblank CRTC_INT_CTNL: 0x%08x\n", + MACH64_READ(MACH64_CRTC_INT_CNTL)); /* Turn on VBLANK interrupt */ MACH64_WRITE(MACH64_CRTC_INT_CNTL, MACH64_READ(MACH64_CRTC_INT_CNTL) @@ -135,9 +135,9 @@ mach64_driver_irq_install(struct drm_device * dev) { drm_mach64_private_t *dev_priv = dev->dev_private; - u32 status = MACH64_READ(MACH64_CRTC_INT_CNTL); - DRM_DEBUG("before install CRTC_INT_CTNL: 0x%08x\n", status); + DRM_DEBUG("before install CRTC_INT_CTNL: 0x%08x\n", + MACH64_READ(MACH64_CRTC_INT_CNTL)); mach64_disable_vblank_local(dev, 0); -- cgit v1.2.3