diff options
author | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-01-27 00:29:45 +0000 |
---|---|---|
committer | Owain Ainsworth <oga@cvs.openbsd.org> | 2009-01-27 00:29:45 +0000 |
commit | c95af1da49841d721d81d9d24293f07c041ef43c (patch) | |
tree | 86c241b2e8a3018bdc1f2bca292fd0e9c0c19de8 | |
parent | 753959cc4929993fb4e2dc23a1c7069ca3ca7e12 (diff) |
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@.
-rw-r--r-- | sys/dev/pci/drm/drmP.h | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/mach64_irq.c | 8 |
2 files changed, 8 insertions, 4 deletions
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); |