media: go7007: Use min and max macros
authorRicardo Ribalda <ribalda@chromium.org>
Mon, 29 Apr 2024 15:04:44 +0000 (16:04 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 3 May 2024 10:06:27 +0000 (11:06 +0100)
Replace ternary inline selection of f1 and f2 min max values with min()
and max() helper functions for the sake of readability and to make
coccinelle happier

drivers/media/usb/go7007/go7007-fw.c:1292:14-15: WARNING opportunity for max()
drivers/media/usb/go7007/go7007-fw.c:1293:14-15: WARNING opportunity for min()

Link: https://lore.kernel.org/linux-media/20240429-fix-cocci-v3-5-3c4865f5a4b0@chromium.org
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/usb/go7007/go7007-fw.c

index 018019ba47d46e9638a33dbc135e333e3b48c79a..86ce593e0c546572c7e24e13b40072e1aaed95ac 100644 (file)
@@ -1289,8 +1289,8 @@ static int avsync_to_package(struct go7007 *go, __le16 *code, int space)
                0xbf99,         (u16)((-adjratio) >> 16),
                0xbf92,         0,
                0xbf93,         0,
-               0xbff4,         f1 > f2 ? f1 : f2,
-               0xbff5,         f1 < f2 ? f1 : f2,
+               0xbff4,         max(f1, f2),
+               0xbff5,         min(f1, f2),
                0xbff6,         f1 < f2 ? ratio : ratio + 1,
                0xbff7,         f1 > f2 ? ratio : ratio + 1,
                0xbff8,         0,