All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steve Longerbeam <slongerbeam@gmail.com>
To: linux-media@vger.kernel.org
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Rui Miguel Silva <rmfrfs@gmail.com>
Subject: [PATCH v2 03/10] media: imx: utils: Inline init_mbus_colorimetry() in its caller
Date: Sat, 28 Mar 2020 16:09:55 -0700	[thread overview]
Message-ID: <20200328231002.649-4-slongerbeam@gmail.com> (raw)
In-Reply-To: <20200328231002.649-1-slongerbeam@gmail.com>

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

The init_mbus_colorimetry() function is small and used in a single
place. The code becomes easier to follow if it gets inline in its
caller. Do so.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/staging/media/imx/imx-media-utils.c | 24 +++++++++------------
 1 file changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
index 00a71f01786c..cf0aba8d53ba 100644
--- a/drivers/staging/media/imx/imx-media-utils.c
+++ b/drivers/staging/media/imx/imx-media-utils.c
@@ -210,19 +210,6 @@ static const struct imx_media_pixfmt ipu_rgb_formats[] = {
 
 #define NUM_IPU_RGB_FORMATS ARRAY_SIZE(ipu_rgb_formats)
 
-static void init_mbus_colorimetry(struct v4l2_mbus_framefmt *mbus,
-				  const struct imx_media_pixfmt *fmt)
-{
-	mbus->colorspace = (fmt->cs == IPUV3_COLORSPACE_RGB) ?
-		V4L2_COLORSPACE_SRGB : V4L2_COLORSPACE_SMPTE170M;
-	mbus->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(mbus->colorspace);
-	mbus->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(mbus->colorspace);
-	mbus->quantization =
-		V4L2_MAP_QUANTIZATION_DEFAULT(fmt->cs == IPUV3_COLORSPACE_RGB,
-					      mbus->colorspace,
-					      mbus->ycbcr_enc);
-}
-
 static const struct imx_media_pixfmt *find_format(u32 fourcc,
 						  u32 code,
 						  enum codespace_sel cs_sel,
@@ -423,7 +410,16 @@ int imx_media_init_mbus_fmt(struct v4l2_mbus_framefmt *mbus,
 	}
 
 	mbus->code = code;
-	init_mbus_colorimetry(mbus, lcc);
+
+	mbus->colorspace = (lcc->cs == IPUV3_COLORSPACE_RGB) ?
+		V4L2_COLORSPACE_SRGB : V4L2_COLORSPACE_SMPTE170M;
+	mbus->xfer_func = V4L2_MAP_XFER_FUNC_DEFAULT(mbus->colorspace);
+	mbus->ycbcr_enc = V4L2_MAP_YCBCR_ENC_DEFAULT(mbus->colorspace);
+	mbus->quantization =
+		V4L2_MAP_QUANTIZATION_DEFAULT(lcc->cs == IPUV3_COLORSPACE_RGB,
+					      mbus->colorspace,
+					      mbus->ycbcr_enc);
+
 	if (cc)
 		*cc = lcc;
 
-- 
2.17.1


  parent reply	other threads:[~2020-03-28 23:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 23:09 [PATCH v2 00/10] media: imx: Miscellaneous format-related cleanups Steve Longerbeam
2020-03-28 23:09 ` [PATCH v2 01/10] media: imx: utils: fix and simplify pixel format enumeration Steve Longerbeam
2020-03-28 23:09 ` [PATCH v2 02/10] media: imx: utils: fix media bus " Steve Longerbeam
2020-03-28 23:09 ` Steve Longerbeam [this message]
2020-03-28 23:09 ` [PATCH v2 04/10] media: imx: utils: Handle Bayer format lookup through a selection flag Steve Longerbeam
2020-03-28 23:09 ` [PATCH v2 05/10] media: imx: utils: Simplify IPU format lookup and enumeration Steve Longerbeam
2020-03-28 23:09 ` [PATCH v2 06/10] media: imx: utils: Make imx_media_pixfmt handle variable number of codes Steve Longerbeam
2020-03-28 23:09 ` [PATCH v2 07/10] media: imx: utils: Remove unneeded argument to (find|enum)_format() Steve Longerbeam
2020-03-28 23:10 ` [PATCH v2 08/10] media: imx: utils: Rename format lookup and enumeration functions Steve Longerbeam
2020-03-28 23:10 ` [PATCH v2 09/10] media: imx: utils: Constify mbus argument to imx_media_mbus_fmt_to_pix_fmt Steve Longerbeam
2020-03-28 23:10 ` [PATCH v2 10/10] media: imx: utils: Split find|enum_format into fourcc and mbus functions Steve Longerbeam

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=20200328231002.649-4-slongerbeam@gmail.com \
    --to=slongerbeam@gmail.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=rmfrfs@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.