Re: [PATCH v3] net: ethernet: emulex: benet: fix adapter->fw_on_flash truncation warning
From: Ankan Biswas <hidden>
Date: 2025-10-29 07:00:20
Also in:
linux-kernel-mentees, lkml
From: Ankan Biswas <hidden>
Date: 2025-10-29 07:00:20
Also in:
linux-kernel-mentees, lkml
On 10/29/25 7:12 AM, Jakub Kicinski wrote:
On Fri, 24 Oct 2025 23:45:41 +0530 Ankan Biswas wrote:quoted
The benet driver copies both fw_ver (32 bytes) and fw_on_flash (32 bytes) into ethtool_drvinfo->fw_version (32 bytes), leading to a potential string truncation warning when built with W=1. Store fw_on_flash in ethtool_drvinfo->erom_version instead, which some drivers use to report secondary firmware information.You are changing user-visible behavior to silence a W=1 warning. I can't stress enough how bad of an idea this is. Please find a better fix.. or leave this code be.
Hi Jakub, Thanks for the feedback. I felt this would be better than the value appearing truncated to the user. However, yes this is not the ideal fix. Will avoid modifying user-visible behavior. An ideal fix may require a lot more changes, which may not be worth the effort at this point, so I guess it is better to drop this patch. Best Regards, Ankan Biswas