OpenCloudOS-Kernel/drivers/media/pci/solo6x10
Aurelien Jarno 7a62d444a2 media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c)
commit 31e97d7c9ae3de072d7b424b2cf706a03ec10720 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: <regressions@leemhuis.info>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-02-16 19:10:56 +01:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
solo6x10-core.c media: solo6x10: fix possible memory leak in solo_sysfs_init() 2022-11-25 07:36:22 +00:00
solo6x10-disp.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-eeprom.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-enc.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-g723.c media: solo6x10: Convert to generic PCM copy ops 2023-08-18 12:18:57 +02:00
solo6x10-gpio.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-i2c.c media: Use fallthrough pseudo-keyword 2020-08-29 08:35:27 +02:00
solo6x10-jpeg.h media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-offsets.h media: solo6x10: replace max(a, min(b, c)) by clamp(b, a, c) 2024-02-16 19:10:56 +01:00
solo6x10-p2m.c media: solo6x10: switch from 'pci_' to 'dma_' API 2020-12-03 08:55:05 +01:00
solo6x10-regs.h media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-tw28.c media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-tw28.h media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00
solo6x10-v4l2-enc.c media: avoid use of 'videobuf' 2022-08-29 16:27:18 +02:00
solo6x10-v4l2.c media: v4l: ioctl: Set bus_info in v4l_querycap() 2022-04-24 08:07:08 +01:00
solo6x10.h media: solo6x10: replace http references with https 2020-07-19 07:52:59 +02:00