Skip to content

Commit 6a56625

Browse files
ribaldamchehab
authored andcommitted
media: staging: media: tegra-video: Use swap macro
Makes the code simpler and cocci happier: drivers/staging/media/tegra-video/tegra20.c:324:44-45: WARNING opportunity for swap() Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-10-3c4865f5a4b0@chromium.org Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
1 parent e9a8446 commit 6a56625

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

drivers/staging/media/tegra-video/tegra20.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -317,13 +317,8 @@ static void tegra20_channel_queue_setup(struct tegra_vi_channel *chan)
317317
chan->addr_offset_v = chan->addr_offset_u + stride * height / 4;
318318

319319
/* For YVU420, we swap the locations of the U and V planes. */
320-
if (chan->format.pixelformat == V4L2_PIX_FMT_YVU420) {
321-
unsigned long temp;
322-
323-
temp = chan->addr_offset_u;
324-
chan->addr_offset_u = chan->addr_offset_v;
325-
chan->addr_offset_v = temp;
326-
}
320+
if (chan->format.pixelformat == V4L2_PIX_FMT_YVU420)
321+
swap(chan->addr_offset_u, chan->addr_offset_v);
327322

328323
chan->start_offset_u = chan->addr_offset_u;
329324
chan->start_offset_v = chan->addr_offset_v;

0 commit comments

Comments
 (0)