linux/drivers/edac
Linus Torvalds 4477b39c32 minmax: add a few more MIN_T/MAX_T users
Commit 3a7e02c040 ("minmax: avoid overly complicated constant
expressions in VM code") added the simpler MIN_T/MAX_T macros in order
to avoid some excessive expansion from the rather complicated regular
min/max macros.

The complexity of those macros stems from two issues:

 (a) trying to use them in situations that require a C constant
     expression (in static initializers and for array sizes)

 (b) the type sanity checking

and MIN_T/MAX_T avoids both of these issues.

Now, in the whole (long) discussion about all this, it was pointed out
that the whole type sanity checking is entirely unnecessary for
min_t/max_t which get a fixed type that the comparison is done in.

But that still leaves min_t/max_t unnecessarily complicated due to
worries about the C constant expression case.

However, it turns out that there really aren't very many cases that use
min_t/max_t for this, and we can just force-convert those.

This does exactly that.

Which in turn will then allow for much simpler implementations of
min_t()/max_t().  All the usual "macros in all upper case will evaluate
the arguments multiple times" rules apply.

We should do all the same things for the regular min/max() vs MIN/MAX()
cases, but that has the added complexity of various drivers defining
their own local versions of MIN/MAX, so that needs another level of
fixes first.

Link: https://lore.kernel.org/all/b47fad1d0cf8449886ad148f8c013dae@AcuMS.aculab.com/
Cc: David Laight <David.Laight@aculab.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-07-28 13:41:14 -07:00
..
al_mc_edac.c EDAC/al_mc: Make use of the helper function devm_add_action_or_reset() 2021-09-28 18:35:11 +02:00
altera_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
altera_edac.h
amd64_edac.c EDAC/amd64: Check return value of amd_smn_read() 2024-06-12 11:33:45 +02:00
amd64_edac.h EDAC/amd64: Remove unused register accesses 2024-06-12 11:33:45 +02:00
amd76x_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
amd8111_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
amd8111_edac.h
amd8131_edac.c EDAC/amd81[13]1: Remove trailing newline from MODULE_AUTHOR 2023-03-28 15:26:52 +02:00
amd8131_edac.h
armada_xp_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
aspeed_edac.c EDAC/aspeed: Convert to platform remove callback returning void 2023-11-20 21:26:01 +01:00
bluefield_edac.c EDAC/bluefield: Convert to platform remove callback returning void 2023-11-20 21:28:08 +01:00
cell_edac.c EDAC/cell: Convert to platform remove callback returning void 2023-11-20 21:39:13 +01:00
cpc925_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
debugfs.c ARM: 8892/1: EDAC: Add missing debugfs_create_x32 wrapper 2019-08-29 07:58:01 +01:00
dmc520_edac.c EDAC/dmc520: Use devm_platform_ioremap_resource() 2024-06-23 10:48:55 +02:00
e7xxx_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
e752x_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
edac_device_sysfs.c EDAC/device: Remove edac_dev_sysfs_block_attribute::store() 2024-03-27 18:26:57 +01:00
edac_device.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
edac_device.h EDAC: Remove unused struct members 2024-03-27 18:26:58 +01:00
edac_mc_sysfs.c EDAC/mc_sysfs: Convert sprintf()/snprintf() to sysfs_emit() 2024-04-04 18:23:57 +02:00
edac_mc.c EDAC/mc: Add support for HBM3 memory type 2023-11-28 16:39:12 +01:00
edac_mc.h EDAC/mc: Determine mci pointer from the error descriptor 2020-02-17 13:05:10 +01:00
edac_module.c EDAC: constantify the struct bus_type usage 2024-01-04 14:34:27 +01:00
edac_module.h EDAC/device: Fix period calculation in edac_device_reset_delay_period() 2022-12-30 15:51:41 +01:00
edac_pci_sysfs.c Driver core changes for 6.8-rc1 2024-01-18 09:48:40 -08:00
edac_pci.c treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
edac_pci.h EDAC: Remove unused struct members 2024-03-27 18:26:58 +01:00
fsl_ddr_edac.c EDAC/fsl_ddr: Convert to platform remove callback returning void 2023-11-20 23:34:04 +01:00
fsl_ddr_edac.h EDAC/fsl_ddr: Convert to platform remove callback returning void 2023-11-20 23:34:04 +01:00
ghes_edac.c EDAC/ghes: Add missing newline to pr_info() statement 2024-05-28 16:13:09 +02:00
highbank_l2_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
highbank_mc_edac.c EDAC/highbank_mc: Convert to platform remove callback returning void 2023-11-20 22:33:52 +01:00
i7core_edac.c EDAC/{sb,i7core}_edac: Do not use a plain integer for a NULL pointer 2023-11-28 15:43:43 +01:00
i10nm_base.c EDAC/i10nm: Switch to new Intel CPU model defines 2024-05-28 16:02:44 -07:00
i3000_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
i3200_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
i5000_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
i5100_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
i5400_edac.c EDAC/i5400: Fix typo in comment: vaious -> various 2022-11-25 19:29:02 +01:00
i7300_edac.c EDAC/i7300: Correct the i7300_exit() function name in comment 2022-09-23 23:07:17 +02:00
i82443bxgx_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
i82860_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
i82875p_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
i82975x_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
ie31200_edac.c EDAC/ie31200: Add Skylake-S support 2022-08-25 10:28:01 +02:00
igen6_edac.c - The AMD memory controllers data fabric version 4.5 supports 2024-07-15 18:20:24 -07:00
Kconfig EDAC/amd64: Use new AMD Address Translation Library 2024-01-24 12:55:00 +01:00
layerscape_edac.c EDAC: Add missing MODULE_DESCRIPTION() macros 2024-06-29 16:21:01 +02:00
Makefile EDAC, i10nm: make skx_common.o a separate module 2024-05-29 13:30:10 -07:00
mce_amd.c x86/cpu/amd: Provide a separate accessor for Node ID 2024-02-15 22:07:37 +01:00
mce_amd.h x86/mce/amd, edac: Remove report_gart_errors 2020-04-14 15:53:46 +02:00
mpc85xx_edac.c EDAC: Add missing MODULE_DESCRIPTION() macros 2024-06-29 16:21:01 +02:00
mpc85xx_edac.h treewide: Replace GPLv2 boilerplate/reference with SPDX - gpl-2.0_56.RULE (part 2) 2022-06-10 14:51:35 +02:00
npcm_edac.c EDAC/npcm: Convert to platform remove callback returning void 2023-11-20 22:52:14 +01:00
octeon_edac-l2c.c EDAC: Add missing MODULE_DESCRIPTION() macros 2024-06-29 16:21:01 +02:00
octeon_edac-lmc.c EDAC: Add missing MODULE_DESCRIPTION() macros 2024-06-29 16:21:01 +02:00
octeon_edac-pc.c EDAC: Add missing MODULE_DESCRIPTION() macros 2024-06-29 16:21:01 +02:00
octeon_edac-pci.c EDAC: Add missing MODULE_DESCRIPTION() macros 2024-06-29 16:21:01 +02:00
pasemi_edac.c
pnd2_edac.c EDAC, pnd2: Switch to new Intel CPU model defines 2024-05-28 16:03:43 -07:00
pnd2_edac.h
ppc4xx_edac.c EDAC/ppc4xx: Convert to platform remove callback returning void 2023-11-20 23:24:46 +01:00
ppc4xx_edac.h
qcom_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
r82600_edac.c EDAC: Sanitize MODULE_AUTHOR strings 2023-03-28 15:43:30 +02:00
sb_edac.c minmax: add a few more MIN_T/MAX_T users 2024-07-28 13:41:14 -07:00
sifive_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
skx_base.c EDAC/skx: Switch to new Intel CPU model defines 2024-05-28 16:04:44 -07:00
skx_common.c EDAC, i10nm: make skx_common.o a separate module 2024-05-29 13:30:10 -07:00
skx_common.h EDAC, i10nm: make skx_common.o a separate module 2024-05-29 13:30:10 -07:00
synopsys_edac.c EDAC/synopsys: Fix ECC status and IRQ control race condition 2024-05-06 14:19:07 +02:00
thunderx_edac.c EDAC/thunderx: Remove unused struct error_syndrome 2024-05-27 14:42:04 +02:00
ti_edac.c EDAC/ti: Convert to platform remove callback returning void 2023-11-20 23:30:09 +01:00
versal_edac.c EDAC/versal: Do not log total error counts 2024-04-25 18:08:05 +02:00
wq.c EDAC/wq: Remove unneeded flush_workqueue() 2022-08-25 10:50:35 +02:00
x38_edac.c EDAC: Do not issue useless debug statements in the polling routine 2020-10-26 12:59:56 +01:00
xgene_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
zynqmp_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00