The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham@ideasonboard.com>
To: Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>,
	linux-media@vger.kernel.org
Cc: Jai Luthra <jai.luthra@ideasonboard.com>,
	linux-kernel@vger.kernel.org,
	Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Subject: Re: [PATCH v6 1/3] media: ti: cal: Use printk's fourcc formatting
Date: Mon, 24 Mar 2025 09:35:42 +0000	[thread overview]
Message-ID: <174280894255.3289779.11656220268332464691@ping.linuxembedded.co.uk> (raw)
In-Reply-To: <20250324-cal-streams-v6-1-28c93fb8f0c9@ideasonboard.com>

Quoting Tomi Valkeinen (2025-03-24 09:29:17)
> Use printk's fourcc formatting instead of a custom one.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>


Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> ---
>  drivers/media/platform/ti/cal/cal-video.c | 26 ++++++--------------------
>  1 file changed, 6 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/media/platform/ti/cal/cal-video.c b/drivers/media/platform/ti/cal/cal-video.c
> index e29743ae61e2..4eb77f46f030 100644
> --- a/drivers/media/platform/ti/cal/cal-video.c
> +++ b/drivers/media/platform/ti/cal/cal-video.c
> @@ -25,20 +25,6 @@
>  
>  #include "cal.h"
>  
> -/*  Print Four-character-code (FOURCC) */
> -static char *fourcc_to_str(u32 fmt)
> -{
> -       static char code[5];
> -
> -       code[0] = (unsigned char)(fmt & 0xff);
> -       code[1] = (unsigned char)((fmt >> 8) & 0xff);
> -       code[2] = (unsigned char)((fmt >> 16) & 0xff);
> -       code[3] = (unsigned char)((fmt >> 24) & 0xff);
> -       code[4] = '\0';
> -
> -       return code;
> -}
> -
>  /* ------------------------------------------------------------------
>   *     V4L2 Common IOCTLs
>   * ------------------------------------------------------------------
> @@ -180,8 +166,8 @@ static void cal_calc_format_size(struct cal_ctx *ctx,
>         f->fmt.pix.sizeimage = f->fmt.pix.height *
>                                f->fmt.pix.bytesperline;
>  
> -       ctx_dbg(3, ctx, "%s: fourcc: %s size: %dx%d bpl:%d img_size:%d\n",
> -               __func__, fourcc_to_str(f->fmt.pix.pixelformat),
> +       ctx_dbg(3, ctx, "%s: fourcc: %p4cc size: %dx%d bpl:%d img_size:%d\n",
> +               __func__, &f->fmt.pix.pixelformat,
>                 f->fmt.pix.width, f->fmt.pix.height,
>                 f->fmt.pix.bytesperline, f->fmt.pix.sizeimage);
>  }
> @@ -509,8 +495,8 @@ static void cal_mc_try_fmt(struct cal_ctx *ctx, struct v4l2_format *f,
>         if (info)
>                 *info = fmtinfo;
>  
> -       ctx_dbg(3, ctx, "%s: %s %ux%u (bytesperline %u sizeimage %u)\n",
> -               __func__, fourcc_to_str(format->pixelformat),
> +       ctx_dbg(3, ctx, "%s: %p4cc %ux%u (bytesperline %u sizeimage %u)\n",
> +               __func__, &format->pixelformat,
>                 format->width, format->height,
>                 format->bytesperline, format->sizeimage);
>  }
> @@ -866,8 +852,8 @@ static int cal_ctx_v4l2_init_formats(struct cal_ctx *ctx)
>                         if (mbus_code.code == fmtinfo->code) {
>                                 ctx->active_fmt[i] = fmtinfo;
>                                 ctx_dbg(2, ctx,
> -                                       "matched fourcc: %s: code: %04x idx: %u\n",
> -                                       fourcc_to_str(fmtinfo->fourcc),
> +                                       "matched fourcc: %p4cc: code: %04x idx: %u\n",
> +                                       &fmtinfo->fourcc,
>                                         fmtinfo->code, i);
>                                 ctx->num_active_fmt = ++i;
>                         }
> 
> -- 
> 2.43.0
>

  reply	other threads:[~2025-03-24  9:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-24  9:29 [PATCH v6 0/3] media: ti: cal: Add streams support Tomi Valkeinen
2025-03-24  9:29 ` [PATCH v6 1/3] media: ti: cal: Use printk's fourcc formatting Tomi Valkeinen
2025-03-24  9:35   ` Kieran Bingham [this message]
2025-03-24  9:29 ` [PATCH v6 2/3] media: ti: cal: Fix wrong goto on error path Tomi Valkeinen
2025-03-24  9:34   ` Kieran Bingham
2025-03-24  9:29 ` [PATCH v6 3/3] media: ti: cal: Add streams support Tomi Valkeinen
2025-03-24 13:12   ` Kieran Bingham
2025-03-26 11:28     ` Tomi Valkeinen

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=174280894255.3289779.11656220268332464691@ping.linuxembedded.co.uk \
    --to=kieran.bingham@ideasonboard.com \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=jai.luthra@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tomi.valkeinen@ideasonboard.com \
    /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