1
linux/drivers/edac
Linus Torvalds 1a251f52cf minmax: make generic MIN() and MAX() macros available everywhere
This just standardizes the use of MIN() and MAX() macros, with the very
traditional semantics.  The goal is to use these for C constant
expressions and for top-level / static initializers, and so be able to
simplify the min()/max() macros.

These macro names were used by various kernel code - they are very
traditional, after all - and all such users have been fixed up, with a
few different approaches:

 - trivial duplicated macro definitions have been removed

   Note that 'trivial' here means that it's obviously kernel code that
   already included all the major kernel headers, and thus gets the new
   generic MIN/MAX macros automatically.

 - non-trivial duplicated macro definitions are guarded with #ifndef

   This is the "yes, they define their own versions, but no, the include
   situation is not entirely obvious, and maybe they don't get the
   generic version automatically" case.

 - strange use case #1

   A couple of drivers decided that the way they want to describe their
   versioning is with

	#define MAJ 1
	#define MIN 2
	#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN)

   which adds zero value and I just did my Alexander the Great
   impersonation, and rewrote that pointless Gordian knot as

	#define DRV_VERSION "1.2"

   instead.

 - strange use case #2

   A couple of drivers thought that it's a good idea to have a random
   'MIN' or 'MAX' define for a value or index into a table, rather than
   the traditional macro that takes arguments.

   These values were re-written as C enum's instead. The new
   function-line macros only expand when followed by an open
   parenthesis, and thus don't clash with enum use.

Happily, there weren't really all that many of these cases, and a lot of
users already had the pattern of using '#ifndef' guarding (or in one
case just using '#undef MIN') before defining their own private version
that does the same thing. I left such cases alone.

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 15:49:18 -07:00
..
al_mc_edac.c
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
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
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
bluefield_edac.c
cell_edac.c
cpc925_edac.c EDAC: Remove dynamic attributes from edac_device_alloc_ctl_info() 2024-03-27 18:26:58 +01:00
debugfs.c
dmc520_edac.c EDAC/dmc520: Use devm_platform_ioremap_resource() 2024-06-23 10:48:55 +02:00
e7xxx_edac.c
e752x_edac.c
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.h
edac_module.c
edac_module.h
edac_pci_sysfs.c Driver core changes for 6.8-rc1 2024-01-18 09:48:40 -08:00
edac_pci.c
edac_pci.h EDAC: Remove unused struct members 2024-03-27 18:26:58 +01:00
fsl_ddr_edac.c
fsl_ddr_edac.h
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
i7core_edac.c
i10nm_base.c EDAC/i10nm: Switch to new Intel CPU model defines 2024-05-28 16:02:44 -07:00
i3000_edac.c
i3200_edac.c
i5000_edac.c
i5100_edac.c
i5400_edac.c
i7300_edac.c
i82443bxgx_edac.c
i82860_edac.c
i82875p_edac.c
i82975x_edac.c
ie31200_edac.c
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
mpc85xx_edac.c EDAC: Add missing MODULE_DESCRIPTION() macros 2024-06-29 16:21:01 +02:00
mpc85xx_edac.h
npcm_edac.c
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
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
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 minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -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
versal_edac.c EDAC/versal: Do not log total error counts 2024-04-25 18:08:05 +02:00
wq.c
x38_edac.c
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