提交 36bd883e 编写于 作者: L Laurent Pinchart 提交者: Mauro Carvalho Chehab

V4L/DVB: uvcvideo: Use %pUl printk format specifier to print GUIDs

Replace the UVC_GUID_FORMAT and UVC_GUID_ARGS macros with the new %pUl
printk format specifier.
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 56d15cd3
...@@ -1080,10 +1080,8 @@ int uvc_xu_ctrl_query(struct uvc_video_chain *chain, ...@@ -1080,10 +1080,8 @@ int uvc_xu_ctrl_query(struct uvc_video_chain *chain,
} }
if (!found) { if (!found) {
uvc_trace(UVC_TRACE_CONTROL, uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u not found.\n",
"Control " UVC_GUID_FORMAT "/%u not found.\n", entity->extension.guidExtensionCode, xctrl->selector);
UVC_GUID_ARGS(entity->extension.guidExtensionCode),
xctrl->selector);
return -EINVAL; return -EINVAL;
} }
...@@ -1159,9 +1157,9 @@ int uvc_ctrl_resume_device(struct uvc_device *dev) ...@@ -1159,9 +1157,9 @@ int uvc_ctrl_resume_device(struct uvc_device *dev)
(ctrl->info->flags & UVC_CONTROL_RESTORE) == 0) (ctrl->info->flags & UVC_CONTROL_RESTORE) == 0)
continue; continue;
printk(KERN_INFO "restoring control " UVC_GUID_FORMAT printk(KERN_INFO "restoring control %pUl/%u/%u\n",
"/%u/%u\n", UVC_GUID_ARGS(ctrl->info->entity), ctrl->info->entity, ctrl->info->index,
ctrl->info->index, ctrl->info->selector); ctrl->info->selector);
ctrl->dirty = 1; ctrl->dirty = 1;
} }
...@@ -1215,47 +1213,43 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev, ...@@ -1215,47 +1213,43 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev,
ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id, ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id,
dev->intfnum, info->selector, (__u8 *)&size, 2); dev->intfnum, info->selector, (__u8 *)&size, 2);
if (ret < 0) { if (ret < 0) {
uvc_trace(UVC_TRACE_CONTROL, "GET_LEN failed on " uvc_trace(UVC_TRACE_CONTROL,
"control " UVC_GUID_FORMAT "/%u (%d).\n", "GET_LEN failed on control %pUl/%u (%d).\n",
UVC_GUID_ARGS(info->entity), info->selector, info->entity, info->selector, ret);
ret);
return; return;
} }
if (info->size != le16_to_cpu(size)) { if (info->size != le16_to_cpu(size)) {
uvc_trace(UVC_TRACE_CONTROL, "Control " UVC_GUID_FORMAT uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u size "
"/%u size doesn't match user supplied " "doesn't match user supplied value.\n",
"value.\n", UVC_GUID_ARGS(info->entity), info->entity, info->selector);
info->selector);
return; return;
} }
ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id, ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id,
dev->intfnum, info->selector, &inf, 1); dev->intfnum, info->selector, &inf, 1);
if (ret < 0) { if (ret < 0) {
uvc_trace(UVC_TRACE_CONTROL, "GET_INFO failed on " uvc_trace(UVC_TRACE_CONTROL,
"control " UVC_GUID_FORMAT "/%u (%d).\n", "GET_INFO failed on control %pUl/%u (%d).\n",
UVC_GUID_ARGS(info->entity), info->selector, info->entity, info->selector, ret);
ret);
return; return;
} }
flags = info->flags; flags = info->flags;
if (((flags & UVC_CONTROL_GET_CUR) && !(inf & (1 << 0))) || if (((flags & UVC_CONTROL_GET_CUR) && !(inf & (1 << 0))) ||
((flags & UVC_CONTROL_SET_CUR) && !(inf & (1 << 1)))) { ((flags & UVC_CONTROL_SET_CUR) && !(inf & (1 << 1)))) {
uvc_trace(UVC_TRACE_CONTROL, "Control " uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u flags "
UVC_GUID_FORMAT "/%u flags don't match " "don't match supported operations.\n",
"supported operations.\n", info->entity, info->selector);
UVC_GUID_ARGS(info->entity), info->selector);
return; return;
} }
} }
ctrl->info = info; ctrl->info = info;
ctrl->data = kmalloc(ctrl->info->size * UVC_CTRL_NDATA, GFP_KERNEL); ctrl->data = kmalloc(ctrl->info->size * UVC_CTRL_NDATA, GFP_KERNEL);
uvc_trace(UVC_TRACE_CONTROL, "Added control " UVC_GUID_FORMAT "/%u " uvc_trace(UVC_TRACE_CONTROL, "Added control %pUl/%u to device %s "
"to device %s entity %u\n", UVC_GUID_ARGS(ctrl->info->entity), "entity %u\n", ctrl->info->entity, ctrl->info->selector,
ctrl->info->selector, dev->udev->devpath, entity->id); dev->udev->devpath, entity->id);
} }
/* /*
...@@ -1281,17 +1275,16 @@ int uvc_ctrl_add_info(struct uvc_control_info *info) ...@@ -1281,17 +1275,16 @@ int uvc_ctrl_add_info(struct uvc_control_info *info)
continue; continue;
if (ctrl->selector == info->selector) { if (ctrl->selector == info->selector) {
uvc_trace(UVC_TRACE_CONTROL, "Control " uvc_trace(UVC_TRACE_CONTROL,
UVC_GUID_FORMAT "/%u is already defined.\n", "Control %pUl/%u is already defined.\n",
UVC_GUID_ARGS(info->entity), info->selector); info->entity, info->selector);
ret = -EEXIST; ret = -EEXIST;
goto end; goto end;
} }
if (ctrl->index == info->index) { if (ctrl->index == info->index) {
uvc_trace(UVC_TRACE_CONTROL, "Control " uvc_trace(UVC_TRACE_CONTROL,
UVC_GUID_FORMAT "/%u would overwrite index " "Control %pUl/%u would overwrite index %d.\n",
"%d.\n", UVC_GUID_ARGS(info->entity), info->entity, info->selector, info->index);
info->selector, info->index);
ret = -EEXIST; ret = -EEXIST;
goto end; goto end;
} }
...@@ -1332,10 +1325,9 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping) ...@@ -1332,10 +1325,9 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping)
continue; continue;
if (info->size * 8 < mapping->size + mapping->offset) { if (info->size * 8 < mapping->size + mapping->offset) {
uvc_trace(UVC_TRACE_CONTROL, "Mapping '%s' would " uvc_trace(UVC_TRACE_CONTROL,
"overflow control " UVC_GUID_FORMAT "/%u\n", "Mapping '%s' would overflow control %pUl/%u\n",
mapping->name, UVC_GUID_ARGS(info->entity), mapping->name, info->entity, info->selector);
info->selector);
ret = -EOVERFLOW; ret = -EOVERFLOW;
goto end; goto end;
} }
...@@ -1354,9 +1346,9 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping) ...@@ -1354,9 +1346,9 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping)
mapping->ctrl = info; mapping->ctrl = info;
list_add_tail(&mapping->list, &info->mappings); list_add_tail(&mapping->list, &info->mappings);
uvc_trace(UVC_TRACE_CONTROL, "Adding mapping %s to control " uvc_trace(UVC_TRACE_CONTROL,
UVC_GUID_FORMAT "/%u.\n", mapping->name, "Adding mapping %s to control %pUl/%u.\n",
UVC_GUID_ARGS(info->entity), info->selector); mapping->name, info->entity, info->selector);
ret = 0; ret = 0;
break; break;
......
...@@ -315,11 +315,10 @@ static int uvc_parse_format(struct uvc_device *dev, ...@@ -315,11 +315,10 @@ static int uvc_parse_format(struct uvc_device *dev,
sizeof format->name); sizeof format->name);
format->fcc = fmtdesc->fcc; format->fcc = fmtdesc->fcc;
} else { } else {
uvc_printk(KERN_INFO, "Unknown video format " uvc_printk(KERN_INFO, "Unknown video format %pUl\n",
UVC_GUID_FORMAT "\n", &buffer[5]);
UVC_GUID_ARGS(&buffer[5])); snprintf(format->name, sizeof(format->name), "%pUl\n",
snprintf(format->name, sizeof format->name, &buffer[5]);
UVC_GUID_FORMAT, UVC_GUID_ARGS(&buffer[5]));
format->fcc = 0; format->fcc = 0;
} }
......
...@@ -556,16 +556,6 @@ extern unsigned int uvc_timeout_param; ...@@ -556,16 +556,6 @@ extern unsigned int uvc_timeout_param;
#define uvc_printk(level, msg...) \ #define uvc_printk(level, msg...) \
printk(level "uvcvideo: " msg) printk(level "uvcvideo: " msg)
#define UVC_GUID_FORMAT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-" \
"%02x%02x%02x%02x%02x%02x"
#define UVC_GUID_ARGS(guid) \
(guid)[3], (guid)[2], (guid)[1], (guid)[0], \
(guid)[5], (guid)[4], \
(guid)[7], (guid)[6], \
(guid)[8], (guid)[9], \
(guid)[10], (guid)[11], (guid)[12], \
(guid)[13], (guid)[14], (guid)[15]
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
* Internal functions. * Internal functions.
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册