lkml.org 
[lkml]   [2021]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] iwlwifi: rs: fixup the return value type of iwl_legacy_rate_to_fw_idx()
From
Date
On Wed, 2021-11-17 at 06:36 +0000, cgel.zte@gmail.com wrote:
> From: Ye Guojin <ye.guojin@zte.com.cn>
>
> This was found by coccicheck:
> ./drivers/net/wireless/intel/iwlwifi/fw/rs.c, 147, 10-21, WARNING
> Unsigned expression compared with zero legacy_rate < 0
[]
> diff --git a/drivers/net/wireless/intel/iwlwifi/fw/rs.c b/drivers/net/wireless/intel/iwlwifi/fw/rs.c
[]
> @@ -142,7 +142,7 @@ u32 iwl_new_rate_from_v1(u32 rate_v1)
> }
> /* if legacy format */
> } else {
> - u32 legacy_rate = iwl_legacy_rate_to_fw_idx(rate_v1);
> + int legacy_rate = iwl_legacy_rate_to_fw_idx(rate_v1);
>
> WARN_ON(legacy_rate < 0);

Why not just remove the WARN_ON instead?


\
 
 \ /
  Last update: 2021-11-17 07:41    [W:0.159 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site