linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Sharon Dvir <sharon.dvir@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 05/19] iwlwifi: change functions that can only return 0 to void
Date: Sat,  5 Aug 2017 22:43:17 +0300	[thread overview]
Message-ID: <20170805194331.17426-6-luca@coelho.fi> (raw)
In-Reply-To: <20170805194331.17426-1-luca@coelho.fi>

From: Sharon Dvir <sharon.dvir@intel.com>

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>
---
 drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index 6fdb5921e17f..cdb765656115 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -478,8 +478,8 @@ static int iwl_set_default_calib(struct iwl_drv *drv, const u8 *data)
 	return 0;
 }
 
-static int iwl_set_ucode_api_flags(struct iwl_drv *drv, const u8 *data,
-				   struct iwl_ucode_capabilities *capa)
+static void iwl_set_ucode_api_flags(struct iwl_drv *drv, const u8 *data,
+				    struct iwl_ucode_capabilities *capa)
 {
 	const struct iwl_ucode_api *ucode_api = (void *)data;
 	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,
 			"api flags index %d larger than supported by driver\n",
 			api_index);
-		/* don't return an error so we can load FW that has more bits */
-		return 0;
+		return;
 	}
 
 	for (i = 0; i < 32; i++) {
 		if (api_flags & BIT(i))
 			__set_bit(i + 32 * api_index, capa->_api);
 	}
-
-	return 0;
 }
 
-static int iwl_set_ucode_capabilities(struct iwl_drv *drv, const u8 *data,
-				      struct iwl_ucode_capabilities *capa)
+static void iwl_set_ucode_capabilities(struct iwl_drv *drv, const u8 *data,
+				       struct iwl_ucode_capabilities *capa)
 {
 	const struct iwl_ucode_capa *ucode_capa = (void *)data;
 	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,
 			"capa flags index %d larger than supported by driver\n",
 			api_index);
-		/* don't return an error so we can load FW that has more bits */
-		return 0;
+		return;
 	}
 
 	for (i = 0; i < 32; i++) {
 		if (api_flags & BIT(i))
 			__set_bit(i + 32 * api_index, capa->_capa);
 	}
-
-	return 0;
 }
 
 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:
 			if (tlv_len != sizeof(struct iwl_ucode_api))
 				goto invalid_tlv_len;
-			if (iwl_set_ucode_api_flags(drv, tlv_data, capa))
-				goto tlv_error;
+			iwl_set_ucode_api_flags(drv, tlv_data, capa);
 			break;
 		case IWL_UCODE_TLV_ENABLED_CAPABILITIES:
 			if (tlv_len != sizeof(struct iwl_ucode_capa))
 				goto invalid_tlv_len;
-			if (iwl_set_ucode_capabilities(drv, tlv_data, capa))
-				goto tlv_error;
+			iwl_set_ucode_capabilities(drv, tlv_data, capa);
 			break;
 		case IWL_UCODE_TLV_INIT_EVTLOG_PTR:
 			if (tlv_len != sizeof(u32))
-- 
2.13.2

  parent reply	other threads:[~2017-08-05 19:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-05 19:43 [PATCH 00/19] iwlwifi: updates intended for v4.14 2017-08-05 Luca Coelho
2017-08-05 19:43 ` [PATCH 01/19] iwlwifi: mvm: remove useless condition in LED code Luca Coelho
2017-08-05 19:43 ` [PATCH 02/19] iwlwifi: mvm: use firmware LED command where applicable Luca Coelho
2017-08-05 19:43 ` [PATCH 03/19] iwlwifi: mvm: add const to thermal_cooling_device_ops structure Luca Coelho
2017-08-05 19:43 ` [PATCH 04/19] iwlwifi: mvm: add debugfs to force CT-kill Luca Coelho
2017-08-07 13:11   ` Kalle Valo
2017-08-07 13:25     ` Luca Coelho
2017-08-07 13:28       ` Kalle Valo
2017-08-09  6:43         ` [PATCH v2 4/19] " Luca Coelho
2017-08-09  7:36           ` Kalle Valo
2017-08-05 19:43 ` Luca Coelho [this message]
2017-08-05 19:43 ` [PATCH 06/19] iwlwifi: fix a few instances of misaligned kerneldoc parameters Luca Coelho
2017-08-05 19:43 ` [PATCH 07/19] iwlwifi: add support of FPGA fw Luca Coelho
2017-08-05 19:43 ` [PATCH 08/19] iwlwifi: fix a000 RF_ID define Luca Coelho
2017-08-05 19:43 ` [PATCH 09/19] iwlwifi: dump smem configuration when firmware crashes Luca Coelho
2017-08-05 19:43 ` [PATCH 10/19] iwlwifi: mvm: move a000 device NVM retrieval to a common place Luca Coelho
2017-08-05 19:43 ` [PATCH 11/19] iwlwifi: mvm: set the default cTDP budget Luca Coelho
2017-08-05 19:43 ` [PATCH 12/19] iwlwifi: mvm: support new beacon template command Luca Coelho
2017-08-07 13:22   ` Kalle Valo
2017-08-09  6:46     ` [PATCH v2 " Luca Coelho
2017-08-09 18:20       ` [PATCH v3 " Luca Coelho
2017-08-05 19:43 ` [PATCH 13/19] iwlwifi: mvm: don't send CTDP commands via debugfs if not supported Luca Coelho
2017-08-05 19:43 ` [PATCH 14/19] iwlwifi: mvm: add station before allocating a queue Luca Coelho
2017-08-05 19:43 ` [PATCH 15/19] iwlwifi: pcie: don't init a Tx queue with an SSN > size of the queue Luca Coelho
2017-08-05 19:43 ` [PATCH 16/19] iwlwifi: fix nmi triggering from host Luca Coelho
2017-08-05 19:43 ` [PATCH 17/19] iwlwifi: remove references to unsupported HW Luca Coelho
2017-08-05 19:43 ` [PATCH 18/19] iwlwifi: pcie: free the TSO page when a Tx queue is unmapped on A000 devices Luca Coelho
2017-08-05 19:43 ` [PATCH 19/19] iwlwifi: mvm: fix the coex firmware API Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170805194331.17426-6-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=sharon.dvir@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).