Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752034AbdFOVLf (ORCPT ); Thu, 15 Jun 2017 17:11:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:34288 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751644AbdFOVLd (ORCPT ); Thu, 15 Jun 2017 17:11:33 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2C92219A7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Thu, 15 Jun 2017 16:11:30 -0500 From: Bjorn Helgaas To: Ryder Lee Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] PCI: mediatek: fix error handling in mtk_pcie_parse_and_add_res() Message-ID: <20170615211130.GF12735@bhelgaas-glaptop.roam.corp.google.com> References: <1496644078-27122-1-git-send-email-ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1496644078-27122-1-git-send-email-ryder.lee@mediatek.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1675 Lines: 52 On Mon, Jun 05, 2017 at 02:27:58PM +0800, Ryder Lee wrote: > The 'linkup' variable would always increment by one whether the link > status is true or not. Therefore, this patch fixes the return value in > mtk_pcie_parse_and_add_res() and removes unnecessary 'linkup' variable. > > Signed-off-by: Ryder Lee I folded this into pci/host-mediatek for v4.13, thanks! I just noticed that we didn't get a MAINTAINERS update for this driver. Can you send me that, too, please? > --- > drivers/pci/host/pcie-mediatek.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/pci/host/pcie-mediatek.c b/drivers/pci/host/pcie-mediatek.c > index 8ec8fa8..3baafa8 100644 > --- a/drivers/pci/host/pcie-mediatek.c > +++ b/drivers/pci/host/pcie-mediatek.c > @@ -373,7 +373,7 @@ static int mtk_pcie_parse_and_add_res(struct mtk_pcie *pcie) > struct of_pci_range_parser parser; > struct of_pci_range range; > struct resource res; > - int err, linkup = 0; > + int err; > > /* parse shared resources */ > err = mtk_pcie_handle_shared_resource(pcie); > @@ -444,11 +444,11 @@ static int mtk_pcie_parse_and_add_res(struct mtk_pcie *pcie) > > /* enable each port, and then check link status */ > err = mtk_pcie_enable_ports(port); > - if (!err) > - linkup++; > + if (err) > + return err; > } > > - return !linkup; > + return 0; > } > > static int mtk_pcie_request_resources(struct mtk_pcie *pcie) > -- > 1.9.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel