From: David Miller <davem@davemloft.net>
To: himanshu.madhani@qlogic.com
Cc: netdev@vger.kernel.org, Dept_NX_Linux_NIC_Driver@qlogic.com,
jitendra.kalsaria@qlogic.com
Subject: Re: [PATCH net-next v2 1/5] qlcnic: Return appropriate error code.
Date: Wed, 31 Jul 2013 17:22:14 -0700 (PDT) [thread overview]
Message-ID: <20130731.172214.697799957184718554.davem@davemloft.net> (raw)
In-Reply-To: <0c731a62dfe618090e3f9fcd7b7dd1de0a243a33.1375314056.git.himanshu.madhani@qlogic.com>
From: Himanshu Madhani <himanshu.madhani@qlogic.com>
Date: Wed, 31 Jul 2013 17:10:58 -0400
> @@ -952,10 +952,11 @@ struct qlcnic_ipaddr {
> #define QLCNIC_LB_BUCKET_SIZE 32
>
> /* QLCNIC Driver Error Code */
> -#define QLCNIC_FW_NOT_RESPOND 51
> +#define QLCNIC_FW_RESPONSE_TIMEOUT 51
> #define QLCNIC_TEST_IN_PROGRESS 52
> #define QLCNIC_UNDEFINED_ERROR 53
> #define QLCNIC_LB_CABLE_NOT_CONN 54
> +#define QLCNIC_LB_IN_PROGRESS 55
> #define QLCNIC_ILB_MAX_RCV_LOOP 10
>
> struct qlcnic_filter {
...
> @@ -1686,13 +1686,13 @@ int qlcnic_83xx_loopback_test(struct net_device *netdev, u8 mode)
> if (test_bit(__QLCNIC_RESETTING, &adapter->state)) {
> netdev_info(netdev,
> "Device is resetting, free LB test resources\n");
> - ret = -EIO;
> + ret = -EBUSY;
> goto free_diag_res;
> }
> if (loop++ > QLC_83XX_LB_WAIT_COUNT) {
> netdev_info(netdev,
> "Firmware didn't sent link up event to loopback request\n");
> - ret = -QLCNIC_FW_NOT_RESPOND;
> + ret = -QLCNIC_FW_RESPONSE_TIMEOUT;
> qlcnic_83xx_clear_lb_mode(adapter, mode);
> goto free_diag_res;
> }
You absolutely cannot do error codes this way.
It is not valid to arbitrarily mix standard E*** error codes with
custom ones you've defined in this driver such as
QLCNIC_FW_RESPONSE_TIMEOUT.
You have no idea what values EIO, EBUSY, etc. take on. They are in fact
different on every single architecture. So they might overlap the
values you've choosen for your custom errors.
Either you use standard error codes for everything, or your own.
I'm not applying these patches, sorry.
next prev parent reply other threads:[~2013-08-01 0:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-31 21:10 [PATCH net-next v2 0/5] qlcnic: Mailbox refactoring Himanshu Madhani
2013-07-31 21:10 ` [PATCH net-next v2 1/5] qlcnic: Return appropriate error code Himanshu Madhani
2013-08-01 0:22 ` David Miller [this message]
2013-07-31 21:10 ` [PATCH net-next v2 2/5] qlcnic: Interrupt based driver firmware mailbox mechanism Himanshu Madhani
2013-07-31 21:11 ` [PATCH net-next v2 3/5] qlcnic: Replace poll mode mailbox interface with interrupt based mailbox interface Himanshu Madhani
2013-07-31 21:11 ` [PATCH net-next v2 4/5] qlcnic: Enable mailbox interface in poll mode when interrupts are not available Himanshu Madhani
2013-07-31 21:11 ` [PATCH net-next v2 5/5] qlcnic: Update version to 5.2.45 Himanshu Madhani
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=20130731.172214.697799957184718554.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Dept_NX_Linux_NIC_Driver@qlogic.com \
--cc=himanshu.madhani@qlogic.com \
--cc=jitendra.kalsaria@qlogic.com \
--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).