netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Govindarajulu Varadarajan <_govind@gmx.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: ssujith@cisco.com, benve@cisco.com,
	Govindarajulu Varadarajan <_govind@gmx.com>
Subject: [PATCH net-next v3 2/8] enic: fix return value in _vnic_dev_cmd
Date: Mon, 23 Jun 2014 16:07:59 +0530	[thread overview]
Message-ID: <1403519885-4908-3-git-send-email-_govind@gmx.com> (raw)
In-Reply-To: <1403519885-4908-1-git-send-email-_govind@gmx.com>

Hardware (in readq(&devcmd->args[0])) returns positive number in case of error.
But _vnic_dev_cmd should return a negative value in case of error.

Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com>
---
 drivers/net/ethernet/cisco/enic/vnic_dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/cisco/enic/vnic_dev.c b/drivers/net/ethernet/cisco/enic/vnic_dev.c
index e86a45c..263081b 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_dev.c
+++ b/drivers/net/ethernet/cisco/enic/vnic_dev.c
@@ -312,12 +312,12 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd,
 				err = (int)readq(&devcmd->args[0]);
 				if (err == ERR_EINVAL &&
 				    cmd == CMD_CAPABILITY)
-					return err;
+					return -err;
 				if (err != ERR_ECMDUNKNOWN ||
 				    cmd != CMD_CAPABILITY)
 					pr_err("Error %d devcmd %d\n",
 						err, _CMD_N(cmd));
-				return err;
+				return -err;
 			}
 
 			if (_CMD_DIR(cmd) & _CMD_DIR_READ) {
-- 
2.0.0

  parent reply	other threads:[~2014-06-23 10:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23 10:37 [PATCH net-next v3 0/8] enic updates Govindarajulu Varadarajan
2014-06-23 10:37 ` [PATCH net-next v3 1/8] flow_keys: Record IP layer protocol in skb_flow_dissect() Govindarajulu Varadarajan
2014-06-23 10:37 ` Govindarajulu Varadarajan [this message]
2014-06-23 10:38 ` [PATCH net-next v3 3/8] enic: devcmd for adding IP 5 tuple hardware filters Govindarajulu Varadarajan
2014-06-23 10:38 ` [PATCH net-next v3 4/8] enic: alloc/free rx_cpu_rmap Govindarajulu Varadarajan
2014-06-23 10:38 ` [PATCH net-next v3 5/8] enic: Add Accelerated RFS support Govindarajulu Varadarajan
2014-06-23 10:38 ` [PATCH net-next v3 6/8] enic: fix lockdep around devcmd_lock Govindarajulu Varadarajan
2014-06-23 10:38 ` [PATCH net-next v3 7/8] enic: add low latency socket busy_poll support Govindarajulu Varadarajan
2014-06-23 10:38 ` [PATCH net-next v3 8/8] enic: do tx cleanup in napi poll Govindarajulu Varadarajan
2014-06-23 21:40 ` [PATCH net-next v3 0/8] enic updates 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=1403519885-4908-3-git-send-email-_govind@gmx.com \
    --to=_govind@gmx.com \
    --cc=benve@cisco.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=ssujith@cisco.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).