Skip to contentSkip to conversation

ARCnet: remove outdated drivers and information and unused code; small cleanups and documentation improvements

PATCH Applied Ethan Nelson-Moore 2 participants 9 messages May 21 – May 23

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

v2 cover ARCnet: remove outdated drivers and information and unused code; small cleanups and documentation improvements

v2 of this series is identical to v1, but with the patches reordered to resolve a transient build failure. The description from v1 follows.

This patch series mainly removes the ISA and PCMCIA ARCnet drivers and documentation for them and hardware they supported. While ARCnet is still used in industrial environments, and cards are still manufactured, it is unlikely anyone is still using it with ISA and PCMCIA cards. Removing these drivers reduces future maintenance burden.

While updating the ARCnet documentation to remove references to the removed drivers, I noticed that it contained thousands of lines of outdated and irrelevant information (much of it so outdated that it would not even work on modern kernels). I took the opportunity to remove this information and improve the writing style slightly.

I noticed that the BUS_ALIGN macro was always defined to 1, which meant that the custom arcnet_in/out/read/write* I/O macros were unnecessary. I expanded and removed them to make the code more straightforwards.

I also corrected some typos and comments.

The first three patches are the same as those I posted on February 8th:
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/
https://lore.kernel.org/all/[email protected]/

Ethan Nelson-Moore (7):
net: arcnet: com20020: remove misleading references to multicast
net: arcnet: fix typos in comments
net: arcnet: remove ISA and PCMCIA support; modernize documentation
net: arcnet: remove code depending on nonexistent config option
net: arcnet: expand unnecessary I/O abstraction macros
docs: net: arcnet: remove outdated/irrelevant information; improve
style
net: arcnet: com20020-pci: avoid -Wformat-truncation warning

 .../admin-guide/kernel-parameters.txt         |   14 -
 Documentation/networking/arcnet-hardware.rst  | 2979 +----------------
 Documentation/networking/arcnet.rst           |  235 +-
 arch/mips/configs/mtx1_defconfig              |    4 -
 drivers/net/arcnet/Kconfig                    |   52 +-
 drivers/net/arcnet/Makefile                   |    5 -
 drivers/net/arcnet/arc-rimi.c                 |  386 ---
 drivers/net/arcnet/arcdevice.h                |   36 +-
 drivers/net/arcnet/com20020-isa.c             |  230 --
 drivers/net/arcnet/com20020-pci.c             |    9 +-
 drivers/net/arcnet/com20020.c                 |  107 +-
 drivers/net/arcnet/com20020.h                 |    6 +-
 drivers/net/arcnet/com20020_cs.c              |  330 --
 drivers/net/arcnet/com90io.c                  |  427 ---
 drivers/net/arcnet/com90xx.c                  |  716 ----
 drivers/net/arcnet/rfc1201.c                  |    2 +-
 16 files changed, 125 insertions(+), 5413 deletions(-)
 delete mode 100644 drivers/net/arcnet/arc-rimi.c
 delete mode 100644 drivers/net/arcnet/com20020-isa.c
 delete mode 100644 drivers/net/arcnet/com20020_cs.c
 delete mode 100644 drivers/net/arcnet/com90io.c
 delete mode 100644 drivers/net/arcnet/com90xx.c
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/7 net: arcnet: com20020: remove misleading references to multicast

ARCnet does not support multicast, only unicast and broadcast. In spite of this, the com20020 driver contains several references to multicast in a comment and a function name, including a FIXME that it should be implemented. Adjust the comment to make the lack of multicast support clear and rename com20020_set_mc_list to com20020_set_rx_mode.

---
 drivers/net/arcnet/com20020.c | 14 ++++----------
 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/net/arcnet/com20020.c +4 -10
index b8526805ffac..f2fa26626a06 100644
@@ -56,7 +56,7 @@ static void com20020_copy_to_card(struct net_device *dev, int bufnum,
 				  int offset, void *buf, int count);
 static void com20020_copy_from_card(struct net_device *dev, int bufnum,
 				    int offset, void *buf, int count);
-static void com20020_set_mc_list(struct net_device *dev);
+static void com20020_set_rx_mode(struct net_device *dev);
 static void com20020_close(struct net_device *);
 
 static void com20020_copy_from_card(struct net_device *dev, int bufnum,
@@ -194,7 +194,7 @@ const struct net_device_ops com20020_netdev_ops = {
 	.ndo_start_xmit = arcnet_send_packet,
 	.ndo_tx_timeout = arcnet_timeout,
 	.ndo_set_mac_address = com20020_set_hwaddr,
-	.ndo_set_rx_mode = com20020_set_mc_list,
+	.ndo_set_rx_mode = com20020_set_rx_mode,
 };
 
 /* Set up the struct net_device associated with this card.  Called after
@@ -362,14 +362,8 @@ static void com20020_close(struct net_device *dev)
 	arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG);
 }
 
-/* Set or clear the multicast filter for this adaptor.
- * num_addrs == -1    Promiscuous mode, receive all packets
- * num_addrs == 0       Normal mode, clear multicast list
- * num_addrs > 0        Multicast mode, receive normal and MC packets, and do
- *                      best-effort filtering.
- *      FIXME - do multicast stuff, not just promiscuous.
- */
-static void com20020_set_mc_list(struct net_device *dev)
+/* ARCnet does not support multicast, only unicast and broadcast */
+static void com20020_set_rx_mode(struct net_device *dev)
 {
 	struct arcnet_local *lp = netdev_priv(dev);
 	int ioaddr = dev->base_addr;
Signature · 1 line
2.43.0
#2 lore raw

PATCH v2 2/7 net: arcnet: fix typos in comments

In reply to Ethan Nelson-Moore

The ARCnet code contains quite a few typos in comments. Fix them. Initially noticed by inspection, then augmented using codespell.

---
 drivers/net/arcnet/arc-rimi.c  |  2 +-
 drivers/net/arcnet/arcdevice.h | 10 +++++-----
 drivers/net/arcnet/rfc1201.c   |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/arcnet/arc-rimi.c +1 -1
index 53d10a04d1bd..fb3d3565aa9a 100644
@@ -185,7 +185,7 @@ static int __init arcrimi_found(struct net_device *dev)
 	lp->hw.copy_to_card = arcrimi_copy_to_card;
 	lp->hw.copy_from_card = arcrimi_copy_from_card;
 
-	/* re-reserve the memory region - arcrimi_probe() alloced this reqion
+	/* re-reserve the memory region - arcrimi_probe() allocated this reqion
 	 * but didn't know the real size.  Free that region and then re-get
 	 * with the correct size.  There is a VERY slim chance this could
 	 * fail.
drivers/net/arcnet/arcdevice.h +5 -5
index bee60b377d7c..f1947342d67f 100644
@@ -137,7 +137,7 @@ do {									\
 #define TXACKflag       0x02	/* transmitted msg. ackd */
 #define RECONflag       0x04	/* network reconfigured */
 #define TESTflag        0x08	/* test flag */
-#define EXCNAKflag      0x08    /* excesive nak flag */
+#define EXCNAKflag      0x08    /* excessive nak flag */
 #define RESETflag       0x10	/* power-on-reset */
 #define RES1flag        0x20	/* reserved - usually set by jumper */
 #define RES2flag        0x40	/* reserved - usually set by jumper */
@@ -166,7 +166,7 @@ do {									\
 #define RESETclear      0x08	/* power-on-reset */
 #define CONFIGclear     0x10	/* system reconfigured */
 
-#define EXCNAKclear     0x0E    /* Clear and acknowledge the excive nak bit */
+#define EXCNAKclear     0x0E    /* Clear and acknowledge the excessive nak bit */
 
 /* flags for "load test flags" command */
 #define TESTload        0x08	/* test flag (diagnostic) */
@@ -194,7 +194,7 @@ do {									\
 struct ArcProto {
 	char suffix;		/* a for RFC1201, e for ether-encap, etc. */
 	int mtu;		/* largest possible packet */
-	int is_ip;              /* This is a ip plugin - not a raw thing */
+	int is_ip;              /* This is an ip plugin - not a raw thing */
 
 	void (*rx)(struct net_device *dev, int bufnum,
 		   struct archdr *pkthdr, int length);
@@ -257,7 +257,7 @@ struct arcnet_local {
 	char *card_name;	/* card ident string */
 	int card_flags;		/* special card features */
 
-	/* On preemtive and SMB a lock is needed */
+	/* On preemptive and SMP a lock is needed */
 	spinlock_t lock;
 
 	struct led_trigger *tx_led_trig;
@@ -299,7 +299,7 @@ struct arcnet_local {
 	int num_recons;		/* number of RECONs between first and last. */
 	int network_down;	/* do we think the network is down? */
 
-	int excnak_pending;    /* We just got an excesive nak interrupt */
+	int excnak_pending;    /* We just got an excessive nak interrupt */
 
 	/* RESET flag handling */
 	int reset_in_progress;
drivers/net/arcnet/rfc1201.c +1 -1
index 0edf35d971c5..f2ec58d06fc3 100644
@@ -235,7 +235,7 @@ static void rx(struct net_device *dev, int bufnum,
 		skb->protocol = type_trans(skb, dev);
 		netif_rx(skb);
 	} else {		/* split packet */
-		/* NOTE: MSDOS ARP packet correction should only need to
+		/* NOTE: MS-DOS ARP packet correction should only need to
 		 * apply to unsplit packets, since ARP packets are so short.
 		 *
 		 * My interpretation of the RFC1201 document is that if a
Signature · 1 line
2.43.0
#3 lore raw

PATCH v2 3/7 net: arcnet: remove ISA and PCMCIA support; modernize documentation

In reply to Ethan Nelson-Moore

While ARCnet is still used in industrial environments, and cards are still manufactured, it is unlikely anyone is still using it with ISA and PCMCIA cards. Reduce future maintenance burden by removing all ISA and PCMCIA ARCnet drivers and documentation related to them. Update instructions for loading modules and passing parameters to work on modern kernels and with the com20020_pci driver. Also take the opportunity to document the rest of the module parameters, correct a file path in Documentation/networking/arcnet.rst, and change a reference to /etc/rc.inet1, which no longer exists, to refer to ifconfig.

---
 .../admin-guide/kernel-parameters.txt         |   14 -
 Documentation/networking/arcnet-hardware.rst  | 2943 +----------------
 Documentation/networking/arcnet.rst           |  166 +-
 arch/mips/configs/mtx1_defconfig              |    4 -
 drivers/net/arcnet/Kconfig                    |   52 +-
 drivers/net/arcnet/Makefile                   |    5 -
 drivers/net/arcnet/arc-rimi.c                 |  386 ---
 drivers/net/arcnet/com20020-isa.c             |  230 --
 drivers/net/arcnet/com20020.c                 |    4 +-
 drivers/net/arcnet/com20020_cs.c              |  330 --
 drivers/net/arcnet/com90io.c                  |  427 ---
 drivers/net/arcnet/com90xx.c                  |  716 ----
 12 files changed, 37 insertions(+), 5240 deletions(-)
 delete mode 100644 drivers/net/arcnet/arc-rimi.c
 delete mode 100644 drivers/net/arcnet/com20020-isa.c
 delete mode 100644 drivers/net/arcnet/com20020_cs.c
 delete mode 100644 drivers/net/arcnet/com90io.c
 delete mode 100644 drivers/net/arcnet/com90xx.c
Documentation/admin-guide/kernel-parameters.txt +0 -14
index 7834ee927310..063c11ca33e5 100644
@@ -558,9 +558,6 @@ Kernel parameters
 			1 -- enable.
 			Default value is set via kernel config option.
 
-	arcrimi=	[HW,NET] ARCnet - "RIM I" (entirely mem-mapped) cards
-			Format: <io>,<irq>,<nodeID>
-
 	arm64.no32bit_el0 [ARM64] Unconditionally disable the execution of
 			32 bit applications.
 
@@ -911,17 +908,6 @@ Kernel parameters
 			Sets the size of memory pool for coherent, atomic dma
 			allocations, by default set to 256K.
 
-	com20020=	[HW,NET] ARCnet - COM20020 chipset
-			Format:
-			<io>[,<irq>[,<nodeID>[,<backplane>[,<ckp>[,<timeout>]]]]]
-
-	com90io=	[HW,NET] ARCnet - COM90xx chipset (IO-mapped buffers)
-			Format: <io>[,<irq>]
-
-	com90xx=	[HW,NET]
-			ARCnet - COM90xx chipset (memory-mapped buffers)
-			Format: <io>[,<irq>[,<memstart>]]
-
 	condev=		[HW,S390] console device
 	conmode=
 
Documentation/networking/arcnet-hardware.rst +10 -2933

2,958 lines not on this page · raw message

Documentation/networking/arcnet.rst +24 -142

16 lines not on this page · raw message

arch/mips/configs/mtx1_defconfig +0 -4
index 3629afbe5d75..1d223be90993 100644

Lines of this file are not shown. View the raw message.

drivers/net/arcnet/Kconfig +2 -50

52 lines not on this page · raw message

drivers/net/arcnet/Makefile +0 -5
index 53525e8ea130..e5df03a08b0e 100644

Lines of this file are not shown. View the raw message.

drivers/net/arcnet/arc-rimi.c deleted +0 -386

386 lines not on this page · raw message

drivers/net/arcnet/com20020-isa.c deleted +0 -230

230 lines not on this page · raw message

drivers/net/arcnet/com20020.c +1 -3
index f2fa26626a06..adcf69cb9d50 100644

Lines of this file are not shown. View the raw message.

drivers/net/arcnet/com20020_cs.c deleted +0 -330

330 lines not on this page · raw message

drivers/net/arcnet/com90io.c deleted +0 -427

427 lines not on this page · raw message

drivers/net/arcnet/com90xx.c deleted +0 -716

716 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.43.0

Part of the diff is not shown here. View the raw message.

#4 lore raw

PATCH v2 4/7 net: arcnet: remove code depending on nonexistent config option

In reply to Ethan Nelson-Moore

The CONFIG_SA1100_CT6001 option has never existed in the kernel. Remove code in arcdevice.h referring to it. This allows the arcnet_(in|out)(s|)b macros to be simplified by removing the BUS_ALIGN macro.

---
 drivers/net/arcnet/arcdevice.h | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)
drivers/net/arcnet/arcdevice.h +5 -13
index f1947342d67f..c870b8e21d44 100644
@@ -374,24 +374,16 @@ static inline void arcnet_set_addr(struct net_device *dev, u8 addr)
 
 /* I/O equivalents */
 
-#ifdef CONFIG_SA1100_CT6001
-#define BUS_ALIGN  2  /* 8 bit device on a 16 bit bus - needs padding */
-#else
-#define BUS_ALIGN  1
-#endif
-
-/* addr and offset allow register like names to define the actual IO  address.
- * A configuration option multiplies the offset for alignment.
- */
+/* addr and offset allow register like names to define the actual IO address */
 #define arcnet_inb(addr, offset)					\
-	inb((addr) + BUS_ALIGN * (offset))
+	inb((addr) + (offset))
 #define arcnet_outb(value, addr, offset)				\
-	outb(value, (addr) + BUS_ALIGN * (offset))
+	outb(value, (addr) + (offset))
 
 #define arcnet_insb(addr, offset, buffer, count)			\
-	insb((addr) + BUS_ALIGN * (offset), buffer, count)
+	insb((addr) + (offset), buffer, count)
 #define arcnet_outsb(addr, offset, buffer, count)			\
-	outsb((addr) + BUS_ALIGN * (offset), buffer, count)
+	outsb((addr) + (offset), buffer, count)
 
 #define arcnet_readb(addr, offset)					\
 	readb((addr) + (offset))
Signature · 1 line
2.43.0
#5 lore raw

PATCH v2 5/7 net: arcnet: expand unnecessary I/O abstraction macros

In reply to Ethan Nelson-Moore

Now that the BUS_ALIGN variable has been removed, the arcnet_in/out/read/write* macros behave identically to the functions they wrap. Expand them and remove their definitions to make the code easier to maintain.

---
 drivers/net/arcnet/arcdevice.h    | 18 -------
 drivers/net/arcnet/com20020-pci.c |  6 +--
 drivers/net/arcnet/com20020.c     | 89 +++++++++++++++----------------
 drivers/net/arcnet/com20020.h     |  4 +-
 4 files changed, 49 insertions(+), 68 deletions(-)
drivers/net/arcnet/arcdevice.h +0 -18
index c870b8e21d44..a7c217359679 100644
@@ -372,23 +372,5 @@ static inline void arcnet_set_addr(struct net_device *dev, u8 addr)
 	dev_addr_set(dev, &addr);
 }
 
-/* I/O equivalents */
-
-/* addr and offset allow register like names to define the actual IO address */
-#define arcnet_inb(addr, offset)					\
-	inb((addr) + (offset))
-#define arcnet_outb(value, addr, offset)				\
-	outb(value, (addr) + (offset))
-
-#define arcnet_insb(addr, offset, buffer, count)			\
-	insb((addr) + (offset), buffer, count)
-#define arcnet_outsb(addr, offset, buffer, count)			\
-	outsb((addr) + (offset), buffer, count)
-
-#define arcnet_readb(addr, offset)					\
-	readb((addr) + (offset))
-#define arcnet_writeb(value, addr, offset)				\
-	writeb(value, (addr) + (offset))
-
 #endif				/* __KERNEL__ */
 #endif				/* _LINUX_ARCDEVICE_H */
drivers/net/arcnet/com20020-pci.c +3 -3
index dbadda08dce2..98f68cb13a52 100644
@@ -195,8 +195,8 @@ static int com20020pci_probe(struct pci_dev *pdev,
 		 * ARCNET controller needs
 		 * this access to detect bustype
 		 */
-		arcnet_outb(0x00, ioaddr, COM20020_REG_W_COMMAND);
-		arcnet_inb(ioaddr, COM20020_REG_R_DIAGSTAT);
+		outb(0x00, ioaddr + COM20020_REG_W_COMMAND);
+		inb(ioaddr + COM20020_REG_R_DIAGSTAT);
 
 		SET_NETDEV_DEV(dev, &pdev->dev);
 		dev->base_addr = ioaddr;
@@ -224,7 +224,7 @@ static int com20020pci_probe(struct pci_dev *pdev,
 			snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i);
 		}
 
-		if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) {
+		if (inb(ioaddr + COM20020_REG_R_STATUS) == 0xFF) {
 			pr_err("IO address %Xh is empty!\n", ioaddr);
 			ret = -EIO;
 			goto err_free_arcdev;
drivers/net/arcnet/com20020.c +44 -45

240 lines not on this page · raw message

drivers/net/arcnet/com20020.h +2 -2
index 0bcc5d0a6903..e7aac0e81a13 100644
@@ -123,9 +123,9 @@ static inline void com20020_set_subaddress(struct arcnet_local *lp,
 {
 	if (val < 4) {
 		lp->config = (lp->config & ~0x03) | val;
-		arcnet_outb(lp->config, ioaddr, COM20020_REG_W_CONFIG);
+		outb(lp->config, ioaddr + COM20020_REG_W_CONFIG);
 	} else {
-		arcnet_outb(val, ioaddr, COM20020_REG_W_SUBADR);
+		outb(val, ioaddr + COM20020_REG_W_SUBADR);
 	}
 }
 
Signature · 1 line
2.43.0
#6 lore raw

PATCH v2 6/7 docs: net: arcnet: remove outdated/irrelevant information; improve style

In reply to Ethan Nelson-Moore

The ARCnet documentation contains a lot of outdated and irrelevant information (such as changes in decades-old driver versions and messages from a former maintainer) and has some writing style issues. Remove this unnecessary information and improve the writing style. Also remove links to pages that no longer exist.

---
 Documentation/networking/arcnet-hardware.rst | 36 +++++-----
 Documentation/networking/arcnet.rst          | 69 +++-----------------
 2 files changed, 26 insertions(+), 79 deletions(-)
Documentation/networking/arcnet-hardware.rst +17 -19
index 17450e8e6ca7..37c016cee353 100644
@@ -8,10 +8,8 @@ ARCnet Hardware
 
 .. note::
 
-   1) This file is a supplement to arcnet.rst.  Please read that for general
-      driver configuration help.
-   2) This file is no longer Linux-specific.  It should probably be moved out
-      of the kernel sources.  Ideas?
+   This file is a supplement to arcnet.rst.  Please read that for general
+   driver configuration help.
 
 Because so many people (myself included) seem to have obtained ARCnet cards
 without manuals, this file contains a quick introduction to ARCnet hardware
@@ -134,13 +132,11 @@ And now to the cabling.  What you can connect together:
    network.
 
 2. A card to a passive hub.  Remember that all unused connectors on the hub
-   must be properly terminated with 93 Ohm (or something else if you don't
-   have the right ones) terminators.
+   must be properly terminated with 93 Ohm terminators (or something else if you
+   don't have the right ones), although the network may work without
+   terminators.
 
-	(Avery's note: oops, I didn't know that.  Mine (TV cable) works
-	anyway, though.)
-
-3. A card to an active hub.  Here is no need to terminate the unused
+3. A card to an active hub.  Here there is no need to terminate the unused
    connectors except some kind of aesthetic feeling.  But, there may not be
    more than eleven active hubs between any two computers.  That of course
    doesn't limit the number of active hubs on the network.
@@ -150,7 +146,7 @@ And now to the cabling.  What you can connect together:
 5. An active hub to passive hub.
 
 Remember that you cannot connect two passive hubs together.  The power loss
-implied by such a connection is too high for the net to operate reliably.
+implied by such a connection is too high for the network to operate reliably.
 
 An example of a typical ARCnet network::
 
@@ -163,8 +159,8 @@ An example of a typical ARCnet network::
 		    |
 		    S
 
-The BUS topology is very similar to the one used by Ethernet.  The only
-difference is in cable and terminators: they should be 93 Ohm.  Ethernet
+The BUS topology is very similar to the one used by 10BASE2 Ethernet.  The only
+difference is in cable and terminators: they should be 93 Ohm. 10BASE2 Ethernet
 uses 50 Ohm impedance. You use T connectors to put the computers on a single
 line of cable, the bus. You have to put terminators at both ends of the
 cable. A typical BUS ARCnet network looks like::
@@ -177,7 +173,7 @@ cable. A typical BUS ARCnet network looks like::
   T - T connector
 
 But that is not all! The two types can be connected together.  According to
-the official documentation the only way of connecting them is using an active
+the official documentation, the only way of connecting them is using an active
 hub::
 
 	 A------T------T------TR
@@ -186,7 +182,7 @@ hub::
 	 |
 	 S
 
-The official docs also state that you can use STAR cards at the ends of
+The official docs also state that you can use STAR cards at the ends of a
 BUS network in place of a BUS card and a terminator::
 
      S------T------T------S
@@ -211,7 +207,7 @@ example::
 	   |   |      S------T----H---S   |
 	   S   S             B    R       S
 
-A basically different cabling scheme is used with Twisted Pair cabling. Each
+A completely different cabling scheme is used with Twisted Pair cabling. Each
 of the TP cards has two RJ (phone-cord style) connectors.  The cards are
 then daisy-chained together using a cable connecting every two neighboring
 cards.  The ends are terminated with RJ 93 Ohm terminators which plug into
@@ -292,11 +288,13 @@ Setting the Jumpers
     Make sure you set ETS1 and ETS2 to the SAME VALUE for all cards on your
     network.
 
-Also, on many cards (not mine, though) there are red and green LED's.
-Vojtech Pavlik <[email protected]> tells me this is what they mean:
+LED Indicators
+==============
+
+Many cards have red and green LEDs, which have the following meanings:
 
 	=============== =============== =====================================
-	GREEN           RED             Status
+	Green           Red             Status
 	=============== =============== =====================================
 	OFF             OFF             Power off
 	OFF             Short flashes   Cabling problems (broken cable or not
Documentation/networking/arcnet.rst +9 -60

105 lines not on this page · raw message

Signature · 1 line
2.43.0
#7 lore raw

PATCH v2 7/7 net: arcnet: com20020-pci: avoid -Wformat-truncation warning

In reply to Ethan Nelson-Moore

When compiling the com20020-pci driver with W=1, I received the following warning:

drivers/net/arcnet/com20020-pci.c:224:71: warning: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size between 10 and 11 [-Wformat-truncation=]
224 | snprintf(dev->name, sizeof(dev->name), "arc%d-%d", dev->dev_id, i);

In reality, this does not represent a problem, because i is bounded by the .devcount field in struct com20020_pci_card_info, which is statically defined for each card and very small. Quiet the invalid warning by changing the type of i and the .devcount field to be narrower.

---
 drivers/net/arcnet/com20020-pci.c | 3 ++-
 drivers/net/arcnet/com20020.h     | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/arcnet/com20020-pci.c +2 -1
index 98f68cb13a52..f6b5371fcdcf 100644
@@ -127,7 +127,8 @@ static int com20020pci_probe(struct pci_dev *pdev,
 	struct net_device *dev;
 	struct arcnet_local *lp;
 	struct com20020_priv *priv;
-	int i, ioaddr, ret;
+	int ioaddr, ret;
+	u8 i;
 	struct resource *r;
 
 	ret = 0;
drivers/net/arcnet/com20020.h +1 -1
index e7aac0e81a13..68f49fdc2c28 100644
@@ -50,7 +50,7 @@ struct com20020_pci_channel_map {
 
 struct com20020_pci_card_info {
 	const char *name;
-	int devcount;
+	u8 devcount;
 
 	struct com20020_pci_channel_map chan_map_tbl[PLX_PCI_MAX_CARDS];
 	struct com20020_pci_channel_map misc_map;
Signature · 1 line
2.43.0
#8 lore raw
In reply to Ethan Nelson-Moore
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 10 lines · On Wed, 20 May 2026 17:16:12 -0700 you wrote:

v2 of this series is identical to v1, but with the patches reordered to resolve a transient build failure. The description from v1 follows.

This patch series mainly removes the ISA and PCMCIA ARCnet drivers and documentation for them and hardware they supported. While ARCnet is still used in industrial environments, and cards are still manufactured, it is unlikely anyone is still using it with ISA and PCMCIA cards. Removing these drivers reduces future maintenance burden.

[...]

Here is the summary with links:
- [v2,1/7] net: arcnet: com20020: remove misleading references to multicast

    https://git.kernel.org/netdev/net-next/c/ced9c8cf5768
  - [v2,2/7] net: arcnet: fix typos in comments
    https://git.kernel.org/netdev/net-next/c/5bc0c090bcad
  - [v2,3/7] net: arcnet: remove ISA and PCMCIA support; modernize documentation
    https://git.kernel.org/netdev/net-next/c/910394c74c5a
  - [v2,4/7] net: arcnet: remove code depending on nonexistent config option
    https://git.kernel.org/netdev/net-next/c/c1125f6d4843
  - [v2,5/7] net: arcnet: expand unnecessary I/O abstraction macros
    https://git.kernel.org/netdev/net-next/c/e859db8ac490
  - [v2,6/7] docs: net: arcnet: remove outdated/irrelevant information; improve style
    https://git.kernel.org/netdev/net-next/c/19d554d3296c
  - [v2,7/7] net: arcnet: com20020-pci: avoid -Wformat-truncation warning
    https://git.kernel.org/netdev/net-next/c/eb8ffe14a554

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html