From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FE94C2BA2B for ; Fri, 17 Apr 2020 03:24:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0791721D94 for ; Fri, 17 Apr 2020 03:24:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729136AbgDQDYP (ORCPT ); Thu, 16 Apr 2020 23:24:15 -0400 Received: from mga04.intel.com ([192.55.52.120]:22715 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728444AbgDQDYO (ORCPT ); Thu, 16 Apr 2020 23:24:14 -0400 IronPort-SDR: uRabRcaaOmb+cf1MiuROWjs7h8iT0TDopivNXN8HK7fJixhXf3x2w0WDXGbGKq78/nFT2fx9rk b5+qb1bOWYHA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2020 20:24:14 -0700 IronPort-SDR: vm7kEmXJN0BsDyOFZzfPgeTZf2QaefCY0zx1kjPSt7pVlPucMluF6jzrfE1Y6kcew5SMLDtqeZ f0IdLxZxxWtA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,393,1580803200"; d="scan'208";a="254081720" Received: from yilunxu-optiplex-7050.sh.intel.com (HELO localhost) ([10.239.159.141]) by orsmga003.jf.intel.com with ESMTP; 16 Apr 2020 20:24:11 -0700 Date: Fri, 17 Apr 2020 11:21:32 +0800 From: Xu Yilun To: "Wu, Hao" Cc: Tom Rix , "mdf@kernel.org" , "linux-fpga@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "bhu@redhat.com" Subject: Re: [PATCH 1/2] fpga: dfl: pci: reduce the scope of variable 'ret' Message-ID: <20200417032132.GA25293@yilunxu-OptiPlex-7050> References: <1587006712-22696-1-git-send-email-yilun.xu@intel.com> <1587006712-22696-2-git-send-email-yilun.xu@intel.com> <9b1d85e0-4f44-179b-c847-af858fcc212a@redhat.com> <20200417015605.GA30618@yilunxu-OptiPlex-7050> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 17, 2020 at 11:05:16AM +0800, Wu, Hao wrote: > > -----Original Message----- > > From: Xu, Yilun > > Sent: Friday, April 17, 2020 9:56 AM > > To: Tom Rix > > Cc: Wu, Hao ; mdf@kernel.org; linux- > > fpga@vger.kernel.org; linux-kernel@vger.kernel.org; bhu@redhat.com > > Subject: Re: [PATCH 1/2] fpga: dfl: pci: reduce the scope of variable 'ret' > > > > Hi Rix: > > > > This patch is based on linux-next. There is an preceding patch > > (3c2760b78f90 "fpga: dfl: pci: fix return value of cci_pci_sriov_configure", > > Also see Fixes:) in linux-next but not merged in 5.7-rc1 yet. > > This patch is to fix the lkp warning brought by the previous one. > > Yilun > > Is it possible that commit id may be different for master then? It is possible if the previous patch need a little change when merging to master. I'm not sure how to handle this then. But the previous patch is simple and is unlikely to change. > > Thanks > Hao > > > > > Thanks. > > > > On Thu, Apr 16, 2020 at 09:56:47AM -0700, Tom Rix wrote: > > > Please check the scope. > > > > > > On linus/master, the result of this change looks like > > > > > > static int cci_pci_sriov_configure(struct pci_dev *pcidev, int num_vfs) > > > { > > > struct cci_drvdata *drvdata = pci_get_drvdata(pcidev); > > > struct dfl_fpga_cdev *cdev = drvdata->cdev; > > > > > > if (!num_vfs) { > > > /* > > > * disable SRIOV and then put released ports back to default > > > * PF access mode. > > > */ > > > pci_disable_sriov(pcidev); > > > > > > dfl_fpga_cdev_config_ports_pf(cdev); > > > > > > } else { > > > int ret; <--- defined here > > > > > > /* > > > * before enable SRIOV, put released ports into VF access mode > > > * first of all. > > > */ > > > ret = dfl_fpga_cdev_config_ports_vf(cdev, num_vfs); > > > if (ret) > > > return ret; > > > > > > ret = pci_enable_sriov(pcidev, num_vfs); > > > if (ret) > > > dfl_fpga_cdev_config_ports_pf(cdev); > > > } > > > > > > return ret; <---- not in scope, not defined here > > > } > > > > > > Tom