* [PATCH V3] drivers/media/video/uvc: Use %pUl to print UUIDs [not found] ` <20091013151652.5d2a49b7.akpm@linux-foundation.org> @ 2009-10-13 23:35 ` Joe Perches 2010-02-02 15:23 ` Mauro Carvalho Chehab 0 siblings, 1 reply; 4+ messages in thread From: Joe Perches @ 2009-10-13 23:35 UTC (permalink / raw) To: Andrew Morton; +Cc: mchehab, Laurent Pinchart, LKML On Tue, 2009-10-13 at 15:16 -0700, Andrew Morton wrote: > Please either send an incremental patch or send a new patch. Not this. Sure thing. This patch includes some changes that Laurent originally commented on as well as the Buffer[5]/buffer[5] correction. http://lkml.org/lkml/2009/9/30/399 Signed-off-by: Joe Perches <joe@perches.com> drivers/media/video/uvc/uvc_ctrl.c | 74 +++++++++++++++------------------ drivers/media/video/uvc/uvc_driver.c | 9 ++-- drivers/media/video/uvc/uvcvideo.h | 10 ----- 3 files changed, 38 insertions(+), 55 deletions(-) diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index c3225a5..4536c3e 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c @@ -1092,10 +1092,9 @@ int uvc_xu_ctrl_query(struct uvc_video_chain *chain, } if (!found) { - uvc_trace(UVC_TRACE_CONTROL, - "Control " UVC_GUID_FORMAT "/%u not found.\n", - UVC_GUID_ARGS(entity->extension.guidExtensionCode), - xctrl->selector); + uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u not found.\n", + entity->extension.guidExtensionCode, + xctrl->selector); return -EINVAL; } @@ -1171,9 +1170,9 @@ int uvc_ctrl_resume_device(struct uvc_device *dev) (ctrl->info->flags & UVC_CONTROL_RESTORE) == 0) continue; - printk(KERN_INFO "restoring control " UVC_GUID_FORMAT - "/%u/%u\n", UVC_GUID_ARGS(ctrl->info->entity), - ctrl->info->index, ctrl->info->selector); + printk(KERN_INFO "restoring control %pUl/%u/%u\n", + ctrl->info->entity, + ctrl->info->index, ctrl->info->selector); ctrl->dirty = 1; } @@ -1227,47 +1226,44 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev, ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id, dev->intfnum, info->selector, (__u8 *)&size, 2); if (ret < 0) { - uvc_trace(UVC_TRACE_CONTROL, "GET_LEN failed on " - "control " UVC_GUID_FORMAT "/%u (%d).\n", - UVC_GUID_ARGS(info->entity), info->selector, - ret); + uvc_trace(UVC_TRACE_CONTROL, + "GET_LEN failed on control %pUl/%u (%d).\n", + info->entity, info->selector, ret); return; } if (info->size != le16_to_cpu(size)) { - uvc_trace(UVC_TRACE_CONTROL, "Control " UVC_GUID_FORMAT - "/%u size doesn't match user supplied " - "value.\n", UVC_GUID_ARGS(info->entity), - info->selector); + uvc_trace(UVC_TRACE_CONTROL, + "Control %pUl/%u size doesn't match user supplied value.\n", + info->entity, info->selector); return; } ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id, dev->intfnum, info->selector, &inf, 1); if (ret < 0) { - uvc_trace(UVC_TRACE_CONTROL, "GET_INFO failed on " - "control " UVC_GUID_FORMAT "/%u (%d).\n", - UVC_GUID_ARGS(info->entity), info->selector, - ret); + uvc_trace(UVC_TRACE_CONTROL, + "GET_INFO failed on control %pUl/%u (%d).\n", + info->entity, info->selector, ret); return; } flags = info->flags; if (((flags & UVC_CONTROL_GET_CUR) && !(inf & (1 << 0))) || ((flags & UVC_CONTROL_SET_CUR) && !(inf & (1 << 1)))) { - uvc_trace(UVC_TRACE_CONTROL, "Control " - UVC_GUID_FORMAT "/%u flags don't match " - "supported operations.\n", - UVC_GUID_ARGS(info->entity), info->selector); + uvc_trace(UVC_TRACE_CONTROL, + "Control %pUl/%u flags don't match supported operations.\n", + info->entity, info->selector); return; } } ctrl->info = info; ctrl->data = kmalloc(ctrl->info->size * UVC_CTRL_NDATA, GFP_KERNEL); - uvc_trace(UVC_TRACE_CONTROL, "Added control " UVC_GUID_FORMAT "/%u " - "to device %s entity %u\n", UVC_GUID_ARGS(ctrl->info->entity), - ctrl->info->selector, dev->udev->devpath, entity->id); + uvc_trace(UVC_TRACE_CONTROL, + "Added control %pUl/%u to device %s entity %u\n", + ctrl->info->entity, ctrl->info->selector, + dev->udev->devpath, entity->id); } /* @@ -1293,17 +1289,16 @@ int uvc_ctrl_add_info(struct uvc_control_info *info) continue; if (ctrl->selector == info->selector) { - uvc_trace(UVC_TRACE_CONTROL, "Control " - UVC_GUID_FORMAT "/%u is already defined.\n", - UVC_GUID_ARGS(info->entity), info->selector); + uvc_trace(UVC_TRACE_CONTROL, + "Control %pUl/%u is already defined.\n", + info->entity, info->selector); ret = -EEXIST; goto end; } if (ctrl->index == info->index) { - uvc_trace(UVC_TRACE_CONTROL, "Control " - UVC_GUID_FORMAT "/%u would overwrite index " - "%d.\n", UVC_GUID_ARGS(info->entity), - info->selector, info->index); + uvc_trace(UVC_TRACE_CONTROL, + "Control %pUl/%u would overwrite index %d.\n", + info->entity, info->selector, info->index); ret = -EEXIST; goto end; } @@ -1344,10 +1339,9 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping) continue; if (info->size * 8 < mapping->size + mapping->offset) { - uvc_trace(UVC_TRACE_CONTROL, "Mapping '%s' would " - "overflow control " UVC_GUID_FORMAT "/%u\n", - mapping->name, UVC_GUID_ARGS(info->entity), - info->selector); + uvc_trace(UVC_TRACE_CONTROL, + "Mapping '%s' would overflow control %pUl/%u\n", + mapping->name, info->entity, info->selector); ret = -EOVERFLOW; goto end; } @@ -1366,9 +1360,9 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping) mapping->ctrl = info; list_add_tail(&mapping->list, &info->mappings); - uvc_trace(UVC_TRACE_CONTROL, "Adding mapping %s to control " - UVC_GUID_FORMAT "/%u.\n", mapping->name, - UVC_GUID_ARGS(info->entity), info->selector); + uvc_trace(UVC_TRACE_CONTROL, + "Adding mapping %s to control %pUl/%u.\n", + mapping->name, info->entity, info->selector); ret = 0; break; diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c index 8756be5..21d5077 100644 --- a/drivers/media/video/uvc/uvc_driver.c +++ b/drivers/media/video/uvc/uvc_driver.c @@ -328,11 +328,10 @@ static int uvc_parse_format(struct uvc_device *dev, sizeof format->name); format->fcc = fmtdesc->fcc; } else { - uvc_printk(KERN_INFO, "Unknown video format " - UVC_GUID_FORMAT "\n", - UVC_GUID_ARGS(&buffer[5])); - snprintf(format->name, sizeof format->name, - UVC_GUID_FORMAT, UVC_GUID_ARGS(&buffer[5])); + uvc_printk(KERN_INFO, "Unknown video format %pUl\n", + &buffer[5]); + snprintf(format->name, sizeof format->name, "%pUl", + &buffer[5]); format->fcc = 0; } diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h index e7958aa..9f4a437 100644 --- a/drivers/media/video/uvc/uvcvideo.h +++ b/drivers/media/video/uvc/uvcvideo.h @@ -555,16 +555,6 @@ extern unsigned int uvc_trace_param; #define uvc_printk(level, 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. */ ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH V3] drivers/media/video/uvc: Use %pUl to print UUIDs 2009-10-13 23:35 ` [PATCH V3] drivers/media/video/uvc: Use %pUl to print UUIDs Joe Perches @ 2010-02-02 15:23 ` Mauro Carvalho Chehab 2010-02-02 17:50 ` Joe Perches 0 siblings, 1 reply; 4+ messages in thread From: Mauro Carvalho Chehab @ 2010-02-02 15:23 UTC (permalink / raw) To: Laurent Pinchart; +Cc: Joe Perches, LKML Hi Laurent, I'm reviewing all patches marked as under review at Patchwork and I noticed that this one were never applied, nor I found any nack at linux-media ML. What's the status for it? Cheers, Mauro. Joe Perches wrote: > On Tue, 2009-10-13 at 15:16 -0700, Andrew Morton wrote: >> Please either send an incremental patch or send a new patch. Not this. > > Sure thing. > > This patch includes some changes that Laurent originally > commented on as well as the Buffer[5]/buffer[5] correction. > > http://lkml.org/lkml/2009/9/30/399 > > Signed-off-by: Joe Perches <joe@perches.com> > > drivers/media/video/uvc/uvc_ctrl.c | 74 +++++++++++++++------------------ > drivers/media/video/uvc/uvc_driver.c | 9 ++-- > drivers/media/video/uvc/uvcvideo.h | 10 ----- > 3 files changed, 38 insertions(+), 55 deletions(-) > > diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c > index c3225a5..4536c3e 100644 > --- a/drivers/media/video/uvc/uvc_ctrl.c > +++ b/drivers/media/video/uvc/uvc_ctrl.c > @@ -1092,10 +1092,9 @@ int uvc_xu_ctrl_query(struct uvc_video_chain *chain, > } > > if (!found) { > - uvc_trace(UVC_TRACE_CONTROL, > - "Control " UVC_GUID_FORMAT "/%u not found.\n", > - UVC_GUID_ARGS(entity->extension.guidExtensionCode), > - xctrl->selector); > + uvc_trace(UVC_TRACE_CONTROL, "Control %pUl/%u not found.\n", > + entity->extension.guidExtensionCode, > + xctrl->selector); > return -EINVAL; > } > > @@ -1171,9 +1170,9 @@ int uvc_ctrl_resume_device(struct uvc_device *dev) > (ctrl->info->flags & UVC_CONTROL_RESTORE) == 0) > continue; > > - printk(KERN_INFO "restoring control " UVC_GUID_FORMAT > - "/%u/%u\n", UVC_GUID_ARGS(ctrl->info->entity), > - ctrl->info->index, ctrl->info->selector); > + printk(KERN_INFO "restoring control %pUl/%u/%u\n", > + ctrl->info->entity, > + ctrl->info->index, ctrl->info->selector); > ctrl->dirty = 1; > } > > @@ -1227,47 +1226,44 @@ static void uvc_ctrl_add_ctrl(struct uvc_device *dev, > ret = uvc_query_ctrl(dev, UVC_GET_LEN, ctrl->entity->id, > dev->intfnum, info->selector, (__u8 *)&size, 2); > if (ret < 0) { > - uvc_trace(UVC_TRACE_CONTROL, "GET_LEN failed on " > - "control " UVC_GUID_FORMAT "/%u (%d).\n", > - UVC_GUID_ARGS(info->entity), info->selector, > - ret); > + uvc_trace(UVC_TRACE_CONTROL, > + "GET_LEN failed on control %pUl/%u (%d).\n", > + info->entity, info->selector, ret); > return; > } > > if (info->size != le16_to_cpu(size)) { > - uvc_trace(UVC_TRACE_CONTROL, "Control " UVC_GUID_FORMAT > - "/%u size doesn't match user supplied " > - "value.\n", UVC_GUID_ARGS(info->entity), > - info->selector); > + uvc_trace(UVC_TRACE_CONTROL, > + "Control %pUl/%u size doesn't match user supplied value.\n", > + info->entity, info->selector); > return; > } > > ret = uvc_query_ctrl(dev, UVC_GET_INFO, ctrl->entity->id, > dev->intfnum, info->selector, &inf, 1); > if (ret < 0) { > - uvc_trace(UVC_TRACE_CONTROL, "GET_INFO failed on " > - "control " UVC_GUID_FORMAT "/%u (%d).\n", > - UVC_GUID_ARGS(info->entity), info->selector, > - ret); > + uvc_trace(UVC_TRACE_CONTROL, > + "GET_INFO failed on control %pUl/%u (%d).\n", > + info->entity, info->selector, ret); > return; > } > > flags = info->flags; > if (((flags & UVC_CONTROL_GET_CUR) && !(inf & (1 << 0))) || > ((flags & UVC_CONTROL_SET_CUR) && !(inf & (1 << 1)))) { > - uvc_trace(UVC_TRACE_CONTROL, "Control " > - UVC_GUID_FORMAT "/%u flags don't match " > - "supported operations.\n", > - UVC_GUID_ARGS(info->entity), info->selector); > + uvc_trace(UVC_TRACE_CONTROL, > + "Control %pUl/%u flags don't match supported operations.\n", > + info->entity, info->selector); > return; > } > } > > ctrl->info = info; > ctrl->data = kmalloc(ctrl->info->size * UVC_CTRL_NDATA, GFP_KERNEL); > - uvc_trace(UVC_TRACE_CONTROL, "Added control " UVC_GUID_FORMAT "/%u " > - "to device %s entity %u\n", UVC_GUID_ARGS(ctrl->info->entity), > - ctrl->info->selector, dev->udev->devpath, entity->id); > + uvc_trace(UVC_TRACE_CONTROL, > + "Added control %pUl/%u to device %s entity %u\n", > + ctrl->info->entity, ctrl->info->selector, > + dev->udev->devpath, entity->id); > } > > /* > @@ -1293,17 +1289,16 @@ int uvc_ctrl_add_info(struct uvc_control_info *info) > continue; > > if (ctrl->selector == info->selector) { > - uvc_trace(UVC_TRACE_CONTROL, "Control " > - UVC_GUID_FORMAT "/%u is already defined.\n", > - UVC_GUID_ARGS(info->entity), info->selector); > + uvc_trace(UVC_TRACE_CONTROL, > + "Control %pUl/%u is already defined.\n", > + info->entity, info->selector); > ret = -EEXIST; > goto end; > } > if (ctrl->index == info->index) { > - uvc_trace(UVC_TRACE_CONTROL, "Control " > - UVC_GUID_FORMAT "/%u would overwrite index " > - "%d.\n", UVC_GUID_ARGS(info->entity), > - info->selector, info->index); > + uvc_trace(UVC_TRACE_CONTROL, > + "Control %pUl/%u would overwrite index %d.\n", > + info->entity, info->selector, info->index); > ret = -EEXIST; > goto end; > } > @@ -1344,10 +1339,9 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping) > continue; > > if (info->size * 8 < mapping->size + mapping->offset) { > - uvc_trace(UVC_TRACE_CONTROL, "Mapping '%s' would " > - "overflow control " UVC_GUID_FORMAT "/%u\n", > - mapping->name, UVC_GUID_ARGS(info->entity), > - info->selector); > + uvc_trace(UVC_TRACE_CONTROL, > + "Mapping '%s' would overflow control %pUl/%u\n", > + mapping->name, info->entity, info->selector); > ret = -EOVERFLOW; > goto end; > } > @@ -1366,9 +1360,9 @@ int uvc_ctrl_add_mapping(struct uvc_control_mapping *mapping) > > mapping->ctrl = info; > list_add_tail(&mapping->list, &info->mappings); > - uvc_trace(UVC_TRACE_CONTROL, "Adding mapping %s to control " > - UVC_GUID_FORMAT "/%u.\n", mapping->name, > - UVC_GUID_ARGS(info->entity), info->selector); > + uvc_trace(UVC_TRACE_CONTROL, > + "Adding mapping %s to control %pUl/%u.\n", > + mapping->name, info->entity, info->selector); > > ret = 0; > break; > diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c > index 8756be5..21d5077 100644 > --- a/drivers/media/video/uvc/uvc_driver.c > +++ b/drivers/media/video/uvc/uvc_driver.c > @@ -328,11 +328,10 @@ static int uvc_parse_format(struct uvc_device *dev, > sizeof format->name); > format->fcc = fmtdesc->fcc; > } else { > - uvc_printk(KERN_INFO, "Unknown video format " > - UVC_GUID_FORMAT "\n", > - UVC_GUID_ARGS(&buffer[5])); > - snprintf(format->name, sizeof format->name, > - UVC_GUID_FORMAT, UVC_GUID_ARGS(&buffer[5])); > + uvc_printk(KERN_INFO, "Unknown video format %pUl\n", > + &buffer[5]); > + snprintf(format->name, sizeof format->name, "%pUl", > + &buffer[5]); > format->fcc = 0; > } > > diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h > index e7958aa..9f4a437 100644 > --- a/drivers/media/video/uvc/uvcvideo.h > +++ b/drivers/media/video/uvc/uvcvideo.h > @@ -555,16 +555,6 @@ extern unsigned int uvc_trace_param; > #define uvc_printk(level, 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. > */ > > -- Cheers, Mauro ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V3] drivers/media/video/uvc: Use %pUl to print UUIDs 2010-02-02 15:23 ` Mauro Carvalho Chehab @ 2010-02-02 17:50 ` Joe Perches 2010-02-03 1:18 ` Laurent Pinchart 0 siblings, 1 reply; 4+ messages in thread From: Joe Perches @ 2010-02-02 17:50 UTC (permalink / raw) To: Mauro Carvalho Chehab; +Cc: Laurent Pinchart, LKML On Tue, 2010-02-02 at 13:23 -0200, Mauro Carvalho Chehab wrote: > I'm reviewing all patches marked as under review at Patchwork and I noticed > that this one were never applied, nor I found any nack at linux-media ML. > > What's the status for it? Laurent wanted it withdrawn so he could fix some backward compatibility thing he wanted. http://lkml.org/lkml/2009/11/4/216 Nothing's happened since as far as I know. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH V3] drivers/media/video/uvc: Use %pUl to print UUIDs 2010-02-02 17:50 ` Joe Perches @ 2010-02-03 1:18 ` Laurent Pinchart 0 siblings, 0 replies; 4+ messages in thread From: Laurent Pinchart @ 2010-02-03 1:18 UTC (permalink / raw) To: Joe Perches, Douglas Schilling Landgraf; +Cc: Mauro Carvalho Chehab, LKML On Tuesday 02 February 2010 18:50:43 Joe Perches wrote: > On Tue, 2010-02-02 at 13:23 -0200, Mauro Carvalho Chehab wrote: > > I'm reviewing all patches marked as under review at Patchwork and I > > noticed that this one were never applied, nor I found any nack at > > linux-media ML. > > > > What's the status for it? > > Laurent wanted it withdrawn so he could fix some > backward compatibility thing he wanted. > > http://lkml.org/lkml/2009/11/4/216 > > Nothing's happened since as far as I know. There's a patch in my git tree, I'll send a pull request tomorrow. I had actually prepared a -hg compat patch as well, but the switch to git changed the workflow. Douglas, will you handle the -hg compat "automatically" ? The code will compile on older kernels without a warning, but it will still require #ifdef's to run correctly on older kernels. Is there a standard way to notify you about that during patches submission ? -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-02-03 1:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1255471594.18975.79.camel@Joe-Laptop.home>
[not found] ` <20091013151652.5d2a49b7.akpm@linux-foundation.org>
2009-10-13 23:35 ` [PATCH V3] drivers/media/video/uvc: Use %pUl to print UUIDs Joe Perches
2010-02-02 15:23 ` Mauro Carvalho Chehab
2010-02-02 17:50 ` Joe Perches
2010-02-03 1:18 ` Laurent Pinchart
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).