[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 17 Feb 2013 09:40:32 +0000
From: Jitendra Kalsaria <jitendra.kalsaria@...gic.com>
To: Joe Perches <joe@...ches.com>
CC: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
Sony Chacko <sony.chacko@...gic.com>,
Dept-NX Linux NIC Driver
<Dept_NX_Linux_NIC_Driver@...gic.com>
Subject: Re: [PATCH net-next 1/6] qlcnic: fix unsupported CDRP command error
message.
On 2/16/13 9:38 PM, "Joe Perches" <joe@...ches.com> wrote:
>On Sat, 2013-02-16 at 23:53 -0500, Jitendra Kalsaria wrote:
>> From: Jitendra Kalsaria <jitendra.kalsaria@...gic.com>
>>
>> Add debug messages for FW CDRP command failure.
>
>These aren't debug messages but are more detailed.
>
>> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
>>b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
>[]
>> @@ -147,8 +147,36 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter
>>*adapter,
>> cmd->rsp.arg[0] = QLCNIC_RCODE_TIMEOUT;
>> } else if (rsp == QLCNIC_CDRP_RSP_FAIL) {
>> cmd->rsp.arg[0] = QLCRD32(adapter, QLCNIC_CDRP_ARG(1));
>> - dev_err(&pdev->dev, "failed card response code:0x%x\n",
>> - cmd->rsp.arg[0]);
>> + switch (cmd->rsp.arg[0]) {
>> + case QLCNIC_RCODE_INVALID_ARGS:
>> + dev_err(&pdev->dev, "CDRP invalid args 0x%x\n",
>> + cmd->rsp.arg[0]);
>> + break;
>
>Not sure you care about object size much, but
>it's much smaller object code to do:
>
> const char *fmt;
> switch (cmd->rsp.arg[0]);
> case FOO:
> fmt = "...";
> break;
> etc...
> }
>
> dev_err(&pdev->dev, fmt, cmd->rsp.arg[0]);
>
>Also, the #defines are decimal, I don't know why you
>print them out as hex or if you need to print them
>at all really.
Joe,
Yes, your suggestion will definitely reduce object code and we don't
really need
to print them all, will print in decimal. I will re-spin series and submit
again.
Thanks!
Jiten
--
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