mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
iwlwifi: change functions that can only return 0 to void
Change iwl_set_ucode_api_flags(), iwl_set_ucode_capabilities() to be void. No need to check returned values. Found by Klocwork. Signed-off-by: Sharon Dvir <sharon.dvir@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
This commit is contained in:
parent
61d8c62646
commit
a4380b4eb3
1 changed files with 8 additions and 16 deletions
|
@ -478,8 +478,8 @@ static int iwl_set_default_calib(struct iwl_drv *drv, const u8 *data)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iwl_set_ucode_api_flags(struct iwl_drv *drv, const u8 *data,
|
static void iwl_set_ucode_api_flags(struct iwl_drv *drv, const u8 *data,
|
||||||
struct iwl_ucode_capabilities *capa)
|
struct iwl_ucode_capabilities *capa)
|
||||||
{
|
{
|
||||||
const struct iwl_ucode_api *ucode_api = (void *)data;
|
const struct iwl_ucode_api *ucode_api = (void *)data;
|
||||||
u32 api_index = le32_to_cpu(ucode_api->api_index);
|
u32 api_index = le32_to_cpu(ucode_api->api_index);
|
||||||
|
@ -490,20 +490,17 @@ static int iwl_set_ucode_api_flags(struct iwl_drv *drv, const u8 *data,
|
||||||
IWL_ERR(drv,
|
IWL_ERR(drv,
|
||||||
"api flags index %d larger than supported by driver\n",
|
"api flags index %d larger than supported by driver\n",
|
||||||
api_index);
|
api_index);
|
||||||
/* don't return an error so we can load FW that has more bits */
|
return;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
if (api_flags & BIT(i))
|
if (api_flags & BIT(i))
|
||||||
__set_bit(i + 32 * api_index, capa->_api);
|
__set_bit(i + 32 * api_index, capa->_api);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iwl_set_ucode_capabilities(struct iwl_drv *drv, const u8 *data,
|
static void iwl_set_ucode_capabilities(struct iwl_drv *drv, const u8 *data,
|
||||||
struct iwl_ucode_capabilities *capa)
|
struct iwl_ucode_capabilities *capa)
|
||||||
{
|
{
|
||||||
const struct iwl_ucode_capa *ucode_capa = (void *)data;
|
const struct iwl_ucode_capa *ucode_capa = (void *)data;
|
||||||
u32 api_index = le32_to_cpu(ucode_capa->api_index);
|
u32 api_index = le32_to_cpu(ucode_capa->api_index);
|
||||||
|
@ -514,16 +511,13 @@ static int iwl_set_ucode_capabilities(struct iwl_drv *drv, const u8 *data,
|
||||||
IWL_ERR(drv,
|
IWL_ERR(drv,
|
||||||
"capa flags index %d larger than supported by driver\n",
|
"capa flags index %d larger than supported by driver\n",
|
||||||
api_index);
|
api_index);
|
||||||
/* don't return an error so we can load FW that has more bits */
|
return;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 32; i++) {
|
for (i = 0; i < 32; i++) {
|
||||||
if (api_flags & BIT(i))
|
if (api_flags & BIT(i))
|
||||||
__set_bit(i + 32 * api_index, capa->_capa);
|
__set_bit(i + 32 * api_index, capa->_capa);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int iwl_parse_v1_v2_firmware(struct iwl_drv *drv,
|
static int iwl_parse_v1_v2_firmware(struct iwl_drv *drv,
|
||||||
|
@ -765,14 +759,12 @@ static int iwl_parse_tlv_firmware(struct iwl_drv *drv,
|
||||||
case IWL_UCODE_TLV_API_CHANGES_SET:
|
case IWL_UCODE_TLV_API_CHANGES_SET:
|
||||||
if (tlv_len != sizeof(struct iwl_ucode_api))
|
if (tlv_len != sizeof(struct iwl_ucode_api))
|
||||||
goto invalid_tlv_len;
|
goto invalid_tlv_len;
|
||||||
if (iwl_set_ucode_api_flags(drv, tlv_data, capa))
|
iwl_set_ucode_api_flags(drv, tlv_data, capa);
|
||||||
goto tlv_error;
|
|
||||||
break;
|
break;
|
||||||
case IWL_UCODE_TLV_ENABLED_CAPABILITIES:
|
case IWL_UCODE_TLV_ENABLED_CAPABILITIES:
|
||||||
if (tlv_len != sizeof(struct iwl_ucode_capa))
|
if (tlv_len != sizeof(struct iwl_ucode_capa))
|
||||||
goto invalid_tlv_len;
|
goto invalid_tlv_len;
|
||||||
if (iwl_set_ucode_capabilities(drv, tlv_data, capa))
|
iwl_set_ucode_capabilities(drv, tlv_data, capa);
|
||||||
goto tlv_error;
|
|
||||||
break;
|
break;
|
||||||
case IWL_UCODE_TLV_INIT_EVTLOG_PTR:
|
case IWL_UCODE_TLV_INIT_EVTLOG_PTR:
|
||||||
if (tlv_len != sizeof(u32))
|
if (tlv_len != sizeof(u32))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue