mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Joe Perches <joe@perches.com>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 5/8] drivers/media/video/uvc: Use %pUl to print UUIDs
Date: Mon, 12 Oct 2009 00:34:58 +0200	[thread overview]
Message-ID: <200910120034.58943.laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <ef810b1f134d8b5f07b849b13751445d7d49956b.1254884776.git.joe@perches.com>

Hi Joe,

On Wednesday 07 October 2009 06:45:38 Joe Perches wrote:
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>  drivers/media/video/uvc/uvc_ctrl.c   |   69 ++++++++++++++++------------------
>  drivers/media/video/uvc/uvc_driver.c |    7 +--
>  drivers/media/video/uvc/uvcvideo.h   |   10 -----
>  3 files changed, 35 insertions(+), 51 deletions(-)
> 
> diff --git a/drivers/media/video/uvc/uvc_ctrl.c
>  b/drivers/media/video/uvc/uvc_ctrl.c index c3225a5..4d06976 100644
> --- a/drivers/media/video/uvc/uvc_ctrl.c
> +++ b/drivers/media/video/uvc/uvc_ctrl.c
> @@ -1093,8 +1093,8 @@ 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),
> +			"Control %pUl/%u not found.\n",
> +			entity->extension.guidExtensionCode,
>  			xctrl->selector);
>  		return -EINVAL;
>  	}
> @@ -1171,9 +1171,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;
>  		}
> 
> @@ -1228,46 +1228,43 @@ static void uvc_ctrl_add_ctrl(struct uvc_device
>  *dev, 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);
> +				  "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 +1290,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 +1340,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 +1361,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..411dc63 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]));
> +			uvc_printk(KERN_INFO, "Unknown video format %pUl\n",
> +				   &buffer[5]);
>  			snprintf(format->name, sizeof format->name,
> -				UVC_GUID_FORMAT, UVC_GUID_ARGS(&buffer[5]));
> +				 "%pUl", &Buffer[5]);

Buffer should still be written buffer.

As this will go through the linuxtv v4l-dvb tree, I'll have to add backward
compatibility code (that will not make it to mainline). If that's ok with you
it will be easier for me to test and apply that part of the patch through my
tree once the vsprintf extension gets in. 

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2009-10-11 22:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-07  4:45 [PATCH 0/8] Add vsprintf extension %pU to print UUID/GUIDs and use it Joe Perches
     [not found] ` <cover.1254884776.git.joe@perches.com>
2009-10-07  4:45   ` [PATCH 1/8] lib/vsprintf.c: Add %pU to print UUID/GUIDs Joe Perches
2009-10-07  4:45   ` [PATCH 2/8] random.c: Use %pU to print UUIDs Joe Perches
2009-10-07  5:19     ` Matt Mackall
2009-10-07  4:45   ` [PATCH 3/8] drivers/firmware/dmi_scan.c: Use %pUB " Joe Perches
2009-10-07  4:45   ` [PATCH 4/8] drivers/md/md.c: Use %pU " Joe Perches
2009-10-07  4:45   ` [PATCH 5/8] drivers/media/video/uvc: Use %pUl " Joe Perches
2009-10-11 22:34     ` Laurent Pinchart [this message]
2009-10-31  9:07       ` Mauro Carvalho Chehab
2009-10-31 19:10         ` Laurent Pinchart
2009-10-31 19:27           ` Joe Perches
2009-11-04 14:42             ` Laurent Pinchart
2009-11-04 16:42               ` Joe Perches
2009-10-07  4:45   ` [PATCH 6/8] fs/gfs2/sys.c: Use %pUB " Joe Perches
2009-10-07  4:45   ` [PATCH 7/8] fs/ubifs: " Joe Perches
2009-10-07  4:45   ` [PATCH 8/8] fs/xfs/xfs_log_recover.c: Use %pU " Joe Perches
2009-10-07  6:11 ` [PATCH 9/8] efi.h: Use %pUl " Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200910120034.58943.laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=akpm@linux-foundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®