On Mon, Sep 16, 2019 at 11:00:47AM +0200, Hans Verkuil wrote:
> Use these new standard macros to log the fourcc value in a
> human readable format.
> 
> Signed-off-by: Hans Verkuil <hverkuil-ci...@xs4all.nl>
> ---
>  drivers/media/v4l2-core/v4l2-ioctl.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c 
> b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 51b912743f0f..80030533e1b8 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1383,12 +1383,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
>                               return;
>                       WARN(1, "Unknown pixelformat 0x%08x\n", 
> fmt->pixelformat);
>                       flags = 0;
> -                     snprintf(fmt->description, sz, "%c%c%c%c%s",
> -                                     (char)(fmt->pixelformat & 0x7f),
> -                                     (char)((fmt->pixelformat >> 8) & 0x7f),
> -                                     (char)((fmt->pixelformat >> 16) & 0x7f),
> -                                     (char)((fmt->pixelformat >> 24) & 0x7f),
> -                                     (fmt->pixelformat & (1UL << 31)) ? 
> "-BE" : "");
> +                     snprintf(fmt->description, sz, V4L2_FOURCC_CONV,
> +                              V4L2_FOURCC_ARGS(fmt->pixelformat));
>                       break;
>               }
>       }

Acked-by: Sakari Ailus <sakari.ai...@linux.intel.com>

-- 
Sakari Ailus

Reply via email to