Skip to contentSkip to conversation

ath11k: fix missing return in ath11k_thermal_set_throttling

PATCH In review Arnd Bergmann 2 participants 4 messages Apr 8, 2020 – Apr 9, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ath11k: fix missing return in ath11k_thermal_set_throttling

The empty stub version of this function causes a compile-time warning:

In file included from drivers/net/wireless/ath/ath11k/core.h:23,

                 from drivers/net/wireless/ath/ath11k/dp_rx.h:8,
                 from drivers/net/wireless/ath/ath11k/ce.c:6:

drivers/net/wireless/ath/ath11k/thermal.h: In function 'ath11k_thermal_set_throttling':
drivers/net/wireless/ath/ath11k/thermal.h:45:1: error: no return statement in function returning non-void [-Werror=return-type]

Just return success here.

Fixes a41d10348b01 ("ath11k: add thermal sensor device support")
---
 drivers/net/wireless/ath/ath11k/thermal.h | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath11k/thermal.h +1 -0
index 459b8d49c184..f1395a14748c 100644
@@ -42,6 +42,7 @@ static inline void ath11k_thermal_unregister(struct ath11k *ar)
 
 static inline int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state)
 {
+	return 0;
 }
 
 static inline void ath11k_thermal_event_temperature(struct ath11k *ar,
Signature · 7 lines
2.26.0


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#1 lore raw

PATCH 2/2 ath11k: fix ath11k_thermal_unregister() prototype

The stub function has the wrong prototype, causing a warning:

drivers/net/wireless/ath/ath11k/core.c: In function 'ath11k_core_pdev_destroy':
drivers/net/wireless/ath/ath11k/core.c:416:28: error: passing argument 1 of 'ath11k_thermal_unregister' from incompatible pointer type [-Werror=incompatible-pointer-types]

Change it to take the same arguments as the normal implementation.

Fixes 2a63bbca06b2 ("ath11k: add thermal cooling device support")
---
 drivers/net/wireless/ath/ath11k/thermal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/thermal.h +1 -1
index f1395a14748c..ea9a58bf6a93 100644
@@ -36,7 +36,7 @@ static inline int ath11k_thermal_register(struct ath11k_base *sc)
 	return 0;
 }
 
-static inline void ath11k_thermal_unregister(struct ath11k *ar)
+static inline void ath11k_thermal_unregister(struct ath11k_base *ar)
 {
 }
 
Signature · 7 lines
2.26.0


_______________________________________________
ath11k mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/ath11k
#2 lore raw

Re: [PATCH 2/2] ath11k: fix ath11k_thermal_unregister() prototype

Quoted 18 lines · Arnd Bergmann

The stub function has the wrong prototype, causing a warning:

drivers/net/wireless/ath/ath11k/core.c: In function 'ath11k_core_pdev_destroy':
drivers/net/wireless/ath/ath11k/core.c:416:28: error: passing argument 1 of 'ath11k_thermal_unregister' from incompatible pointer type [-Werror=incompatible-pointer-types]

Change it to take the same arguments as the normal implementation.

Fixes 2a63bbca06b2 ("ath11k: add thermal cooling device support")
---
 drivers/net/wireless/ath/ath11k/thermal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath11k/thermal.h +0 -0
index f1395a14748c..ea9a58bf6a93 100644

drivers/net/wireless/ath/ath11k/thermal.h static inline int ath11k_thermal_register(struct ath11k_base *sc) · line 41

Quoted 7 lines
drivers/net/wireless/ath/ath11k/thermal.h +1 -1
@@ -36,7 +36,7 @@ static inline int ath11k_thermal_register(struct ath11k_base *sc)
 	return 0;
 }
 
-static inline void ath11k_thermal_unregister(struct ath11k *ar)
+static inline void ath11k_thermal_unregister(struct ath11k_base *ar)
 {
 }

Already fixed by this commit:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git/commit/?id=c9be1a642a7b9ec021e3f32e084dc781b3e5216d

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
#3 lore raw
In reply to Arnd Bergmann
Quoted 22 lines · Arnd Bergmann

The empty stub version of this function causes a compile-time warning:

In file included from drivers/net/wireless/ath/ath11k/core.h:23,

                 from drivers/net/wireless/ath/ath11k/dp_rx.h:8,
                 from drivers/net/wireless/ath/ath11k/ce.c:6:

drivers/net/wireless/ath/ath11k/thermal.h: In function 'ath11k_thermal_set_throttling':
drivers/net/wireless/ath/ath11k/thermal.h:45:1: error: no return statement in function returning non-void [-Werror=return-type]

Just return success here.

Fixes a41d10348b01 ("ath11k: add thermal sensor device support")
---
 drivers/net/wireless/ath/ath11k/thermal.h | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath11k/thermal.h +0 -0
index 459b8d49c184..f1395a14748c 100644

drivers/net/wireless/ath/ath11k/thermal.h static inline void ath11k_thermal_unregister(struct ath11k *ar) · line 46

Quoted 5 lines
drivers/net/wireless/ath/ath11k/thermal.h +1 -0
@@ -42,6 +42,7 @@ static inline void ath11k_thermal_unregister(struct ath11k *ar)
 
 static inline int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state)
 {
+	return 0;
 }

Already fixed by this commit:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers.git/commit/?id=c9be1a642a7b9ec021e3f32e084dc781b3e5216d

Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches