summaryrefslogtreecommitdiff
path: root/net/rfkill
diff options
context:
space:
mode:
authorZijun Hu <quic_zijuhu@quicinc.com>2024-08-11 12:47:26 +0800
committerJohannes Berg <johannes.berg@intel.com>2024-08-27 10:28:55 +0200
commit373d3f8dcbb1c0d764123653ca4574be636b8d86 (patch)
tree159c8be560a367978c726dd2c282f1883c42d25f /net/rfkill
parenta0ee9dcce60027258a53ee85b9153ab268dcb55a (diff)
downloadlwn-373d3f8dcbb1c0d764123653ca4574be636b8d86.tar.gz
lwn-373d3f8dcbb1c0d764123653ca4574be636b8d86.zip
wifi: rfkill: Correct parameter type for rfkill_set_hw_state_reason()
Change type of parameter @reason to enum rfkill_hard_block_reasons for API rfkill_set_hw_state_reason() according to its comments, and all kernel callers have invoked the API with enum type actually. Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com> Link: https://patch.msgid.link/20240811-rfkill_fix-v2-1-9050760336f4@quicinc.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/rfkill')
-rw-r--r--net/rfkill/core.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 7a5367628c05..13a5126bc36e 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -539,18 +539,14 @@ bool rfkill_get_global_sw_state(const enum rfkill_type type)
#endif
bool rfkill_set_hw_state_reason(struct rfkill *rfkill,
- bool blocked, unsigned long reason)
+ bool blocked,
+ enum rfkill_hard_block_reasons reason)
{
unsigned long flags;
bool ret, prev;
BUG_ON(!rfkill);
- if (WARN(reason & ~(RFKILL_HARD_BLOCK_SIGNAL |
- RFKILL_HARD_BLOCK_NOT_OWNER),
- "hw_state reason not supported: 0x%lx", reason))
- return rfkill_blocked(rfkill);
-
spin_lock_irqsave(&rfkill->lock, flags);
prev = !!(rfkill->hard_block_reasons & reason);
if (blocked) {