linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	linux-media@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: [PATCH v2 2/6] rcar-vin: Make use of V4L2_FIELD_IS_INTERLACED() macro
Date: Thu,  8 Aug 2019 03:18:46 +0200	[thread overview]
Message-ID: <20190808011850.21219-3-niklas.soderlund+renesas@ragnatech.se> (raw)
In-Reply-To: <20190808011850.21219-1-niklas.soderlund+renesas@ragnatech.se>

The V4L2_FIELD_IS_INTERLACED() can be used to make the code more
readable, use it.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/platform/rcar-vin/rcar-dma.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c
index f16f2966f9628b72..6be1f33d44e2170c 100644
--- a/drivers/media/platform/rcar-vin/rcar-dma.c
+++ b/drivers/media/platform/rcar-vin/rcar-dma.c
@@ -557,16 +557,11 @@ static void rvin_crop_scale_comp_gen2(struct rvin_dev *vin)
 	rvin_write(vin, 0, VNSPPOC_REG);
 	rvin_write(vin, 0, VNSLPOC_REG);
 	rvin_write(vin, vin->format.width - 1, VNEPPOC_REG);
-	switch (vin->format.field) {
-	case V4L2_FIELD_INTERLACED:
-	case V4L2_FIELD_INTERLACED_TB:
-	case V4L2_FIELD_INTERLACED_BT:
+
+	if (V4L2_FIELD_IS_INTERLACED(vin->format.field))
 		rvin_write(vin, vin->format.height / 2 - 1, VNELPOC_REG);
-		break;
-	default:
+	else
 		rvin_write(vin, vin->format.height - 1, VNELPOC_REG);
-		break;
-	}
 
 	vin_dbg(vin,
 		"Pre-Clip: %ux%u@%u:%u YS: %d XS: %d Post-Clip: %ux%u@%u:%u\n",
-- 
2.22.0


  parent reply	other threads:[~2019-08-08  1:19 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-08  1:18 [PATCH v2 0/6] rcar-vin: Add support for V4L2_FIELD_ALTERNATE Niklas Söderlund
2019-08-08  1:18 ` [PATCH v2 1/6] rcar-vin: Fix incorrect return statement in rvin_try_format() Niklas Söderlund
2019-08-08  8:25   ` Laurent Pinchart
2019-08-08  1:18 ` Niklas Söderlund [this message]
2019-08-08  8:27   ` [PATCH v2 2/6] rcar-vin: Make use of V4L2_FIELD_IS_INTERLACED() macro Laurent Pinchart
2019-08-08  1:18 ` [PATCH v2 3/6] rcar-vin: Rename rectangle holding the video source information Niklas Söderlund
2019-08-08  8:30   ` Laurent Pinchart
2019-09-04 12:52     ` Niklas Söderlund
2019-08-08  1:18 ` [PATCH v2 4/6] rcar-vin: Do not reset the crop and compose rectangles in s_fmt Niklas Söderlund
2019-08-08  8:37   ` Laurent Pinchart
2019-08-08 13:35     ` Niklas Söderlund
2019-08-28 10:25       ` Hans Verkuil
2019-08-08  1:18 ` [PATCH v2 5/6] rcar-vin: Add support for V4L2_FIELD_ALTERNATE Niklas Söderlund
2019-08-08  1:18 ` [PATCH v2 6/6] rcar-vin: Clean up how format is set on subdevice Niklas Söderlund

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=20190808011850.21219-3-niklas.soderlund+renesas@ragnatech.se \
    --to=niklas.soderlund+renesas@ragnatech.se \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).