Skip to content

Commit 7d6a8e8

Browse files
ribaldamchehab
authored andcommitted
media: tegra-vde: Refactor timeout handling
Reorder the branches a bit, so cocci stops complaining about the code. drivers/media/platform/nvidia/tegra-vde/h264.c:645:20-21: WARNING opportunity for min() Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Ricardo Ribalda <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 1d3eb44 commit 7d6a8e8

File tree

1 file changed

+3
-3
lines changed
  • drivers/media/platform/nvidia/tegra-vde

1 file changed

+3
-3
lines changed

drivers/media/platform/nvidia/tegra-vde/h264.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,9 @@ static int tegra_vde_decode_end(struct tegra_vde *vde)
633633

634634
timeout = wait_for_completion_interruptible_timeout(
635635
&vde->decode_completion, msecs_to_jiffies(1000));
636-
if (timeout == 0) {
636+
if (timeout < 0) {
637+
ret = timeout;
638+
} else if (timeout == 0) {
637639
bsev_ptr = tegra_vde_readl(vde, vde->bsev, 0x10);
638640
macroblocks_nb = tegra_vde_readl(vde, vde->sxe, 0xC8) & 0x1FFF;
639641
read_bytes = bsev_ptr ? bsev_ptr - vde->bitstream_data_addr : 0;
@@ -642,8 +644,6 @@ static int tegra_vde_decode_end(struct tegra_vde *vde)
642644
read_bytes, macroblocks_nb);
643645

644646
ret = -EIO;
645-
} else if (timeout < 0) {
646-
ret = timeout;
647647
} else {
648648
ret = 0;
649649
}

0 commit comments

Comments
 (0)