milos-linux/drivers/net
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
..
arcnet
bonding net: bonding: correctly annotate RCU in bond_should_notify_peers() 2024-07-23 15:13:12 +02:00
caif caif_virtio: use virtio_find_single_vq() for single virtqueue finding 2024-07-17 05:20:56 -04:00
can net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
dsa net: dsa: b53: Limit chip-wide jumbo frame config to CPU ports 2024-07-18 13:09:12 +02:00
ethernet minmax: add a few more MIN_T/MAX_T users 2024-07-28 13:41:14 -07:00
fddi
fjes minmax: make generic MIN() and MAX() macros available everywhere 2024-07-28 15:49:18 -07:00
hamradio
hippi
hyperv
ieee802154
ipa
ipvlan
mctp net: mctp-i2c: invalidate flows immediately on TX errors 2024-07-12 13:37:31 +01:00
mdio
netdevsim net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
pcs
phy Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
plip
ppp ppp: reject claimed-as-LCP but actually malformed packets 2024-07-11 11:00:08 +02:00
pse-pd Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-07-15 13:19:17 -07:00
slip
team
thunderbolt
usb
vmxnet3
vxlan
wan
wireguard
wireless Thermal control fix for 6.11-rc1 2024-07-22 12:13:48 -07:00
wwan Char/Misc and other driver changes for 6.11-rc1 2024-07-19 15:55:08 -07:00
xen-netback
amt.c
bareudp.c
dummy.c
eql.c
geneve.c
gtp.c
ifb.c
Kconfig
LICENSE.SRC
loopback.c
macsec.c
macvlan.c net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
macvtap.c
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-07-15 13:19:17 -07:00
netkit.c
nlmon.c
ntb_netdev.c
pfcp.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c tap: add missing verification for short frame 2024-07-25 08:07:05 -07:00
tun.c tun: add missing verification for short frame 2024-07-25 08:07:05 -07:00
veth.c
virtio_net.c virtio: features, fixes, cleanups 2024-07-19 11:57:55 -07:00
vrf.c sysctl: treewide: constify the ctl_table argument of proc_handlers 2024-07-24 20:59:29 +02:00
vsockmon.c
xen-netfront.c