LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mt76: fix enum type mismatch
@ 2021-07-21 15:06 Arnd Bergmann
  2021-07-31  8:38 ` Kalle Valo
  2021-08-06  7:57 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-07-21 15:06 UTC (permalink / raw)
  To: Felix Fietkau, Lorenzo Bianconi, Kalle Valo
  Cc: Arnd Bergmann, Ryder Lee, David S. Miller, Jakub Kicinski,
	Matthias Brugger, Shayne Chen, Sean Wang, Soul Huang, Deren Wu,
	Xing Song, linux-wireless, netdev, linux-arm-kernel,
	linux-mediatek, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

There is no 'NONE' version of 'enum mcu_cipher_type', and returning
'MT_CIPHER_NONE' causes a warning:

drivers/net/wireless/mediatek/mt76/mt7921/mcu.c: In function 'mt7921_mcu_get_cipher':
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c:114:24: error: implicit conversion from 'enum mt76_cipher_type' to 'enum mcu_cipher_type' [-Werror=enum-conversion]
  114 |                 return MT_CIPHER_NONE;
      |                        ^~~~~~~~~~~~~~

Add the missing MCU_CIPHER_NONE defintion that fits in here with
the same value.

Fixes: c368362c36d3 ("mt76: fix iv and CCMP header insertion")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
This problem currently exists in 5.14-rc2, please ignore my patch
if a fix is already queued up elsewhere.
---
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +-
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.h | 3 ++-
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 2 +-
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.h | 3 ++-
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index 863aa18b3024..43960770a9af 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -111,7 +111,7 @@ mt7915_mcu_get_cipher(int cipher)
 	case WLAN_CIPHER_SUITE_SMS4:
 		return MCU_CIPHER_WAPI;
 	default:
-		return MT_CIPHER_NONE;
+		return MCU_CIPHER_NONE;
 	}
 }
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h
index edd3ba3a0c2d..e68a562cc5b4 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.h
@@ -1073,7 +1073,8 @@ enum {
 };
 
 enum mcu_cipher_type {
-	MCU_CIPHER_WEP40 = 1,
+	MCU_CIPHER_NONE = 0,
+	MCU_CIPHER_WEP40,
 	MCU_CIPHER_WEP104,
 	MCU_CIPHER_WEP128,
 	MCU_CIPHER_TKIP,
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index cd690c64f65b..9fbaacc67cfa 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -111,7 +111,7 @@ mt7921_mcu_get_cipher(int cipher)
 	case WLAN_CIPHER_SUITE_SMS4:
 		return MCU_CIPHER_WAPI;
 	default:
-		return MT_CIPHER_NONE;
+		return MCU_CIPHER_NONE;
 	}
 }
 
diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.h b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.h
index d76cf8f8dfdf..de3c091f6736 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.h
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.h
@@ -199,7 +199,8 @@ struct sta_rec_sec {
 } __packed;
 
 enum mcu_cipher_type {
-	MCU_CIPHER_WEP40 = 1,
+	MCU_CIPHER_NONE = 0,
+	MCU_CIPHER_WEP40,
 	MCU_CIPHER_WEP104,
 	MCU_CIPHER_WEP128,
 	MCU_CIPHER_TKIP,
-- 
2.29.2


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

* Re: [PATCH] mt76: fix enum type mismatch
  2021-07-21 15:06 [PATCH] mt76: fix enum type mismatch Arnd Bergmann
@ 2021-07-31  8:38 ` Kalle Valo
  2021-08-06  7:57 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-07-31  8:38 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Felix Fietkau, Lorenzo Bianconi, Arnd Bergmann, Ryder Lee,
	David S. Miller, Jakub Kicinski, Matthias Brugger, Shayne Chen,
	Sean Wang, Soul Huang, Deren Wu, Xing Song, linux-wireless,
	netdev, linux-arm-kernel, linux-mediatek, linux-kernel

Arnd Bergmann <arnd@kernel.org> writes:

> From: Arnd Bergmann <arnd@arndb.de>
>
> There is no 'NONE' version of 'enum mcu_cipher_type', and returning
> 'MT_CIPHER_NONE' causes a warning:
>
> drivers/net/wireless/mediatek/mt76/mt7921/mcu.c: In function 'mt7921_mcu_get_cipher':
> drivers/net/wireless/mediatek/mt76/mt7921/mcu.c:114:24: error: implicit conversion from 'enum mt76_cipher_type' to 'enum mcu_cipher_type' [-Werror=enum-conversion]
>   114 |                 return MT_CIPHER_NONE;
>       |                        ^~~~~~~~~~~~~~
>
> Add the missing MCU_CIPHER_NONE defintion that fits in here with
> the same value.
>
> Fixes: c368362c36d3 ("mt76: fix iv and CCMP header insertion")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> This problem currently exists in 5.14-rc2, please ignore my patch
> if a fix is already queued up elsewhere.

Should I take this to wireless-drivers? Felix, ack?

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

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

* Re: [PATCH] mt76: fix enum type mismatch
  2021-07-21 15:06 [PATCH] mt76: fix enum type mismatch Arnd Bergmann
  2021-07-31  8:38 ` Kalle Valo
@ 2021-08-06  7:57 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2021-08-06  7:57 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Felix Fietkau, Lorenzo Bianconi, Arnd Bergmann, Ryder Lee,
	David S. Miller, Jakub Kicinski, Matthias Brugger, Shayne Chen,
	Sean Wang, Soul Huang, Deren Wu, Xing Song, linux-wireless,
	netdev, linux-arm-kernel, linux-mediatek, linux-kernel

Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> There is no 'NONE' version of 'enum mcu_cipher_type', and returning
> 'MT_CIPHER_NONE' causes a warning:
> 
> drivers/net/wireless/mediatek/mt76/mt7921/mcu.c: In function 'mt7921_mcu_get_cipher':
> drivers/net/wireless/mediatek/mt76/mt7921/mcu.c:114:24: error: implicit conversion from 'enum mt76_cipher_type' to 'enum mcu_cipher_type' [-Werror=enum-conversion]
>   114 |                 return MT_CIPHER_NONE;
>       |                        ^~~~~~~~~~~~~~
> 
> Add the missing MCU_CIPHER_NONE defintion that fits in here with
> the same value.
> 
> Fixes: c368362c36d3 ("mt76: fix iv and CCMP header insertion")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Patch applied to wireless-drivers.git, thanks.

abf3d98dee7c mt76: fix enum type mismatch

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20210721150745.1914829-1-arnd@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2021-08-06  7:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 15:06 [PATCH] mt76: fix enum type mismatch Arnd Bergmann
2021-07-31  8:38 ` Kalle Valo
2021-08-06  7:57 ` Kalle Valo

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).