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/[email protected] Signed-off-by: Ricardo Ribalda <[email protected]> Reviewed-by: Luca Ceresoli <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent e9a8446 commit 6a56625

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

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)