netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amit Kumar Salecha <amit.salecha@qlogic.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, ameen.rahman@qlogic.com
Subject: [PATCHv1 NEXT 8/9] qlcnic: fix endianness in fw validation
Date: Thu,  1 Apr 2010 22:01:35 -0700	[thread overview]
Message-ID: <1270184496-18985-9-git-send-email-amit.salecha@qlogic.com> (raw)
In-Reply-To: <1270184496-18985-1-git-send-email-amit.salecha@qlogic.com>

cpu_to_le32 was missing and used improperly.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/qlcnic/qlcnic_init.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index ccd24f4..89c64e8 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -627,7 +627,7 @@ qlcnic_validate_bootld(struct qlcnic_adapter *adapter)
 		return -EINVAL;
 
 	tab_size = cpu_to_le32(tab_desc->findex) +
-			(cpu_to_le32(tab_desc->entry_size * (idx + 1)));
+			(cpu_to_le32(tab_desc->entry_size) * (idx + 1));
 
 	if (adapter->fw->size < tab_size)
 		return -EINVAL;
@@ -636,7 +636,7 @@ qlcnic_validate_bootld(struct qlcnic_adapter *adapter)
 		(cpu_to_le32(tab_desc->entry_size) * (idx));
 	descr = (struct uni_data_desc *)&unirom[offs];
 
-	data_size = descr->findex + cpu_to_le32(descr->size);
+	data_size = cpu_to_le32(descr->findex) + cpu_to_le32(descr->size);
 
 	if (adapter->fw->size < data_size)
 		return -EINVAL;
@@ -662,7 +662,7 @@ qlcnic_validate_fw(struct qlcnic_adapter *adapter)
 		return -EINVAL;
 
 	tab_size = cpu_to_le32(tab_desc->findex) +
-			(cpu_to_le32(tab_desc->entry_size * (idx + 1)));
+			(cpu_to_le32(tab_desc->entry_size) * (idx + 1));
 
 	if (adapter->fw->size < tab_size)
 		return -EINVAL;
@@ -670,7 +670,7 @@ qlcnic_validate_fw(struct qlcnic_adapter *adapter)
 	offs = cpu_to_le32(tab_desc->findex) +
 		(cpu_to_le32(tab_desc->entry_size) * (idx));
 	descr = (struct uni_data_desc *)&unirom[offs];
-	data_size = descr->findex + cpu_to_le32(descr->size);
+	data_size = cpu_to_le32(descr->findex) + cpu_to_le32(descr->size);
 
 	if (adapter->fw->size < data_size)
 		return -EINVAL;
-- 
1.6.0.2


  parent reply	other threads:[~2010-04-02  5:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02  5:01 [PATCHv1 0/9]qlcnic: fix diagnostic tools access Amit Kumar Salecha
2010-04-02  5:01 ` [PATCHv1 NEXT 1/9] qlcnic: fix fw load from file Amit Kumar Salecha
2010-04-02  5:01 ` [PATCHv1 NEXT 2/9] qlcnic: handle queue manager access Amit Kumar Salecha
2010-04-02  5:01 ` [PATCHv1 NEXT 3/9] qlcnic: update oncard memory size check Amit Kumar Salecha
2010-04-02  5:01 ` [PATCHv1 NEXT 4/9] qlcnic: fix onchip memory access Amit Kumar Salecha
2010-04-02  5:01 ` [PATCHv1 NEXT 5/9] qlcnic: use IDC defined timeout value Amit Kumar Salecha
2010-04-02  5:01 ` [PATCHv1 NEXT 6/9] qlcnic: add driver debug support Amit Kumar Salecha
2010-04-02  5:01 ` [PATCHv1 NEXT 7/9] qlcnic: fix interface attach sequence Amit Kumar Salecha
2010-04-02  5:01 ` Amit Kumar Salecha [this message]
2010-04-02  5:01 ` [PATCHv1 NEXT 9/9] qlcnic: update version to 5.0.1 Amit Kumar Salecha
2010-04-03 21:19 ` [PATCHv1 0/9]qlcnic: fix diagnostic tools access David Miller

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=1270184496-18985-9-git-send-email-amit.salecha@qlogic.com \
    --to=amit.salecha@qlogic.com \
    --cc=ameen.rahman@qlogic.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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).