Skip to contentSkip to conversation

watchdog: Fix build error when CONFIG_SOFTLOCKUP_DETECTOR is not set

PATCH In review Laurent Dufour 3 participants 5 messages Jul 27, 2022 – Jul 28, 2022 Linux-next tree

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: Fix build error when CONFIG_SOFTLOCKUP_DETECTOR is not set

Sachin reported the following build error when CONFIG_SOFTLOCKUP_DETECTOR is not set:

kernel/watchdog.c:597:20: error: static declaration of 'lockup_detector_reconfigure' follows non-static declaration
static inline void lockup_detector_reconfigure(void)

                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from kernel/watchdog.c:17:
./include/linux/nmi.h:125:6: note: previous declaration of 'lockup_detector_reconfigure' was here
 void lockup_detector_reconfigure(void);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~

The definition of lockup_detector_reconfigure should be exported even in that case, and __lockup_detector_reconfigure should remain static.

Fixes 24a1260705b7 ("watchdog: export lockup_detector_reconfigure")
---
 kernel/watchdog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/watchdog.c +2 -2
index 90e6c41d5e33..41596c415111 100644
@@ -590,7 +590,7 @@ static __init void lockup_detector_setup(void)
 }
 
 #else /* CONFIG_SOFTLOCKUP_DETECTOR */
-void __lockup_detector_reconfigure(void)
+static void __lockup_detector_reconfigure(void)
 {
 	cpus_read_lock();
 	watchdog_nmi_stop();
@@ -598,7 +598,7 @@ void __lockup_detector_reconfigure(void)
 	watchdog_nmi_start();
 	cpus_read_unlock();
 }
-static inline void lockup_detector_reconfigure(void)
+void lockup_detector_reconfigure(void)
 {
 	__lockup_detector_reconfigure();
 }
Signature · 1 line
2.37.1
Tested-by on v1 1/1
#1 lore raw
Quoted 10 lines

The definition of lockup_detector_reconfigure should be exported even in that case, and __lockup_detector_reconfigure should remain static.

Fixes 24a1260705b7 ("watchdog: export lockup_detector_reconfigure")

---
kernel/watchdog.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)

Thanks Laurent for the fix.

- Sachin

#2 lore raw
In reply to Laurent Dufour
Quoted 14 lines · Laurent Dufour

Sachin reported the following build error when CONFIG_SOFTLOCKUP_DETECTOR is not set:

kernel/watchdog.c:597:20: error: static declaration of 'lockup_detector_reconfigure' follows non-static declaration
static inline void lockup_detector_reconfigure(void)

                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from kernel/watchdog.c:17:
./include/linux/nmi.h:125:6: note: previous declaration of 'lockup_detector_reconfigure' was here
 void lockup_detector_reconfigure(void);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~

The definition of lockup_detector_reconfigure should be exported even in that case, and __lockup_detector_reconfigure should remain static.

Quoted 6 lines
Fixes 24a1260705b7 ("watchdog: export lockup_detector_reconfigure")
---
 kernel/watchdog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Thanks.

I'll squash that in to the original commit.

cheers

#3 lore raw

Le 27/07/2022 à 13:38, Michael Ellerman a écrit :

Quoted 22 lines
Quoted 14 lines · Laurent Dufour

Sachin reported the following build error when CONFIG_SOFTLOCKUP_DETECTOR is not set:

kernel/watchdog.c:597:20: error: static declaration of 'lockup_detector_reconfigure' follows non-static declaration
static inline void lockup_detector_reconfigure(void)

                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from kernel/watchdog.c:17:
./include/linux/nmi.h:125:6: note: previous declaration of 'lockup_detector_reconfigure' was here
 void lockup_detector_reconfigure(void);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~

The definition of lockup_detector_reconfigure should be exported even in that case, and __lockup_detector_reconfigure should remain static.

Quoted 6 lines
Fixes 24a1260705b7 ("watchdog: export lockup_detector_reconfigure")
---
 kernel/watchdog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 3 lines

Thanks.

I'll squash that in to the original commit.

Thanks Michael,

I was thinking this is too late for such a squash.

Laurent.

#4 lore raw
Quoted 23 lines · Laurent Dufour

Le 27/07/2022 à 13:38, Michael Ellerman a écrit :

Quoted 22 lines
Quoted 20 lines · Laurent Dufour

Sachin reported the following build error when CONFIG_SOFTLOCKUP_DETECTOR is not set:

kernel/watchdog.c:597:20: error: static declaration of 'lockup_detector_reconfigure' follows non-static declaration
static inline void lockup_detector_reconfigure(void)

                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from kernel/watchdog.c:17:
./include/linux/nmi.h:125:6: note: previous declaration of 'lockup_detector_reconfigure' was here
 void lockup_detector_reconfigure(void);
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~

The definition of lockup_detector_reconfigure should be exported even in that case, and __lockup_detector_reconfigure should remain static.

Fixes 24a1260705b7 ("watchdog: export lockup_detector_reconfigure")
---
 kernel/watchdog.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 7 lines
Quoted 3 lines

Thanks.

I'll squash that in to the original commit.

Thanks Michael,

I was thinking this is too late for such a squash.

It usually would be, if I was organised, so sending a follow-up was the correct thing for you to do :)

cheers