diff mbox

[net-2.6,1/3] iwmc3200top: clean up fw_download

Message ID 1260822623-16480-1-git-send-email-tomas.winkler@intel.com
State Deferred, archived
Delegated to: David Miller
Headers show

Commit Message

Winkler, Tomas Dec. 14, 2009, 8:30 p.m. UTC
1. removed redundant NULL-pointers checks in iwmct_fw_load
as release_firmware and kfree are NULL pointer friendly
2. remove redundant memset of the parser since the structure
is fully initialized in iwmct_fw_parser_init function

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/misc/iwmc3200top/fw-download.c |   20 ++++++--------------
 1 files changed, 6 insertions(+), 14 deletions(-)

Comments

David Miller Dec. 15, 2009, 5:45 a.m. UTC | #1
Unless you've been living under a rock, you should know that
the net-2.6 tree was closed for all non-bugfix changes as of
more than a week ago.

Therefore submitting cleanups for net-2.6 is not appropriate.

Resend your patches when net-next-2.6 opens up, which should be
shorly after Linus releases 2.6.33-rc1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Winkler, Tomas Dec. 15, 2009, 8:01 a.m. UTC | #2
> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Tuesday, December 15, 2009 7:46 AM
> To: Winkler, Tomas
> Cc: netdev@vger.kernel.org; linux-mmc@vger.kernel.org; Zhu, Yi; Perez-
> Gonzalez, Inaky; Cohen, Guy; Rindjunsky, Ron
> Subject: Re: [net-2.6 1/3] iwmc3200top: clean up fw_download
> 
> 
> Unless you've been living under a rock, you should know that
> the net-2.6 tree was closed for all non-bugfix changes as of
> more than a week ago.
> 
> Therefore submitting cleanups for net-2.6 is not appropriate.
> 
> Resend your patches when net-next-2.6 opens up, which should be
> shorly after Linus releases 2.6.33-rc1

No problem, I was indeed uber busy with the real world, will retag the patches.

Tomas
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/misc/iwmc3200top/fw-download.c b/drivers/misc/iwmc3200top/fw-download.c
index 50d431e..474be92 100644
--- a/drivers/misc/iwmc3200top/fw-download.c
+++ b/drivers/misc/iwmc3200top/fw-download.c
@@ -50,8 +50,7 @@  static int iwmct_fw_parser_init(struct iwmct_priv *priv, const u8 *file,
 	parser->file = file;
 	parser->file_size = file_size;
 	parser->cur_pos = 0;
-	parser->buf = NULL;
-
+	parser->entry_point = 0;
 	parser->buf = kzalloc(block_size, GFP_KERNEL);
 	if (!parser->buf) {
 		LOG_ERROR(priv, FW_DOWNLOAD, "kzalloc error\n");
@@ -298,8 +297,6 @@  int iwmct_fw_load(struct iwmct_priv *priv)
 	__le32 addr;
 	int ret;
 
-	/* clear parser struct */
-	memset(&priv->parser, 0, sizeof(struct iwmct_parser));
 
 	/* get the firmware */
 	ret = request_firmware(&raw, fw_name, &priv->func->dev);
@@ -317,6 +314,7 @@  int iwmct_fw_load(struct iwmct_priv *priv)
 
 	LOG_INFO(priv, FW_DOWNLOAD, "Read firmware '%s'\n", fw_name);
 
+	/* clear parser struct */
 	ret = iwmct_fw_parser_init(priv, raw->data, raw->size, priv->trans_len);
 	if (ret < 0) {
 		LOG_ERROR(priv, FW_DOWNLOAD,
@@ -324,7 +322,6 @@  int iwmct_fw_load(struct iwmct_priv *priv)
 		goto exit;
 	}
 
-	/* checksum  */
 	if (!iwmct_checksum(priv)) {
 		LOG_ERROR(priv, FW_DOWNLOAD, "checksum error\n");
 		ret = -EINVAL;
@@ -333,23 +330,18 @@  int iwmct_fw_load(struct iwmct_priv *priv)
 
 	/* download firmware to device */
 	while (iwmct_parse_next_section(priv, &pdata, &len, &addr)) {
-		if (iwmct_download_section(priv, pdata, len, addr)) {
+		ret = iwmct_download_section(priv, pdata, len, addr);
+		if (ret) {
 			LOG_ERROR(priv, FW_DOWNLOAD,
 				  "%s download section failed\n", fw_name);
-			ret = -EIO;
 			goto exit;
 		}
 	}
 
-	iwmct_kick_fw(priv, !!(priv->barker & BARKER_DNLOAD_JUMP_MSK));
+	ret = iwmct_kick_fw(priv, !!(priv->barker & BARKER_DNLOAD_JUMP_MSK));
 
 exit:
 	kfree(priv->parser.buf);
-
-	if (raw)
-		release_firmware(raw);
-
-	raw = NULL;
-
+	release_firmware(raw);
 	return ret;
 }