lkml.org 
[lkml]   [2023]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] sfc: use IS_ENABLED() checks for CONFIG_SFC_SRIOV
From
Date
On 17/02/2023 09:56, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> One local variable has become unused after a recent change:
>
> drivers/net/ethernet/sfc/ef100_nic.c: In function 'ef100_probe_netdev_pf':
> drivers/net/ethernet/sfc/ef100_nic.c:1155:21: error: unused variable 'net_dev' [-Werror=unused-variable]
> struct net_device *net_dev = efx->net_dev;
> ^~~~~~~
>
> The variable is still used in an #ifdef. Replace the #ifdef with
> an if(IS_ENABLED()) check that lets the compiler see where it is
> used, rather than adding another #ifdef.

So we've had Leon telling us[1] to use __maybe_unused, and you're
saying to use IS_ENABLED() instead. Which is right?
(And does it make any difference to build time? I'm assuming the
compiler is smart enough that this change doesn't affect text
size...?)
-ed

[1]: https://lore.kernel.org/netdev/cac3fa89-50a3-6de0-796c-a215400f3710@intel.com/T/#md2ecc82f18c200391dc6581ff68ff08eee9a65cf

\
 
 \ /
  Last update: 2023-03-27 00:27    [W:0.097 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site