Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4253278imm; Mon, 17 Sep 2018 10:37:13 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda0Yry3kAGgAbXPzdUssjLTgv9jZZJY/iiJ+xDn8csyCe36vGyV7lP0hn0LVP8e2brekFLc X-Received: by 2002:a17:902:6ac5:: with SMTP id i5-v6mr25900681plt.232.1537205833868; Mon, 17 Sep 2018 10:37:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537205833; cv=none; d=google.com; s=arc-20160816; b=faonhvtjT9w7zYXUUAD/YCgOceJXcSyldoYY5Y8Qwm4t3dfVVuvBkq6ZwnAgxrgVOD Bt9tR+2ANO2UAFej/nQ4m1Bd0Rb/7Rx8y0PZfixs/iAobWyvFLA2DVZhcsFU+y7lt9FI oL+F0YynUaNCWUVlaiRU6R+jo0j4IdRVn3N22lIx5BTPw66G+I8PzvQ9YXAniL/5KPR7 3/U+KJYQKIr8Hbaw7Ic56+Q+PJtmlEkES6MH0Cx8Lj4ZKg0quWqxkAuiiR1gFvgcUwXg TzI89DLToa3qlmHGQchtlSI2kiQnoFkIAwB1mrBP+FMYyCck8q3rvbPT4Q3HqT12P7YY 69kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature; bh=jz/n715l7yeDb+a60gPQwWqZ9gZkVJ2S82jYv8jKC2c=; b=qSRORIYIL1jlQ2bKk2OeO/HLmJoocmpr7YZ7P3sMX2HefQIbzqBT/Ejn9p+NUQYJ9P p/23TIw7wnb83ykhXaValX5bVXqzvD/ffz7PzEOgzXycbVP2OhSvcFFoc+hnwUku0YSz uU6nK4LoviTyfHXGDNZvkzelnML2czA/bITxdNglg3dZeISBWsm2/GQ72t2/3Dd/fJT+ God8PWxL3eNkB1kGbBwAWqSZ5XzTW40HIdA5dRGhynXHFzs9m9EsCP90FEVZaprUYN+W BEQvBmthns2IIg1Xc/tn/HKLnRDn71VDwQS+I84mniQZHVlhgFyxRC3cB778i/rbNlHd JHgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=fMG7xqKm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v2-v6si17110791pfv.57.2018.09.17.10.36.53; Mon, 17 Sep 2018 10:37:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=fMG7xqKm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728311AbeIQXFG (ORCPT + 99 others); Mon, 17 Sep 2018 19:05:06 -0400 Received: from mail-yw1-f68.google.com ([209.85.161.68]:42115 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727089AbeIQXFG (ORCPT ); Mon, 17 Sep 2018 19:05:06 -0400 Received: by mail-yw1-f68.google.com with SMTP id n207-v6so5780130ywn.9 for ; Mon, 17 Sep 2018 10:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=jz/n715l7yeDb+a60gPQwWqZ9gZkVJ2S82jYv8jKC2c=; b=fMG7xqKmi1v1MxQAt5ce85Vd5RigBwDUkg7uNtrhMsV/vy8Z0mBKAxRApA6xC+Kux+ /3Znh9Qex567f7Lx1KJbY5TBAAR5sBbwhRfAN4Il14qV/QyeE7wOpMIpIOIOTunRK6j6 JkyMODMhJKMBxNpl3qWhcAOZMuwrN3wFSh68g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=jz/n715l7yeDb+a60gPQwWqZ9gZkVJ2S82jYv8jKC2c=; b=BDrsWsSGdgipYvzMkr25F2ICA9/PnowYCmsaoU5UwF+GoaLUxGrqVKjtViY1iKOAwG PBa/BOIyPQ8b54rCdfeAKjyEnIrRCFVw0R7q8UxHO5O8gT16Cc+UDEJbt8lvsen9tNiA PbK0E/VUW9YFhWXuTPljKH7pcNwLm10ZfpK8bmwt2WoaCwhYcnCbFei+U57pGkng5Jym 6i8oqARLZSrlwO07sZ18LSkr40OsmS6Eyh6LwS0SSkn7G4ASbIb9AEFKIpPuzSkEcPh5 xX58OGtPvB5FkEBlL2OGWNaXE5o3IzyVfO3pdDmxooYmBcrVVsPWhxlPpGci25uTPcRB VfWQ== X-Gm-Message-State: APzg51A+iHJSF40lPU2wr3nWhHRiFeBlxrdsyXj8Bgg393vH5ObP61Bu 3ssIzi1LAuFZDE/ylse7wb6LmvcU861Tu3imiKPROA== X-Received: by 2002:a0d:e251:: with SMTP id l78-v6mr10973852ywe.218.1537205805015; Mon, 17 Sep 2018 10:36:45 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:7d84:0:0:0:0:0 with HTTP; Mon, 17 Sep 2018 10:36:44 -0700 (PDT) In-Reply-To: <1537201883-2518-1-git-send-email-zhongjiang@huawei.com> References: <1537201883-2518-1-git-send-email-zhongjiang@huawei.com> From: Michael Chan Date: Mon, 17 Sep 2018 10:36:44 -0700 Message-ID: Subject: Re: [PATCH] net: bnxt: Fix a uninitialized variable warning. To: zhong jiang , Vasundhara Volam Cc: David Miller , Netdev , open list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 17, 2018 at 9:31 AM, zhong jiang wrote: > > Fix the following compile warning: > > drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c:49:5: warning: =E2=80= =98nvm_param.dir_type=E2=80=99 may be used uninitialized in this function [= -Wmaybe-uninitialized] > if (nvm_param.dir_type =3D=3D BNXT_NVM_PORT_CFG) > > Signed-off-by: zhong jiang > --- > drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c b/drivers/= net/ethernet/broadcom/bnxt/bnxt_devlink.c > index f3b9fbc..ab88217 100644 > --- a/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c > +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c > @@ -31,7 +31,7 @@ static int bnxt_hwrm_nvm_req(struct bnxt *bp, u32 param= _id, void *msg, > { > struct hwrm_nvm_get_variable_input *req =3D msg; > void *data_addr =3D NULL, *buf =3D NULL; > - struct bnxt_dl_nvm_param nvm_param; > + struct bnxt_dl_nvm_param nvm_param =3D {0}; > int bytesize, idx =3D 0, rc, i; > dma_addr_t data_dma_addr; > I think it is better to return error if there is no param_id match after the for loop. The for loop will initialize nvm_param if there is param_id match.