All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Finn Behrens <me@kloenk.dev>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Luca Coelho <luciano.coelho@intel.com>,
	Ilan Peer <ilan.peer@intel.com>,
	Bhaskar Chowdhury <unixbhaskar@gmail.com>,
	Miri Korenblit <miriam.rachel.korenblit@intel.com>,
	Sriram R <srirrama@codeaurora.org>,
	Qiheng Lin <linqiheng@huawei.com>,
	linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] nl80211: use correct enum type in reg_reload_regdb
Date: Fri,  3 Dec 2021 19:56:45 +0100	[thread overview]
Message-ID: <20211203185700.756121-1-arnd@kernel.org> (raw)

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


             reply	other threads:[~2021-12-03 18:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-03 18:56 Arnd Bergmann [this message]
2021-12-03 19:02 ` [PATCH] nl80211: use correct enum type in reg_reload_regdb Finn Behrens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211203185700.756121-1-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=ilan.peer@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linqiheng@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=me@kloenk.dev \
    --cc=miriam.rachel.korenblit@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=srirrama@codeaurora.org \
    --cc=unixbhaskar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.