linux/drivers/net
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>
History 2024-07-28 13:41:14 -07:00
..
arcnet net: arcnet: com20020-isa: add missing MODULE_DESCRIPTION() macro 2024-06-19 17:21:12 -07:00
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 net: handle HAS_IOPORT dependencies 2024-04-08 11:56:56 +01:00
fjes net: fjes: correct TRACE_INCLUDE_PATH 2024-05-30 18:28:31 -07:00
hamradio parport: Remove parport_driver.devmodel 2024-07-03 16:44:22 +02:00
hippi net: hippi: Add missing pci_disable_device() in rr_init_one() 2022-09-26 13:22:39 -07:00
hyperv tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
ieee802154 spi: Updates for v6.9 2024-03-13 11:07:37 -07:00
ipa net: ipa: allocate dummy net_device dynamically 2024-04-24 12:00:16 +01:00
ipvlan ipvlan: Dont Use skb->sk in ipvlan_process_v{4,6}_outbound 2024-05-30 12:05:52 +02:00
mctp net: mctp-i2c: invalidate flows immediately on TX errors 2024-07-12 13:37:31 +01:00
mdio net: mdio: mscc-miim: Handle the switch reset 2024-06-21 12:12:42 +01:00
netdevsim net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
pcs net: pcs: xpcs: Add fwnode-based descriptor creation method 2024-07-05 09:35:51 +01:00
phy Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
plip parport: Remove parport_driver.devmodel 2024-07-03 16:44:22 +02:00
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 net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
team net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
thunderbolt net: thunderbolt: Fix TCPv6 GSO checksum calculation 2023-09-15 13:45:05 +01:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-06-27 12:14:11 -07:00
vmxnet3 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-06-06 12:06:56 -07:00
vxlan vxlan: Pull inner IP header in vxlan_xmit_one(). 2024-06-21 17:34:15 -07:00
wan net: wan: fsl_qmc_hdlc: Convert to platform remove callback returning void 2024-04-10 19:35:50 -07:00
wireguard wireguard: send: annotate intentional data race in checking empty queue 2024-07-05 17:21:10 -07:00
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 net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
amt.c net: amt: Remove generic .ndo_get_stats64 2024-03-11 15:16:13 -07:00
bareudp.c ip_tunnel: convert __be16 tunnel flags to bitmaps 2024-04-01 10:49:28 +01:00
dummy.c net/dummy: Move stats allocation to core 2024-02-21 11:20:56 +00:00
eql.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
geneve.c geneve: Fix incorrect inner network header offset when innerprotoinherit is set 2024-06-10 13:18:08 +01:00
gtp.c gtp: identify tunnel via GTP device + GTP version + TEID + family 2024-05-07 01:36:02 +02:00
ifb.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
Kconfig net: netdevsim: select PAGE_POOL in Kconfig 2024-04-17 18:25:30 -07:00
LICENSE.SRC Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
loopback.c net: loopback: Do not allocate lstats explicitly 2024-04-30 19:01:58 -07:00
macsec.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
macvlan.c net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
macvtap.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
Makefile net: Always descend into dsa/ folder with CONFIG_NET_DSA enabled 2024-05-20 11:04:29 +01:00
mdio.c net: mdio: Correct function name mdio45_links_ok() in comment 2021-03-29 13:42:44 -07:00
mhi_net.c net: mhi: Remove redundant initialization owner in mhi_net_driver 2023-08-10 17:29:42 -07:00
mii.c net: mii: make mii_ethtool_gset() return void 2021-08-19 13:06:53 +01:00
net_failover.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
netconsole.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-07-15 13:19:17 -07:00
netkit.c netkit: Fix pkt_type override upon netkit pass verdict 2024-05-25 10:48:57 -07:00
nlmon.c net: nlmon: Simplify nlmon_get_stats64 2024-03-04 10:18:02 +00:00
ntb_netdev.c net: ntb_netdev: Move ntb_netdev_rx_handler() to call netif_rx() from __netif_rx() 2024-07-02 18:56:46 -07:00
pfcp.c pfcp: avoid copy warning by simplifing code 2024-04-08 11:46:41 +01:00
rionet.c driver core: class: remove struct class_interface * from callbacks 2023-04-03 21:42:52 +02:00
sb1000.c net: dev: Makes sure netif_rx() can be invoked in any context. 2022-02-14 13:38:35 +00:00
Space.c net: appletalk: remove cops support 2023-10-04 11:49:20 -07:00
sungem_phy.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
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 Revert "net: mirror skb frag ref/unref helpers" 2024-05-03 16:05:53 -07:00
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 net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
xen-netfront.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00