1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-23 16:53:58 -05:00
linux/drivers/hwmon
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
..
occ
peci peci, hwmon: Switch to new Intel CPU model defines 2024-06-17 15:15:46 +02:00
pmbus hwmon: (pmbus/ltc4286) Drop unused i2c device ids 2024-07-10 07:11:34 -07:00
abituguru.c
abituguru3.c
acpi_power_meter.c
ad7314.c
ad7414.c
ad7418.c hwmon: (ad7418) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
adc128d818.c hwmon: (adc128d818) Fix underflows seen when writing limit attributes 2024-07-07 07:48:25 -07:00
adcxx.c
adm1025.c
adm1026.c
adm1029.c
adm1031.c hwmon: (adm1031) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
adm1177.c
adm9240.c
ads7828.c hwmon: (ads7828) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
ads7871.c
adt7x10.c
adt7x10.h
adt7310.c
adt7410.c
adt7411.c
adt7462.c
adt7470.c
adt7475.c minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
aht10.c hwmon: (aht10) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
amc6821.c hwmon: (amc6821) Add support for pwm1_mode attribute 2024-07-08 07:52:36 -07:00
applesmc.c
aquacomputer_d5next.c
as370-hwmon.c
asb100.c
asc7621.c
aspeed-g6-pwm-tach.c
aspeed-pwm-tacho.c
asus-ec-sensors.c hwmon: (asus-ec-sensors) add ProArt X670E-CREATOR WIFI 2024-06-10 09:13:56 -07:00
asus_atk0110.c hwmon: add missing MODULE_DESCRIPTION() macros 2024-06-08 16:07:33 -07:00
asus_rog_ryujin.c
asus_wmi_sensors.c
atxp1.c
axi-fan-control.c
bt1-pvt.c
bt1-pvt.h
chipcap2.c
coretemp.c
corsair-cpro.c hwmon: add missing MODULE_DESCRIPTION() macros 2024-06-08 16:07:33 -07:00
corsair-psu.c hwmon: corsair-psu: add USB id of HX1200i Series 2023 psu 2024-05-29 15:33:18 -07:00
cros_ec_hwmon.c hwmon: (cros_ec) Fix access to restricted __le16 2024-06-07 09:59:58 +00:00
da9052-hwmon.c
da9055-hwmon.c
dell-smm-hwmon.c hwmon updates for v6.11-rc1 2024-07-15 17:39:13 -07:00
dme1737.c hwmon: (dme1737) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
drivetemp.c
ds620.c
ds1621.c hwmon: (ds1621) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
emc6w201.c
emc1403.c
emc2103.c
emc2305.c
f71805f.c
f71882fg.c
f75375s.c hwmon: (f75375s) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
fam15h_power.c
fschmd.c hwmon: (fschmd) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
ftsteutates.c
g760a.c
g762.c hwmon: (g762) Initialize fans after configuring clock 2024-07-09 15:45:48 -07:00
gigabyte_waterforce.c
gl518sm.c
gl520sm.c
gpio-fan.c
gsc-hwmon.c hwmon: (gsc-hwmon) constify read-only struct regmap_bus 2024-07-05 14:37:01 -07:00
gxp-fan-ctrl.c
hih6130.c
hp-wmi-sensors.c
hs3001.c
hwmon-vid.c
hwmon.c hwmon: (core) Make hwmon_class const 2024-06-13 16:44:34 -07:00
i5k_amb.c
i5500_temp.c
ibmaem.c
ibmpex.c
ibmpowernv.c
iio_hwmon.c Char/Misc and other driver changes for 6.11-rc1 2024-07-19 15:55:08 -07:00
ina2xx.c hwmon: (ina2xx) Add device tree support to pass alert polarity 2024-06-12 07:15:09 -07:00
ina209.c
ina238.c hwmon: (ina238) Constify struct regmap_config 2024-07-02 11:30:10 -07:00
ina3221.c
intel-m10-bmc-hwmon.c hwmon: (intel-m10-bmc-hwmon) Fix multiplier for N6000 board power sensor 2024-05-30 09:05:06 -07:00
it87.c
jc42.c hwmon: (jc42) Strengthen detect function 2024-06-30 13:15:26 -07:00
k8temp.c
k10temp.c hwmon: (k10temp) Rename _data variable 2024-06-12 11:40:31 +02:00
Kconfig hwmon updates for v6.11-rc1 2024-07-15 17:39:13 -07:00
lan966x-hwmon.c
lenovo-ec-sensors.c
lineage-pem.c
lm63.c hwmon: (lm63) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
lm70.c hwmon: lm70: simplify with spi_get_device_match_data() 2024-06-08 16:07:32 -07:00
lm73.c
lm75.c hwmon: (lm75) Remove use of i2c_match_id() 2024-06-08 16:07:32 -07:00
lm75.h
lm77.c
lm78.c hwmon: (lm78) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
lm80.c
lm83.c hwmon: (lm83) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
lm85.c hwmon: (lm85) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
lm87.c
lm90.c hwmon: (lm90) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
lm92.c
lm93.c
lm95234.c hwmon: (lm95234) Fix underflows seen when writing limit attributes 2024-07-07 07:48:25 -07:00
lm95241.c
lm95245.c
lochnagar-hwmon.c
ltc2945.c
ltc2947-core.c
ltc2947-i2c.c
ltc2947-spi.c
ltc2947.h
ltc2990.c
ltc2991.c hwmon: (ltc2991) re-order conditions to fix off by one bug 2024-07-04 18:14:50 -07:00
ltc2992.c hwmon: (ltc2992) Fix memory leak in ltc2992_parse_dt() 2024-05-29 15:34:46 -07:00
ltc4151.c
ltc4215.c
ltc4222.c
ltc4245.c
ltc4260.c
ltc4261.c
ltc4282.c
ltq-cputemp.c
Makefile hwmon updates for v6.11-rc1 2024-07-15 17:39:13 -07:00
max127.c
max197.c
max1111.c
max1619.c
max1668.c hwmon: (max1668) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
max6620.c
max6621.c
max6639.c hwmon: (max6639) : Add additional hwmon attributes for fan and pwm 2024-06-14 06:37:06 -07:00
max6650.c
max6697.c hwmon: (max6697) Fix swapped temp{1,8} critical alarms 2024-07-14 11:49:01 -07:00
max16065.c hwmon: (max16065) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
max31722.c
max31730.c
max31760.c
max31790.c
max31827.c hwmon: (pmbus/max31827) Explain why enum chips must not start with 0 2024-06-11 07:25:03 -07:00
mc34vr500.c
mc13783-adc.c
mcp3021.c hwmon: (mcp3021) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
menf21bmc_hwmon.c
mlxreg-fan.c
mr75203.c hwmon: add missing MODULE_DESCRIPTION() macros 2024-06-08 16:07:33 -07:00
nct6683.c hwmon: (nct6683) Display warning when enabling driver for unknown customer 2024-05-29 15:23:54 -07:00
nct6775-core.c hwmon: (nct6775-core) Fix underflows seen when writing limit attributes 2024-07-07 07:48:25 -07:00
nct6775-i2c.c
nct6775-platform.c
nct6775.h hwmon: (nct6775) Let enum kinds start with index 0 2024-06-11 07:25:13 -07:00
nct7802.c
nct7904.c
npcm750-pwm-fan.c
nsa320-hwmon.c
ntc_thermistor.c
nzxt-kraken2.c
nzxt-kraken3.c
nzxt-smart2.c hwmon: (nzxt-smart2) Add support for another version of NZXT RGB & Fan Controller 2024-05-29 15:55:35 -07:00
oxp-sensors.c
pc87360.c
pc87427.c
pcf8591.c
powerz.c
powr1220.c hwmon: (powr1220) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
pt5161l.c
pwm-fan.c
raspberrypi-hwmon.c
sbrmi.c
sbtsi_temp.c
sch56xx-common.c
sch56xx-common.h
sch5627.c
sch5636.c
scmi-hwmon.c
scpi-hwmon.c
sfctemp.c
sht3x.c hwmon: (sht3x) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
sht4x.c
sht15.c
sht21.c
shtc1.c hwmon updates for v6.11-rc1 2024-07-15 17:39:13 -07:00
sis5595.c
sl28cpld-hwmon.c
smpro-hwmon.c
smsc47b397.c
smsc47m1.c
smsc47m192.c
sparx5-temp.c
spd5118.c hwmon: (spd5118) Add support for Renesas/ITD SPD5118 hub controllers 2024-06-18 20:07:42 -07:00
stts751.c
surface_fan.c
sy7636a-hwmon.c
tc74.c
tc654.c
thmc50.c hwmon: (thmc50) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
tmp102.c
tmp103.c
tmp108.c
tmp401.c hwmon: (tmp401) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
tmp421.c hwmon: (tmp421) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
tmp464.c hwmon: (tmp464) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
tmp513.c hwmon: (tmp513) Constify struct regmap_config 2024-07-02 11:31:02 -07:00
tps23861.c hwmon: (tps23861) Constify struct regmap_config 2024-07-02 11:31:30 -07:00
ultra45_env.c
vexpress-hwmon.c
via-cputemp.c
via686a.c
vt1211.c
vt8231.c
w83l785ts.c
w83l786ng.c
w83627ehf.c hwmon: (w83627ehf) Fix underflows seen when writing limit attributes 2024-07-07 07:48:25 -07:00
w83627hf.c
w83773g.c
w83781d.c hwmon: (w83781d) Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
w83791d.c
w83792d.c
w83793.c
w83795.c hwmon: (w83795): Remove use of i2c_match_id() 2024-06-08 16:07:33 -07:00
wm831x-hwmon.c
wm8350-hwmon.c
xgene-hwmon.c