linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nl80211: use correct enum type in reg_reload_regdb
@ 2021-12-03 18:56 Arnd Bergmann
  2021-12-03 19:02 ` Finn Behrens
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-12-03 18:56 UTC (permalink / raw)
  To: Johannes Berg, David S. Miller, Jakub Kicinski, Finn Behrens
  Cc: Arnd Bergmann, Luca Coelho, Ilan Peer, Bhaskar Chowdhury,
	Miri Korenblit, Sriram R, Qiheng Lin, linux-wireless, netdev,
	linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

NL80211_USER_REG_HINT_USER is not something that can be
assigned to an 'enum nl80211_reg_initiator', as pointed out
by gcc.

net/wireless/reg.c: In function 'reg_reload_regdb':
net/wireless/reg.c:1137:28: error: implicit conversion from 'enum nl80211_user_reg_hint_type' to 'enum nl80211_reg_initiator' [-Werror=enum-conversion]

I don't know what was intended here, most likely it was either
NL80211_REGDOM_SET_BY_CORE (same numeric value) or
NL80211_REGDOM_SET_BY_USER (most similar name), so I pick the former
here, leaving the behavior unchanged while avoiding the warning.

Fixes: 1eda919126b4 ("nl80211: reset regdom when reloading regdb")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 net/wireless/reg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 61f1bf1bc4a7..edb2081f75e8 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1134,7 +1134,7 @@ int reg_reload_regdb(void)
 	request->wiphy_idx = WIPHY_IDX_INVALID;
 	request->alpha2[0] = current_regdomain->alpha2[0];
 	request->alpha2[1] = current_regdomain->alpha2[1];
-	request->initiator = NL80211_USER_REG_HINT_USER;
+	request->initiator = NL80211_REGDOM_SET_BY_CORE;
 	request->user_reg_hint_type = NL80211_USER_REG_HINT_USER;
 	request->reload = true;
 
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] nl80211: use correct enum type in reg_reload_regdb
  2021-12-03 18:56 [PATCH] nl80211: use correct enum type in reg_reload_regdb Arnd Bergmann
@ 2021-12-03 19:02 ` Finn Behrens
  0 siblings, 0 replies; 2+ messages in thread
From: Finn Behrens @ 2021-12-03 19:02 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Johannes Berg, David S. Miller, Jakub Kicinski, Arnd Bergmann,
	Luca Coelho, Ilan Peer, Bhaskar Chowdhury, Miri Korenblit,
	Sriram R, Qiheng Lin, linux-wireless, netdev, linux-kernel



> On 3. Dec 2021, at 19:56, Arnd Bergmann <arnd@kernel.org> wrote:
> 
> From: Arnd Bergmann <arnd@arndb.de>
> 
> NL80211_USER_REG_HINT_USER is not something that can be
> assigned to an 'enum nl80211_reg_initiator', as pointed out
> by gcc.
> 
> net/wireless/reg.c: In function 'reg_reload_regdb':
> net/wireless/reg.c:1137:28: error: implicit conversion from 'enum nl80211_user_reg_hint_type' to 'enum nl80211_reg_initiator' [-Werror=enum-conversion]
> 
> I don't know what was intended here, most likely it was either
> NL80211_REGDOM_SET_BY_CORE (same numeric value) or
> NL80211_REGDOM_SET_BY_USER (most similar name), so I pick the former
> here, leaving the behavior unchanged while avoiding the warning.
> 
> Fixes: 1eda919126b4 ("nl80211: reset regdom when reloading regdb")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Thanks,
I did miss it somehow, but after Intels robot mail about it, I did write a proper patch, as this is a different value as I wanted for the original proposed patch. But It works better this way.
See https://lore.kernel.org/linux-wireless/YadvTolO8rQcNCd%2F@gimli.kloenk.dev/

Cheers,
Finn

> net/wireless/reg.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/wireless/reg.c b/net/wireless/reg.c
> index 61f1bf1bc4a7..edb2081f75e8 100644
> --- a/net/wireless/reg.c
> +++ b/net/wireless/reg.c
> @@ -1134,7 +1134,7 @@ int reg_reload_regdb(void)
> 	request->wiphy_idx = WIPHY_IDX_INVALID;
> 	request->alpha2[0] = current_regdomain->alpha2[0];
> 	request->alpha2[1] = current_regdomain->alpha2[1];
> -	request->initiator = NL80211_USER_REG_HINT_USER;
> +	request->initiator = NL80211_REGDOM_SET_BY_CORE;
> 	request->user_reg_hint_type = NL80211_USER_REG_HINT_USER;
> 	request->reload = true;
> 
> -- 
> 2.29.2
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-03 19:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-03 18:56 [PATCH] nl80211: use correct enum type in reg_reload_regdb Arnd Bergmann
2021-12-03 19:02 ` Finn Behrens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).