Fix sprintf format warnings in drm_proc.c

Use "%zd" for size_t, and make sure to have a space between the numbers
instead of depending on the field width.

I don't like warnings in my default targeted build.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Linus Torvalds 2008-10-20 14:14:25 -07:00
Родитель 2bea2e4abf
Коммит 1ae8778680
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -522,12 +522,12 @@ static int drm_gem_one_name_info(int id, void *ptr, void *data)
struct drm_gem_object *obj = ptr; struct drm_gem_object *obj = ptr;
struct drm_gem_name_info_data *nid = data; struct drm_gem_name_info_data *nid = data;
DRM_INFO("name %d size %d\n", obj->name, obj->size); DRM_INFO("name %d size %zd\n", obj->name, obj->size);
if (nid->eof) if (nid->eof)
return 0; return 0;
nid->len += sprintf(&nid->buf[nid->len], nid->len += sprintf(&nid->buf[nid->len],
"%6d%9d%8d%9d\n", "%6d %8zd %7d %8d\n",
obj->name, obj->size, obj->name, obj->size,
atomic_read(&obj->handlecount.refcount), atomic_read(&obj->handlecount.refcount),
atomic_read(&obj->refcount.refcount)); atomic_read(&obj->refcount.refcount));