netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: zhong jiang <zhongjiang@huawei.com>
To: Michael Chan <michael.chan@broadcom.com>
Cc: David Miller <davem@davemloft.net>,
	Vasundhara Volam <vasundhara-v.volam@broadcom.com>,
	Netdev <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] net: bnxt: Fix a uninitialized variable warning.
Date: Tue, 18 Sep 2018 15:18:35 +0800	[thread overview]
Message-ID: <5BA0A6CB.1010607@huawei.com> (raw)
In-Reply-To: <CACKFLin=rgt7EyWJ-P5jhkAQR5NweCWp-5AZN=FoH+AGpVNZWw@mail.gmail.com>

On 2018/9/18 15:02, Michael Chan wrote:
> On Mon, Sep 17, 2018 at 9:55 PM, zhong jiang <zhongjiang@huawei.com> wrote:
>> Fix the following compile warning:
>>
>> drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c:49:5: warning: ‘nvm_param.dir_type’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>>   if (nvm_param.dir_type == BNXT_NVM_PORT_CFG)
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>>  drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
>> index f3b9fbc..1ae56fc 100644
>> --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
>> +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
>> @@ -46,6 +46,9 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param_id, void *msg,
>>                 }
>>         }
>>
>> +       if (i == ARRAY_SIZE(nvm_params))
>> +               return -EINVAL;
>> +
> -EOPNOTSUPP might be a better return code.  Other than that, it looks
> good to me.  Thanks.
Thanks for suggestion.  Will repost.

Sincerely,
zhong jiang
>>         if (nvm_param.dir_type == BNXT_NVM_PORT_CFG)
>>                 idx = bp->pf.port_id;
>>         else if (nvm_param.dir_type == BNXT_NVM_FUNC_CFG)
>> --
>> 1.7.12.4
>>
>

      reply	other threads:[~2018-09-18  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18  4:55 [PATCH v2] net: bnxt: Fix a uninitialized variable warning zhong jiang
2018-09-18  7:02 ` Michael Chan
2018-09-18  7:18   ` zhong jiang [this message]

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=5BA0A6CB.1010607@huawei.com \
    --to=zhongjiang@huawei.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=vasundhara-v.volam@broadcom.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).