linux/drivers/net/ethernet
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
..
3com net: annotate data-races around dev->if_port 2024-05-08 18:51:30 -07:00
8390 net: ethernet: 8390: ne2k-pci: remove unused struct 'ne2k_pci_card' 2024-05-28 15:21:12 +02:00
actions
adaptec net: ethernet: starfire: remove unused structs 2024-05-28 15:21:04 +02:00
adi net: ethernet: adi: adin1110: Replace linux/gpio.h by proper one 2024-05-10 18:51:34 -07:00
aeroflex
agere net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
alacritech
allwinner
alteon net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
altera net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
amazon net: ena: Fix redundant device NUMA node override 2024-05-29 19:01:34 -07:00
amd net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
apm net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
apple powerpc/macio: Make remove callback of macio driver void returned 2024-03-07 23:06:19 +11:00
aquantia net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
arc net: ethernet: arc: remove emac_arc driver 2024-06-21 10:07:17 +01:00
asix
atheros pci-v6.10-changes 2024-05-21 10:09:28 -07:00
broadcom A lot of networking people were at a conference last week, busy 2024-07-25 13:32:25 -07:00
brocade bna: adjust 'name' buf size of bna_tcb and bna_ccb structures 2024-07-12 01:56:48 +01:00
cadence net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
calxeda net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
cavium net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
chelsio net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
cirrus net: ethernet: mac89x0: add missing MODULE_DESCRIPTION() macro 2024-06-19 17:22:00 -07:00
cisco net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
cortina net: ethernet: cortina: Implement .set_pauseparam() 2024-06-01 16:07:29 -07:00
davicom
dec
dlink net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
emulex netlink: introduce type-checking attribute iteration 2024-03-29 15:06:02 -07:00
engleder net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
ezchip
faraday net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
freescale Merge branch 'net-make-timestamping-selectable' 2024-07-15 08:02:30 -07:00
fujitsu net: handle HAS_IOPORT dependencies 2024-04-08 11:56:56 +01:00
fungible net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
google gve: Fix an edge case for TSO skb validity check 2024-07-25 07:58:07 -07:00
hisilicon net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
huawei net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
i825xx
ibm ibmvnic: Add tx check to prevent skb leak 2024-06-25 10:43:42 +02:00
intel A lot of networking people were at a conference last week, busy 2024-07-25 13:32:25 -07:00
litex
marvell Revert "net: mvpp2: Improve data types and use min()" 2024-07-15 09:05:58 -07:00
mediatek net: mediatek: Fix potential NULL pointer dereference in dummy net_device handling 2024-07-25 11:24:03 +02:00
mellanox Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
meta eth: fbnic: don't build the driver when skb has more than 21 frags 2024-07-19 16:36:34 +02:00
micrel net: ks8851: Fix potential TX stall after interface reopen 2024-07-11 11:52:29 +02:00
microchip net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
microsoft RDMA v6.11 merge window 2024-07-19 09:51:33 -07:00
moxa
mscc net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
myricom net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
natsemi net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
neterion net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
netronome nfp: flower: validate encapsulation control flags 2024-06-12 17:56:01 -07:00
ni net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
nvidia net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
nxp
oki-semi net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
packetengines
pasemi net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
pensando net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
qlogic Merge branch 'net-make-timestamping-selectable' 2024-07-15 08:02:30 -07:00
qualcomm qca_spi: Make interrupt remembering atomic 2024-06-18 11:38:51 +02:00
rdc
realtek net: move ethtool-related netdev state into its own struct 2024-06-28 18:53:17 -07:00
renesas Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
rocker net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
samsung net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
seeq
sfc Merge branch 'net-make-timestamping-selectable' 2024-07-15 08:02:30 -07:00
sgi
silan
sis net: annotate data-races around dev->if_port 2024-05-08 18:51:30 -07:00
smsc net: smc9194: add missing MODULE_DESCRIPTION() macro 2024-06-19 17:22:33 -07:00
socionext
stmicro minmax: add a few more MIN_T/MAX_T users 2024-07-28 13:41:14 -07:00
sun Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-05-14 10:53:19 -07:00
sunplus
synopsys net: dwc-xlgmac: fix missing MODULE_DESCRIPTION() warning 2024-06-17 18:05:38 -07:00
tehuti net: tn40xx: add per queue netdev-genl stats support 2024-07-09 13:26:57 +02:00
ti Merge branch 'net-make-timestamping-selectable' 2024-07-15 08:02:30 -07:00
toshiba Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-02-29 14:24:56 -08:00
tundra
vertexcom
via net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
wangxun Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-07-04 14:16:11 -07:00
wiznet
xilinx net: xilinx: axienet: Enable multicast by default 2024-06-22 11:35:55 +01:00
xircom net: annotate data-races around dev->if_port 2024-05-08 18:51:30 -07:00
xscale net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
dnet.c
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
jme.h
Kconfig eth: fbnic: Add scaffolding for Meta's NIC driver 2024-07-15 12:50:42 -07:00
korina.c
lantiq_etop.c net: ethernet: lantiq_etop: remove redundant device name setup 2024-07-15 07:02:22 -07:00
lantiq_xrx200.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
Makefile eth: fbnic: Add scaffolding for Meta's NIC driver 2024-07-15 12:50:42 -07:00