diff options
| author | Ethan Nelson-Moore <enelsonmoore@gmail.com> | 2026-05-21 03:16:19 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-05-23 03:20:57 +0300 |
| commit | eb8ffe14a554808eb68cf050ba5343dbbe15bb54 (patch) | |
| tree | 877f9d71a5701d81a8f093b75952b0ac861eeead /include | |
| parent | 19d554d3296cafdcd95000b166370cdf60c6ea73 (diff) | |
| download | linux-eb8ffe14a554808eb68cf050ba5343dbbe15bb54.tar.xz | |
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>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
