Re: [PATCH net-next v2] net: tulip: avoid unused variable warning
From: Simon Horman <horms@kernel.org>
Date: 2025-03-13 10:55:14
From: Simon Horman <horms@kernel.org>
Date: 2025-03-13 10:55:14
On Thu, Mar 13, 2025 at 11:47:42AM +0100, Simon Horman wrote:
There is an effort to achieve W=1 kernel builds without warnings. As part of that effort Helge Deller highlighted the following warnings in the tulip driver when compiling with W=1 and CONFIG_TULIP_MWI=n: .../tulip_core.c: In function ‘tulip_init_one’: .../tulip_core.c:1309:22: warning: variable ‘force_csr0’ set but not used This patch addresses that problem using IS_ENABLED(). This approach has the added benefit of reducing conditionally compiled code. And thus increasing compile coverage. E.g. for allmodconfig builds which enable CONFIG_TULIP_MWI. Compile tested only. No run-time effect intended. -- Acked-by: Helge Deller <deller@gmx.de> Signed-off-by: Simon Horman <horms@kernel.org> v2: Use IS_ENABLED rather than __maybe_unused [Simon Horman] v1: Initial patch [Helge Deller]
Sorry, the tail of the commit message got a bit mangled. I'll post a v3 after waiting for other feedback. -- pw-bot: changes-requested