[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99737F4847ED0A48AECC9F4A1974A4B80FD1383A36@MNEXMB2.qlogic.org>
Date: Wed, 6 Apr 2011 05:47:30 -0500
From: Amit Salecha <amit.salecha@...gic.com>
To: Stephen Hemminger <shemminger@...tta.com>,
"David S. Miller" <davem@...emloft.net>,
Ben Hutchings <bhutchings@...arflare.com>,
Anirban Chakraborty <anirban.chakraborty@...gic.com>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Sucheta Chakraborty <sucheta.chakraborty@...gic.com>
Subject: RE: [PATCH net-next-2.6 12/12] qlcnic: convert to set_phys_id
> + ret = adapter->nic_ops->config_led(adapter, 1, 0xf);
> if (ret) {
> - clear_bit(__QLCNIC_RESETTING, &adapter->state);
> - return ret;
> + dev_err(&adapter->pdev->dev,
> + "Failed to set LED blink state.\n");
> + break;
> }
> - }
> -
> - ret = adapter->nic_ops->config_led(adapter, 1, 0xf);
> - if (ret) {
> - dev_err(&adapter->pdev->dev,
> - "Failed to set LED blink state.\n");
> - goto done;
> - }
> + return 0;
>
> - msleep_interruptible(val * 1000);
> + case ETHTOOL_ID_INACTIVE:
> + ret = adapter->nic_ops->config_led(adapter, 0, 0xf);
> + if (ret)
> + dev_err(&adapter->pdev->dev,
> + "Failed to reset LED blink state.\n");
> + break;
>
> - ret = adapter->nic_ops->config_led(adapter, 0, 0xf);
> - if (ret) {
> - dev_err(&adapter->pdev->dev,
> - "Failed to reset LED blink state.\n");
> - goto done;
> + default:
> + return -EINVAL;
> }
>
> -done:
> - if (dev_down) {
> + if (!netif_running(dev)) {
> qlcnic_diag_free_res(dev, max_sds_rings);
> clear_bit(__QLCNIC_RESETTING, &adapter->state);
> }
> - return ret;
>
> + return ret;
> }
>
"return ret" is return value of adapter->nic_ops->config_led, which can return any Error value.
And you have special check for -EINVAL. Though currently config_led doesn't return -EINVAL, but in future it may break (as 'ret' comes from config_led() -> send_cmd_desc()).
So it will be better if you return some hard code error value instead of 'ret'.
This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists