diff options
author | Joe Perches <joe@perches.com> | 2011-04-17 23:35:51 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-04-28 00:53:02 -0400 |
commit | 5ad3d8831f0c97257460c11ddcc1cc0466c762d4 (patch) | |
tree | 8ab86a7b1c0ebfcfdbf24270ac1f54ed1bed8a6e /drivers/gpu/drm/drm_stub.c | |
parent | cb49ba0bb18632faa7c5ce1dcb095eaa70821c1d (diff) |
drm: Create and use drm_err
Reduce drm text size ~1% by using drm_err and
printf extension %pV to emit error messages.
Remove unused macro DRM_MEM_ERROR.
$ size drivers/gpu/drm/built-in.o*
text data bss dec hex filename
361159 9663 256 371078 5a986 drivers/gpu/drm/built-in.o.new
365416 9663 256 375335 5ba27 drivers/gpu/drm/built-in.o.old
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_stub.c')
-rw-r--r-- | drivers/gpu/drm/drm_stub.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 001273d57f2d..6d7b083c5b77 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -62,6 +62,26 @@ struct idr drm_minors_idr; | |||
62 | struct class *drm_class; | 62 | struct class *drm_class; |
63 | struct proc_dir_entry *drm_proc_root; | 63 | struct proc_dir_entry *drm_proc_root; |
64 | struct dentry *drm_debugfs_root; | 64 | struct dentry *drm_debugfs_root; |
65 | |||
66 | int drm_err(const char *func, const char *format, ...) | ||
67 | { | ||
68 | struct va_format vaf; | ||
69 | va_list args; | ||
70 | int r; | ||
71 | |||
72 | va_start(args, format); | ||
73 | |||
74 | vaf.fmt = format; | ||
75 | vaf.va = &args; | ||
76 | |||
77 | r = printk(KERN_ERR "[" DRM_NAME ":%s] *ERROR* %pV", func, &vaf); | ||
78 | |||
79 | va_end(args); | ||
80 | |||
81 | return r; | ||
82 | } | ||
83 | EXPORT_SYMBOL(drm_err); | ||
84 | |||
65 | void drm_ut_debug_printk(unsigned int request_level, | 85 | void drm_ut_debug_printk(unsigned int request_level, |
66 | const char *prefix, | 86 | const char *prefix, |
67 | const char *function_name, | 87 | const char *function_name, |
@@ -78,6 +98,7 @@ void drm_ut_debug_printk(unsigned int request_level, | |||
78 | } | 98 | } |
79 | } | 99 | } |
80 | EXPORT_SYMBOL(drm_ut_debug_printk); | 100 | EXPORT_SYMBOL(drm_ut_debug_printk); |
101 | |||
81 | static int drm_minor_get_id(struct drm_device *dev, int type) | 102 | static int drm_minor_get_id(struct drm_device *dev, int type) |
82 | { | 103 | { |
83 | int new_id; | 104 | int new_id; |