bnxt_en: hide CONFIG_DETECT_HUNG_TASK specific code
PATCH 1/1 bnxt_en: hide CONFIG_DETECT_HUNG_TASK specific code
From: Arnd Bergmann <[email protected]>
The CONFIG_DEFAULT_HUNG_TASK_TIMEOUT setting is only available when the hung task detection is enabled, otherwise the code now produces a build failure:
drivers/net/ethernet/broadcom/bnxt/bnxt.c:10188:21: error: use of undeclared identifier 'CONFIG_DEFAULT_HUNG_TASK_TIMEOUT'
10188 | max_tmo_secs > CONFIG_DEFAULT_HUNG_TASK_TIMEOUT) {
Enclose this warning logic in an #ifdef to ensure this builds.
---
I'm not really happy with my version either, but could not come up with a better approach. This may need a larger rework.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -0
@@ -10184,11 +10184,13 @@ static int bnxt_hwrm_ver_get(struct bnxt *bp)if (!bp->hwrm_cmd_max_timeout) bp->hwrm_cmd_max_timeout =HWRM_CMD_MAX_TIMEOUT ; max_tmo_secs = bp->hwrm_cmd_max_timeout /1000 ; +#ifdef CONFIG_DETECT_HUNG_TASK if (bp->hwrm_cmd_max_timeout >HWRM_CMD_MAX_TIMEOUT || max_tmo_secs >CONFIG_DEFAULT_HUNG_TASK_TIMEOUT ) {netdev_warn (bp->dev,"Device requests max timeout of %d seconds, may trigger hung task watchdog (kernel default %ds)\n" , max_tmo_secs,CONFIG_DEFAULT_HUNG_TASK_TIMEOUT ); } +#endif if (resp->hwrm_intf_maj_8b >=1 ) { bp->hwrm_max_req_len =le16_to_cpu (resp->max_req_win_len);
Signature · 1 line
2.39.5
Quoted 7 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
CONFIG_DEFAULT_HUNG_TASK_TIMEOUTsetting is only available when the hung task detection is enabled, otherwise the code now produces a build failure:
Quoted 7 lines
drivers/net/ethernet/broadcom/bnxt/bnxt.c:10188:21: error: use of undeclared identifier 'CONFIG_DEFAULT_HUNG_TASK_TIMEOUT'
10188 |max_tmo_secs>CONFIG_DEFAULT_HUNG_TASK_TIMEOUT) {Enclose this warning logic in an #ifdef to ensure this builds.
Fixes 0fcad44a86bd ("bnxt_en: Change FW message timeout warning")Signed-off-by Arnd Bergmann <[email protected]>
I also cannot think of a better way, so this looks fine to me. Thanks.
Jacob Keller
Tested-byQuoted 11 lines · Michael Chan
Quoted 10 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
CONFIG_DEFAULT_HUNG_TASK_TIMEOUTsetting is only available when the hung task detection is enabled, otherwise the code now produces a build failure:
drivers/net/ethernet/broadcom/bnxt/bnxt.c:10188:21: error: use of undeclared identifier 'CONFIG_DEFAULT_HUNG_TASK_TIMEOUT'
10188 |max_tmo_secs>CONFIG_DEFAULT_HUNG_TASK_TIMEOUT) {
Quoted 7 lines
Quoted 4 lines
Enclose this warning logic in an #ifdef to ensure this builds.
Fixes 0fcad44a86bd ("bnxt_en: Change FW message timeout warning")Signed-off-by Arnd Bergmann <[email protected]>I also cannot think of a better way, so this looks fine to me. Thanks.
Reviewed-by Michael Chan <[email protected]>
I ran into this just now, and this fixed compilation for me.
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 10 lines · On Wed, 23 Apr 2025 18:28:21 +0200 you wrote:
From: Arnd Bergmann <[email protected]>
The
CONFIG_DEFAULT_HUNG_TASK_TIMEOUTsetting is only available when the hung task detection is enabled, otherwise the code now produces a build failure:
drivers/net/ethernet/broadcom/bnxt/bnxt.c:10188:21: error: use of undeclared identifier 'CONFIG_DEFAULT_HUNG_TASK_TIMEOUT'
10188 |max_tmo_secs>CONFIG_DEFAULT_HUNG_TASK_TIMEOUT) {[...]
Here is the summary with links:
- bnxt_en: hide CONFIG_DETECT_HUNG_TASK specific code
https://git.kernel.org/netdev/net-next/c/8ff617513996
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html