ath11k: Remove unnecessary enum scan_priority
Subsystems (3)
PATCH 1/1 ath11k: Remove unnecessary enum scan_priority
Clang warns:
drivers/net/wireless/ath/ath11k/wmi.c:1827:23: warning: implicit conversion from enumeration type 'enum wmi_scan_priority' to different enumeration type 'enum scan_priority' [-Wenum-conversion]
arg->scan_priority = WMI_SCAN_PRIORITY_LOW;
~ ^~~~~~~~~~~~~~~~~~~~~1 warning generated.
wmi_scan_priority and scan_priority have the same values but the wmi one has WMI prefixed to the names. Since that enum is already being used, get rid of scan_priority and switch its one use to wmi_scan_priority to fix this warning.
--- drivers/net/wireless/ath/ath11k/wmi.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/net/wireless/ath/ath11k/wmi.h +1 -10
@@ -2896,15 +2896,6 @@ struct wmi_bcn_offload_ctrl_cmd {u32 bcn_ctrl_op; } __packed; -enum scan_priority { -SCAN_PRIORITY_VERY_LOW , -SCAN_PRIORITY_LOW , -SCAN_PRIORITY_MEDIUM , -SCAN_PRIORITY_HIGH , -SCAN_PRIORITY_VERY_HIGH , -SCAN_PRIORITY_COUNT , -}; -enum scan_dwelltime_adaptive_mode {SCAN_DWELL_MODE_DEFAULT =0 ,SCAN_DWELL_MODE_CONSERVATIVE =1 ,
@@ -3056,7 +3047,7 @@ struct scan_req_params {u32 scan_req_id;u32 vdev_id;u32 pdev_id; -enum scan_priority scan_priority; +enum wmi_scan_priority scan_priority; union { struct { u32 scan_ev_started:1,
Signature · 7 lines
2.24.0 _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 10 lines · Nathan Chancellor
Clang warns:
drivers/net/wireless/ath/ath11k/wmi.c:1827:23: warning: implicit conversion from enumeration type 'enumwmi_scan_priority' to different enumeration type 'enumscan_priority' [-Wenum-conversion]arg->scan_priority = WMI_SCAN_PRIORITY_LOW; ~ ^~~~~~~~~~~~~~~~~~~~~1 warning generated.
Quoted 8 lines
wmi_scan_priorityandscan_priorityhave the same values but the wmi one has WMI prefixed to the names. Since that enum is already being used, get rid ofscan_priorityand switch its one use towmi_scan_priorityto fix this warning.Fixes d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")Signed-off-by Nathan Chancellor <[email protected]>
Further, it looks like the member scan_priority in struct wmi_start_scan_arg and struct wmi_start_scan_cmd should probably use enum wmi_scan_priority, rather than u32. Also, I don't know if the more concisely named enum is preferable? Either way, thanks for the patch.
Quoted 37 lines
--- drivers/net/wireless/ath/ath11k/wmi.h | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)drivers/net/wireless/ath/ath11k/wmi.h +1
-11@@ -2896,15 +2896,6 @@ struct wmi_bcn_offload_ctrl_cmd {u32 bcn_ctrl_op; } __packed; -enum scan_priority { -SCAN_PRIORITY_VERY_LOW , -SCAN_PRIORITY_LOW , -SCAN_PRIORITY_MEDIUM , -SCAN_PRIORITY_HIGH , -SCAN_PRIORITY_VERY_HIGH , -SCAN_PRIORITY_COUNT , -}; -enum scan_dwelltime_adaptive_mode {SCAN_DWELL_MODE_DEFAULT =0 ,SCAN_DWELL_MODE_CONSERVATIVE =1 ,@@ -3056,7 +3047,7 @@ struct scan_req_params {u32 scan_req_id;u32 vdev_id;u32 pdev_id; -enum scan_priority scan_priority; +enum wmi_scan_priority scan_priority; union { struct { u32 scan_ev_started:1, --2.24.0
--
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 17 lines · Nick Desaulniers
Quoted 15 lines · Nathan Chancellor
Clang warns:
drivers/net/wireless/ath/ath11k/wmi.c:1827:23: warning: implicit conversion from enumeration type 'enumwmi_scan_priority' to different enumeration type 'enumscan_priority' [-Wenum-conversion]arg->scan_priority = WMI_SCAN_PRIORITY_LOW; ~ ^~~~~~~~~~~~~~~~~~~~~1 warning generated.
wmi_scan_priorityandscan_priorityhave the same values but the wmi one has WMI prefixed to the names. Since that enum is already being used, get rid ofscan_priorityand switch its one use towmi_scan_priorityto fix this warning.
Quoted 7 lines
Quoted 3 lines
Fixes d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")Signed-off-by Nathan Chancellor <[email protected]>Further, it looks like the member
scan_priorityinstruct wmi_start_scan_argandstruct wmi_start_scan_cmdshould probably useenum wmi_scan_priority, rather thanu32.
struct wmi_start_scan_cmd is sent to firmware and that's why it has u32 to make sure that the size is exactly 32 bits.
Quoted 1 line
Also, I don't know if the more concisely named enum is preferable?
I didn't get this comment.
Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 5 lines · Kalle Valo
Quoted 2 lines · Nick Desaulniers
On Wed, Dec 11, 2019 at 11:23 AM Nathan Chancellor <[email protected]> wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
wmi_scan_priorityandscan_priorityhave the same values but the wmi one has WMI prefixed to the names. Since that enum is already being used, get rid ofscan_priorityand switch its one use towmi_scan_priorityto fix this warning.Also, I don't know if the more concisely named enum is preferable?
I didn't get this comment.
Given two enums with the same values:
enum scan_priority
enum wmi_scan_priority
wouldn't you prefer to type wmi_ a few times less? Doesn't really matter, but that was the point I was making.
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 13 lines · Nick Desaulniers
Quoted 12 lines · Kalle Valo
Quoted 8 lines · Nick Desaulniers
Quoted 5 lines · Nathan Chancellor
wmi_scan_priorityandscan_priorityhave the same values but the wmi one has WMI prefixed to the names. Since that enum is already being used, get rid ofscan_priorityand switch its one use towmi_scan_priorityto fix this warning.Also, I don't know if the more concisely named enum is preferable?
Quoted 7 lines
Quoted 1 line
I didn't get this comment.
Given two enums with the same values:
enumscan_priority
enumwmi_scan_priority
wouldn't you prefer to typewmi_a few times less? Doesn't really matter, but that was the point I was making.
Ah, now I got it :) This enum is part of firmware interface (WMI) so yes, I prefer to use the wmi_ prefix to make that obvious.
Signature · 1 line
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 14 lines · Nathan Chancellor
Clang warns:
drivers/net/wireless/ath/ath11k/wmi.c:1827:23: warning: implicit conversion from enumeration type 'enumwmi_scan_priority' to different enumeration type 'enumscan_priority' [-Wenum-conversion]arg->scan_priority = WMI_SCAN_PRIORITY_LOW; ~ ^~~~~~~~~~~~~~~~~~~~~1 warning generated.
wmi_scan_priorityandscan_priorityhave the same values but the wmi one has WMI prefixed to the names. Since that enum is already being used, get rid ofscan_priorityand switch its one use towmi_scan_priorityto fix this warning.
Quoted 5 lines
Fixes d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")Signed-off-by Nathan Chancellor <[email protected]>Reviewed-by Nick Desaulniers <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
509421acab69 ath11k: Remove unnecessary enum scan_priority
Signature · 3 lines
https://patchwork.kernel.org/patch/11286141/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 14 lines · Nathan Chancellor
Clang warns:
drivers/net/wireless/ath/ath11k/wmi.c:1827:23: warning: implicit conversion from enumeration type 'enumwmi_scan_priority' to different enumeration type 'enumscan_priority' [-Wenum-conversion]arg->scan_priority = WMI_SCAN_PRIORITY_LOW; ~ ^~~~~~~~~~~~~~~~~~~~~1 warning generated.
wmi_scan_priorityandscan_priorityhave the same values but the wmi one has WMI prefixed to the names. Since that enum is already being used, get rid ofscan_priorityand switch its one use towmi_scan_priorityto fix this warning.
Quoted 5 lines
Fixes d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")Signed-off-by Nathan Chancellor <[email protected]>Reviewed-by Nick Desaulniers <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
509421acab69 ath11k: Remove unnecessary enum scan_priority
Signature · 8 lines
https://patchwork.kernel.org/patch/11286141/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches _______________________________________________ ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k