Message ID | 20200921131053.92752-1-miaoqinglang@huawei.com (mailing list archive) |
---|---|
State | Accepted, archived |
Delegated to: | Lorenzo Pieralisi |
Headers | show |
Series | [-next] PCI: cadence: simplify the return expression of cdns_pcie_host_init_address_translation() | expand |
On Mon, 21 Sep 2020 21:10:53 +0800, Qinglang Miao wrote: > Simplify the return expression. > > Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> > --- > drivers/pci/controller/cadence/pcie-cadence-host.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > Reviewed-by: Rob Herring <robh@kernel.org>
On Mon, Sep 21, 2020 at 09:10:53PM +0800, Qinglang Miao wrote: > Simplify the return expression. > > Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> > --- > drivers/pci/controller/cadence/pcie-cadence-host.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) Applied to pci/cadence, thanks. Lorenzo > diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c > index 4550e0d46..811c1cb2e 100644 > --- a/drivers/pci/controller/cadence/pcie-cadence-host.c > +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c > @@ -337,7 +337,7 @@ static int cdns_pcie_host_init_address_translation(struct cdns_pcie_rc *rc) > struct resource_entry *entry; > u64 cpu_addr = cfg_res->start; > u32 addr0, addr1, desc1; > - int r, err, busnr = 0; > + int r, busnr = 0; > > entry = resource_list_first_type(&bridge->windows, IORESOURCE_BUS); > if (entry) > @@ -383,11 +383,7 @@ static int cdns_pcie_host_init_address_translation(struct cdns_pcie_rc *rc) > r++; > } > > - err = cdns_pcie_host_map_dma_ranges(rc); > - if (err) > - return err; > - > - return 0; > + return cdns_pcie_host_map_dma_ranges(rc); > } > > static int cdns_pcie_host_init(struct device *dev, > -- > 2.23.0 >
diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c index 4550e0d46..811c1cb2e 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-host.c +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c @@ -337,7 +337,7 @@ static int cdns_pcie_host_init_address_translation(struct cdns_pcie_rc *rc) struct resource_entry *entry; u64 cpu_addr = cfg_res->start; u32 addr0, addr1, desc1; - int r, err, busnr = 0; + int r, busnr = 0; entry = resource_list_first_type(&bridge->windows, IORESOURCE_BUS); if (entry) @@ -383,11 +383,7 @@ static int cdns_pcie_host_init_address_translation(struct cdns_pcie_rc *rc) r++; } - err = cdns_pcie_host_map_dma_ranges(rc); - if (err) - return err; - - return 0; + return cdns_pcie_host_map_dma_ranges(rc); } static int cdns_pcie_host_init(struct device *dev,
Simplify the return expression. Signed-off-by: Qinglang Miao <miaoqinglang@huawei.com> --- drivers/pci/controller/cadence/pcie-cadence-host.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)