Skip to content

Commit

Permalink
drm: Remove the prefix argument of drm_ut_debug_printk()
Browse files Browse the repository at this point in the history
This is always DRM_NAME, so we can just make it part of the format
string instead of asking prink to do it for us.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Lespiau, Damien authored and Dave Airlie committed Mar 28, 2014
1 parent 1288c19 commit 1287aa9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
6 changes: 2 additions & 4 deletions drivers/gpu/drm/drm_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ int drm_err(const char *func, const char *format, ...)
}
EXPORT_SYMBOL(drm_err);

void drm_ut_debug_printk(const char *prefix,
const char *function_name,
const char *format, ...)
void drm_ut_debug_printk(const char *function_name, const char *format, ...)
{
struct va_format vaf;
va_list args;
Expand All @@ -108,7 +106,7 @@ void drm_ut_debug_printk(const char *prefix,
vaf.fmt = format;
vaf.va = &args;

printk(KERN_DEBUG "[%s:%s], %pV", prefix, function_name, &vaf);
printk(KERN_DEBUG "[" DRM_NAME ":%s], %pV", function_name, &vaf);

va_end(args);
}
Expand Down
17 changes: 6 additions & 11 deletions include/drm/drmP.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,8 @@ struct videomode;
#define DRM_UT_KMS 0x04
#define DRM_UT_PRIME 0x08

extern __printf(3, 4)
void drm_ut_debug_printk(const char *prefix,
const char *function_name,
extern __printf(2, 3)
void drm_ut_debug_printk(const char *function_name,
const char *format, ...);
extern __printf(2, 3)
int drm_err(const char *func, const char *format, ...);
Expand Down Expand Up @@ -209,27 +208,23 @@ int drm_err(const char *func, const char *format, ...);
#define DRM_DEBUG(fmt, args...) \
do { \
if (unlikely(drm_debug & DRM_UT_CORE)) \
drm_ut_debug_printk(DRM_NAME, __func__, \
fmt, ##args); \
drm_ut_debug_printk(__func__, fmt, ##args); \
} while (0)

#define DRM_DEBUG_DRIVER(fmt, args...) \
do { \
if (unlikely(drm_debug & DRM_UT_DRIVER)) \
drm_ut_debug_printk(DRM_NAME, __func__, \
fmt, ##args); \
drm_ut_debug_printk(__func__, fmt, ##args); \
} while (0)
#define DRM_DEBUG_KMS(fmt, args...) \
do { \
if (unlikely(drm_debug & DRM_UT_KMS)) \
drm_ut_debug_printk(DRM_NAME, __func__, \
fmt, ##args); \
drm_ut_debug_printk(__func__, fmt, ##args); \
} while (0)
#define DRM_DEBUG_PRIME(fmt, args...) \
do { \
if (unlikely(drm_debug & DRM_UT_PRIME)) \
drm_ut_debug_printk(DRM_NAME, __func__, \
fmt, ##args); \
drm_ut_debug_printk(__func__, fmt, ##args); \
} while (0)
#else
#define DRM_DEBUG_DRIVER(fmt, args...) do { } while (0)
Expand Down

0 comments on commit 1287aa9

Please sign in to comment.