diff options
author | Joe Perches <joe@perches.com> | 2011-04-17 23:35:52 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-04-28 00:53:21 -0400 |
commit | bbb0aef5cfe95fe9b51a7eeba4a440b69037b01f (patch) | |
tree | 858fdc7ee2b358827888f278fdfd0dddfbacc64b | |
parent | 5ad3d8831f0c97257460c11ddcc1cc0466c762d4 (diff) |
drm: Verify debug message arguments
Add __attribute__((format (printf, 4, 5))) to drm_ut_debug_printk
and fix fallout.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | drivers/gpu/drm/drm_irq.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_bios.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_display.c | 5 | ||||
-rw-r--r-- | include/drm/drmP.h | 3 |
5 files changed, 17 insertions, 14 deletions
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 741457bd1c46..62ced7554ba4 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
@@ -684,10 +684,11 @@ int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc, | |||
684 | */ | 684 | */ |
685 | *vblank_time = ns_to_timeval(timeval_to_ns(&raw_time) - delta_ns); | 685 | *vblank_time = ns_to_timeval(timeval_to_ns(&raw_time) - delta_ns); |
686 | 686 | ||
687 | DRM_DEBUG("crtc %d : v %d p(%d,%d)@ %d.%d -> %d.%d [e %d us, %d rep]\n", | 687 | DRM_DEBUG("crtc %d : v %d p(%d,%d)@ %ld.%ld -> %ld.%ld [e %d us, %d rep]\n", |
688 | crtc, (int) vbl_status, hpos, vpos, raw_time.tv_sec, | 688 | crtc, (int)vbl_status, hpos, vpos, |
689 | raw_time.tv_usec, vblank_time->tv_sec, vblank_time->tv_usec, | 689 | (long)raw_time.tv_sec, (long)raw_time.tv_usec, |
690 | (int) duration_ns/1000, i); | 690 | (long)vblank_time->tv_sec, (long)vblank_time->tv_usec, |
691 | (int)duration_ns/1000, i); | ||
691 | 692 | ||
692 | vbl_status = DRM_VBLANKTIME_SCANOUTPOS_METHOD; | 693 | vbl_status = DRM_VBLANKTIME_SCANOUTPOS_METHOD; |
693 | if (invbl) | 694 | if (invbl) |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index fb5b4d426ae0..927442a11925 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
@@ -214,9 +214,9 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv, | |||
214 | i915_lvds_downclock) { | 214 | i915_lvds_downclock) { |
215 | dev_priv->lvds_downclock_avail = 1; | 215 | dev_priv->lvds_downclock_avail = 1; |
216 | dev_priv->lvds_downclock = temp_downclock; | 216 | dev_priv->lvds_downclock = temp_downclock; |
217 | DRM_DEBUG_KMS("LVDS downclock is found in VBT. ", | 217 | DRM_DEBUG_KMS("LVDS downclock is found in VBT. " |
218 | "Normal Clock %dKHz, downclock %dKHz\n", | 218 | "Normal Clock %dKHz, downclock %dKHz\n", |
219 | temp_downclock, panel_fixed_mode->clock); | 219 | temp_downclock, panel_fixed_mode->clock); |
220 | } | 220 | } |
221 | return; | 221 | return; |
222 | } | 222 | } |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e522c702b04e..21a7e70feacc 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -3497,11 +3497,11 @@ static unsigned long intel_calculate_wm(unsigned long clock_in_khz, | |||
3497 | 1000; | 3497 | 1000; |
3498 | entries_required = DIV_ROUND_UP(entries_required, wm->cacheline_size); | 3498 | entries_required = DIV_ROUND_UP(entries_required, wm->cacheline_size); |
3499 | 3499 | ||
3500 | DRM_DEBUG_KMS("FIFO entries required for mode: %d\n", entries_required); | 3500 | DRM_DEBUG_KMS("FIFO entries required for mode: %ld\n", entries_required); |
3501 | 3501 | ||
3502 | wm_size = fifo_size - (entries_required + wm->guard_size); | 3502 | wm_size = fifo_size - (entries_required + wm->guard_size); |
3503 | 3503 | ||
3504 | DRM_DEBUG_KMS("FIFO watermark level: %d\n", wm_size); | 3504 | DRM_DEBUG_KMS("FIFO watermark level: %ld\n", wm_size); |
3505 | 3505 | ||
3506 | /* Don't promote wm_size to unsigned... */ | 3506 | /* Don't promote wm_size to unsigned... */ |
3507 | if (wm_size > (long)wm->max_wm) | 3507 | if (wm_size > (long)wm->max_wm) |
@@ -3823,13 +3823,13 @@ static bool g4x_check_srwm(struct drm_device *dev, | |||
3823 | display_wm, cursor_wm); | 3823 | display_wm, cursor_wm); |
3824 | 3824 | ||
3825 | if (display_wm > display->max_wm) { | 3825 | if (display_wm > display->max_wm) { |
3826 | DRM_DEBUG_KMS("display watermark is too large(%d), disabling\n", | 3826 | DRM_DEBUG_KMS("display watermark is too large(%d/%ld), disabling\n", |
3827 | display_wm, display->max_wm); | 3827 | display_wm, display->max_wm); |
3828 | return false; | 3828 | return false; |
3829 | } | 3829 | } |
3830 | 3830 | ||
3831 | if (cursor_wm > cursor->max_wm) { | 3831 | if (cursor_wm > cursor->max_wm) { |
3832 | DRM_DEBUG_KMS("cursor watermark is too large(%d), disabling\n", | 3832 | DRM_DEBUG_KMS("cursor watermark is too large(%d/%ld), disabling\n", |
3833 | cursor_wm, cursor->max_wm); | 3833 | cursor_wm, cursor->max_wm); |
3834 | return false; | 3834 | return false; |
3835 | } | 3835 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_display.c b/drivers/gpu/drm/radeon/radeon_display.c index bdbab5c43bdc..06719340edcb 100644 --- a/drivers/gpu/drm/radeon/radeon_display.c +++ b/drivers/gpu/drm/radeon/radeon_display.c | |||
@@ -1087,8 +1087,9 @@ void radeon_compute_pll_legacy(struct radeon_pll *pll, | |||
1087 | *frac_fb_div_p = best_frac_feedback_div; | 1087 | *frac_fb_div_p = best_frac_feedback_div; |
1088 | *ref_div_p = best_ref_div; | 1088 | *ref_div_p = best_ref_div; |
1089 | *post_div_p = best_post_div; | 1089 | *post_div_p = best_post_div; |
1090 | DRM_DEBUG_KMS("%d %d, pll dividers - fb: %d.%d ref: %d, post %d\n", | 1090 | DRM_DEBUG_KMS("%lld %d, pll dividers - fb: %d.%d ref: %d, post %d\n", |
1091 | freq, best_freq / 1000, best_feedback_div, best_frac_feedback_div, | 1091 | (long long)freq, |
1092 | best_freq / 1000, best_feedback_div, best_frac_feedback_div, | ||
1092 | best_ref_div, best_post_div); | 1093 | best_ref_div, best_post_div); |
1093 | 1094 | ||
1094 | } | 1095 | } |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 22db51d10619..4ab866e73f46 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -122,7 +122,8 @@ struct drm_device; | |||
122 | * using the DRM_DEBUG_KMS and DRM_DEBUG. | 122 | * using the DRM_DEBUG_KMS and DRM_DEBUG. |
123 | */ | 123 | */ |
124 | 124 | ||
125 | extern void drm_ut_debug_printk(unsigned int request_level, | 125 | extern __attribute__((format (printf, 4, 5))) |
126 | void drm_ut_debug_printk(unsigned int request_level, | ||
126 | const char *prefix, | 127 | const char *prefix, |
127 | const char *function_name, | 128 | const char *function_name, |
128 | const char *format, ...); | 129 | const char *format, ...); |