Commit df044ebf authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: vc04_services: don't print pointers directly

kernel pointers should be printed with %pK and are not unsigned int big
on all architectures.  So fix this up to get rid of a bunch of warning
messages.

Note, there are other assumptions in this code that a pointer fits into
an int that need to be fixed up later.

Cc: Daniel Stone <daniels@collabora.com>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Pranith Kumar <bobby.prani@gmail.com>
Cc: popcornmix <popcornmix@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f51bb7a6
...@@ -171,8 +171,8 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state) ...@@ -171,8 +171,8 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
} }
vchiq_log_info(vchiq_arm_log_level, vchiq_log_info(vchiq_arm_log_level,
"vchiq_init - done (slots %x, phys %pad)", "vchiq_init - done (slots %pK, phys %pad)",
(unsigned int)vchiq_slot_zero, &slot_phys); vchiq_slot_zero, &slot_phys);
vchiq_call_connected_callbacks(); vchiq_call_connected_callbacks();
...@@ -386,8 +386,8 @@ create_pagelist(char __user *buf, size_t count, unsigned short type, ...@@ -386,8 +386,8 @@ create_pagelist(char __user *buf, size_t count, unsigned short type,
(num_pages * sizeof(pages[0])), (num_pages * sizeof(pages[0])),
GFP_KERNEL); GFP_KERNEL);
vchiq_log_trace(vchiq_arm_log_level, vchiq_log_trace(vchiq_arm_log_level, "create_pagelist - %pK",
"create_pagelist - %x", (unsigned int)pagelist); pagelist);
if (!pagelist) if (!pagelist)
return -ENOMEM; return -ENOMEM;
...@@ -511,8 +511,8 @@ free_pagelist(PAGELIST_T *pagelist, int actual) ...@@ -511,8 +511,8 @@ free_pagelist(PAGELIST_T *pagelist, int actual)
struct page **pages; struct page **pages;
unsigned int num_pages, i; unsigned int num_pages, i;
vchiq_log_trace(vchiq_arm_log_level, vchiq_log_trace(vchiq_arm_log_level, "free_pagelist - %pK, %d",
"free_pagelist - %x, %d", (unsigned int)pagelist, actual); pagelist, actual);
num_pages = num_pages =
(pagelist->length + pagelist->offset + PAGE_SIZE - 1) / (pagelist->length + pagelist->offset + PAGE_SIZE - 1) /
......
...@@ -418,8 +418,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -418,8 +418,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
DEBUG_INITIALISE(g_state.local) DEBUG_INITIALISE(g_state.local)
vchiq_log_trace(vchiq_arm_log_level, vchiq_log_trace(vchiq_arm_log_level,
"vchiq_ioctl - instance %x, cmd %s, arg %lx", "vchiq_ioctl - instance %pK, cmd %s, arg %lx",
(unsigned int)instance, instance,
((_IOC_TYPE(cmd) == VCHIQ_IOC_MAGIC) && ((_IOC_TYPE(cmd) == VCHIQ_IOC_MAGIC) &&
(_IOC_NR(cmd) <= VCHIQ_IOC_MAX)) ? (_IOC_NR(cmd) <= VCHIQ_IOC_MAX)) ?
ioctl_names[_IOC_NR(cmd)] : "<invalid>", arg); ioctl_names[_IOC_NR(cmd)] : "<invalid>", arg);
...@@ -713,8 +713,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -713,8 +713,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break; break;
} }
vchiq_log_info(vchiq_arm_log_level, vchiq_log_info(vchiq_arm_log_level,
"found bulk_waiter %x for pid %d", "found bulk_waiter %pK for pid %d", waiter,
(unsigned int)waiter, current->pid); current->pid);
args.userdata = &waiter->bulk_waiter; args.userdata = &waiter->bulk_waiter;
} }
status = vchiq_bulk_transfer status = vchiq_bulk_transfer
...@@ -743,8 +743,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -743,8 +743,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
list_add(&waiter->list, &instance->bulk_waiter_list); list_add(&waiter->list, &instance->bulk_waiter_list);
mutex_unlock(&instance->bulk_waiter_list_mutex); mutex_unlock(&instance->bulk_waiter_list_mutex);
vchiq_log_info(vchiq_arm_log_level, vchiq_log_info(vchiq_arm_log_level,
"saved bulk_waiter %x for pid %d", "saved bulk_waiter %pK for pid %d",
(unsigned int)waiter, current->pid); waiter, current->pid);
if (copy_to_user((void __user *) if (copy_to_user((void __user *)
&(((VCHIQ_QUEUE_BULK_TRANSFER_T __user *) &(((VCHIQ_QUEUE_BULK_TRANSFER_T __user *)
...@@ -826,10 +826,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -826,10 +826,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (args.msgbufsize < msglen) { if (args.msgbufsize < msglen) {
vchiq_log_error( vchiq_log_error(
vchiq_arm_log_level, vchiq_arm_log_level,
"header %x: msgbufsize" "header %pK: msgbufsize %x < msglen %x",
" %x < msglen %x", header, args.msgbufsize,
(unsigned int)header,
args.msgbufsize,
msglen); msglen);
WARN(1, "invalid message " WARN(1, "invalid message "
"size\n"); "size\n");
...@@ -980,9 +978,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -980,9 +978,8 @@ vchiq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
ret = -EFAULT; ret = -EFAULT;
} else { } else {
vchiq_log_error(vchiq_arm_log_level, vchiq_log_error(vchiq_arm_log_level,
"header %x: bufsize %x < size %x", "header %pK: bufsize %x < size %x",
(unsigned int)header, args.bufsize, header, args.bufsize, header->size);
header->size);
WARN(1, "invalid size\n"); WARN(1, "invalid size\n");
ret = -EMSGSIZE; ret = -EMSGSIZE;
} }
...@@ -1284,9 +1281,8 @@ vchiq_release(struct inode *inode, struct file *file) ...@@ -1284,9 +1281,8 @@ vchiq_release(struct inode *inode, struct file *file)
list); list);
list_del(pos); list_del(pos);
vchiq_log_info(vchiq_arm_log_level, vchiq_log_info(vchiq_arm_log_level,
"bulk_waiter - cleaned up %x " "bulk_waiter - cleaned up %pK for pid %d",
"for pid %d", waiter, waiter->pid);
(unsigned int)waiter, waiter->pid);
kfree(waiter); kfree(waiter);
} }
} }
...@@ -1385,9 +1381,8 @@ vchiq_dump_platform_instances(void *dump_context) ...@@ -1385,9 +1381,8 @@ vchiq_dump_platform_instances(void *dump_context)
instance = service->instance; instance = service->instance;
if (instance && !instance->mark) { if (instance && !instance->mark) {
len = snprintf(buf, sizeof(buf), len = snprintf(buf, sizeof(buf),
"Instance %x: pid %d,%s completions " "Instance %pK: pid %d,%s completions %d/%d",
"%d/%d", instance, instance->pid,
(unsigned int)instance, instance->pid,
instance->connected ? " connected, " : instance->connected ? " connected, " :
"", "",
instance->completion_insert - instance->completion_insert -
...@@ -1415,8 +1410,7 @@ vchiq_dump_platform_service_state(void *dump_context, VCHIQ_SERVICE_T *service) ...@@ -1415,8 +1410,7 @@ vchiq_dump_platform_service_state(void *dump_context, VCHIQ_SERVICE_T *service)
char buf[80]; char buf[80];
int len; int len;
len = snprintf(buf, sizeof(buf), " instance %x", len = snprintf(buf, sizeof(buf), " instance %pK", service->instance);
(unsigned int)service->instance);
if ((service->base.callback == service_callback) && if ((service->base.callback == service_callback) &&
user_service->is_vchi) { user_service->is_vchi) {
......
...@@ -155,9 +155,8 @@ VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance) ...@@ -155,9 +155,8 @@ VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance)
list); list);
list_del(pos); list_del(pos);
vchiq_log_info(vchiq_arm_log_level, vchiq_log_info(vchiq_arm_log_level,
"bulk_waiter - cleaned up %x " "bulk_waiter - cleaned up %pK for pid %d",
"for pid %d", waiter, waiter->pid);
(unsigned int)waiter, waiter->pid);
kfree(waiter); kfree(waiter);
} }
kfree(instance); kfree(instance);
...@@ -450,8 +449,8 @@ vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data, ...@@ -450,8 +449,8 @@ vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data,
list_add(&waiter->list, &instance->bulk_waiter_list); list_add(&waiter->list, &instance->bulk_waiter_list);
mutex_unlock(&instance->bulk_waiter_list_mutex); mutex_unlock(&instance->bulk_waiter_list_mutex);
vchiq_log_info(vchiq_arm_log_level, vchiq_log_info(vchiq_arm_log_level,
"saved bulk_waiter %x for pid %d", "saved bulk_waiter %pK for pid %d",
(unsigned int)waiter, current->pid); waiter, current->pid);
} }
return status; return status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment