diff options
author | Ricardo Ribalda <ribalda@chromium.org> | 2024-04-29 17:04:49 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2024-05-03 12:10:00 +0200 |
commit | 6a56625b9e64593339937072897938f673de8a80 (patch) | |
tree | a82c314b478d1cdc2e9dd23fe1e647d5e7d0c549 /drivers | |
parent | media: dvb-frontends: tda18271c2dd: Remove casting during div (diff) | |
download | linux-6a56625b9e64593339937072897938f673de8a80.tar.xz linux-6a56625b9e64593339937072897938f673de8a80.zip |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/tegra-video/tegra20.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/staging/media/tegra-video/tegra20.c b/drivers/staging/media/tegra-video/tegra20.c index 630e2ff987a3..7b8f8f810b35 100644 --- a/drivers/staging/media/tegra-video/tegra20.c +++ b/drivers/staging/media/tegra-video/tegra20.c @@ -317,13 +317,8 @@ static void tegra20_channel_queue_setup(struct tegra_vi_channel *chan) chan->addr_offset_v = chan->addr_offset_u + stride * height / 4; /* For YVU420, we swap the locations of the U and V planes. */ - if (chan->format.pixelformat == V4L2_PIX_FMT_YVU420) { - unsigned long temp; - - temp = chan->addr_offset_u; - chan->addr_offset_u = chan->addr_offset_v; - chan->addr_offset_v = temp; - } + if (chan->format.pixelformat == V4L2_PIX_FMT_YVU420) + swap(chan->addr_offset_u, chan->addr_offset_v); chan->start_offset_u = chan->addr_offset_u; chan->start_offset_v = chan->addr_offset_v; |