linux/drivers/net/arcnet
Ethan Nelson-Moore eb8ffe14a5 net: arcnet: com20020-pci: avoid -Wformat-truncation warning
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.

Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Link: https://patch.msgid.link/20260521001631.45434-8-enelsonmoore@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-05-22 17:20:57 -07:00
..
arc-rawmode.c net: fill in MODULE_DESCRIPTION()s for missing arcnet 2024-02-15 08:03:46 -08:00
arcdevice.h net: arcnet: expand unnecessary I/O abstraction macros 2026-05-22 17:20:57 -07:00
arcnet.c treewide, timers: Rename from_timer() to timer_container_of() 2025-06-08 09:07:37 +02:00
capmode.c net: fill in MODULE_DESCRIPTION()s for missing arcnet 2024-02-15 08:03:46 -08:00
com9026.h
com20020-pci.c net: arcnet: com20020-pci: avoid -Wformat-truncation warning 2026-05-22 17:20:57 -07:00
com20020.c net: arcnet: expand unnecessary I/O abstraction macros 2026-05-22 17:20:57 -07:00
com20020.h net: arcnet: com20020-pci: avoid -Wformat-truncation warning 2026-05-22 17:20:57 -07:00
Kconfig net: arcnet: remove ISA and PCMCIA support; modernize documentation 2026-05-22 17:20:56 -07:00
Makefile net: arcnet: remove ISA and PCMCIA support; modernize documentation 2026-05-22 17:20:56 -07:00
rfc1051.c net: fill in MODULE_DESCRIPTION()s for missing arcnet 2024-02-15 08:03:46 -08:00
rfc1201.c net: arcnet: fix typos in comments 2026-05-22 17:20:56 -07:00