linux/drivers/media
Aurelien Jarno 9f8401fdc2 media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c)
commit 31e97d7c9a upstream.

This patch replaces max(a, min(b, c)) by clamp(b, a, c) in the solo6x10
driver.  This improves the readability and more importantly, for the
solo6x10-p2m.c file, this reduces on my system (x86-64, gcc 13):

 - the preprocessed size from 121 MiB to 4.5 MiB;

 - the build CPU time from 46.8 s to 1.6 s;

 - the build memory from 2786 MiB to 98MiB.

In fine, this allows this relatively simple C file to be built on a
32-bit system.

Reported-by: Jiri Slaby <jirislaby@gmail.com>
Closes: https://lore.kernel.org/lkml/18c6df0d-45ed-450c-9eda-95160a2bbb8e@gmail.com/
Cc:  <stable@vger.kernel.org> # v6.7+
Suggested-by: David Laight <David.Laight@ACULAB.COM>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Reviewed-by: David Laight <David.Laight@ACULAB.COM>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Salvatore Bonaccorso <carnil@debian.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2024-08-29 17:30:41 +02:00
..
cec media: cec: core: avoid confusing "transmit timed out" message 2024-06-12 11:03:48 +02:00
common media: v4l2-tpg: fix some memleaks in tpg_alloc 2024-03-26 18:20:46 -04:00
dvb-core media: drivers/media/dvb-core: copy user arrays safely 2024-08-29 17:30:35 +02:00
dvb-frontends media: dvb-frontends: tda10048: Fix integer overflow 2024-07-11 12:47:08 +02:00
firewire media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00
i2c media: i2c: Fix imx412 exposure control 2024-08-03 08:49:11 +02:00
mc media: mc: mark the media devnode as registered from the, start 2024-06-16 13:41:35 +02:00
mmc media: media/*/Kconfig: sort entries 2022-03-18 05:58:35 +01:00
pci media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) 2024-08-29 17:30:41 +02:00
platform media: qcom: venus: fix incorrect return value 2024-08-29 17:30:31 +02:00
radio media: radio-isa: use dev_name to fill in bus_info 2024-08-29 17:30:30 +02:00
rc lirc: rc_dev_get_from_fd(): fix file leak 2024-08-03 08:49:51 +02:00
spi media updates for v5.18-rc1 2022-03-23 14:51:35 -07:00
test-drivers media: vivid: avoid integer overflow 2023-11-28 17:07:02 +00:00
tuners media: xc2028: avoid use-after-free in load_firmware_cb() 2024-08-14 13:52:49 +02:00
usb media: Revert "media: dvb-usb: Fix unexpected infinite loop in dvb_usb_read_remote_control()" 2024-08-19 06:00:07 +02:00
v4l2-core media: v4l: async: Fix NULL pointer dereference in adding ancillary links 2024-08-03 08:49:11 +02:00
Kconfig media: remove reference to CONFIG_EMBEDDED in MEDIA_SUPPORT_FILTER 2022-09-08 18:19:29 +02:00
Makefile media: Makefiles: remove extra spaces 2022-03-12 16:59:52 +01:00