Skip to content

Commit

Permalink
mt76: fix enum type mismatch
Browse files Browse the repository at this point in the history
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: c368362 ("mt76: fix iv and CCMP header insertion")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210721150745.1914829-1-arnd@kernel.org
  • Loading branch information
Arnd Bergmann authored and Kalle Valo committed Aug 6, 2021
1 parent 891332f commit abf3d98
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt7915/mcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/mediatek/mt76/mt7921/mcu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit abf3d98

Please sign in to comment.