From patchwork Thu Jul 1 20:44:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= X-Patchwork-Id: 12355089 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 9742CC11F67 for ; Thu, 1 Jul 2021 20:44:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 741C7613FE for ; Thu, 1 Jul 2021 20:44:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233425AbhGAUqf (ORCPT ); Thu, 1 Jul 2021 16:46:35 -0400 Received: from mail-lj1-f170.google.com ([209.85.208.170]:41897 "EHLO mail-lj1-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbhGAUqf (ORCPT ); Thu, 1 Jul 2021 16:46:35 -0400 Received: by mail-lj1-f170.google.com with SMTP id h6so10263380ljl.8 for ; Thu, 01 Jul 2021 13:44:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kQF8cLAtr4vueW7JSMUMX/IBfK/Lv//HrORl0QoGClk=; b=TA6Fod1aWN2YoC7zdytK6spFM0+NujFcK0f6OIW5GYfR/VqlVkSC8vRTpBFHPHEVCp a5aoUZc94xxsK8fjx90VLvNzXf6q0HsacyEEW4Yh+h9yUEoruCRg9dQKCPOYumBu0VYl HgqiwKFMANyvVVdiuBuJV1ppXgPB4iU5Ws8UrQWTqxeYTL5NSMTCKLTbrqrwuB9DUh+2 Z5Cp+s6C1rCiXH3Tek2wpvIsISN2HFhSPsLo7obyytHzzjVvS4G9E8Oux+XvN98wJMXu T4c6cmdw32wQee9N/e242GO5WFJJZRdsTaMIFvE2U18uxiQDYFK4Gx+Q/VZROsV1v2AR e6SQ== X-Gm-Message-State: AOAM532hyfx0+pTRQoC05mfpTA6S2yFc3I9WyXnk3R4hyXNH8IcQ21Wj fGU/2xLVdZmw41PoNluSRwc= X-Google-Smtp-Source: ABdhPJxsNX3q+LRBdTiuUvN3gUVBZL29ogbKwTVEs4+iAwE0kaiAYYiTHT+ozqWLZjJVmS0oIIGzZg== X-Received: by 2002:a2e:a706:: with SMTP id s6mr1063996lje.169.1625172243348; Thu, 01 Jul 2021 13:44:03 -0700 (PDT) Received: from workstation.lan ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id w8sm69942lfq.27.2021.07.01.13.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 13:44:02 -0700 (PDT) From: =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= To: Jesper Nilsson Cc: Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , linux-pci@vger.kernel.org Subject: [PATCH v2 1/2] PCI: artpec6: Remove surplus break statement after return Date: Thu, 1 Jul 2021 20:44:00 +0000 Message-Id: <20210701204401.1636562-1-kw@linux.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org As part of code refactoring completed in the commit a0fd361db8e5 ("PCI: dwc: Move "dbi", "dbi2", and "addr_space" resource setup into common code") the function artpec6_add_pcie_ep() has been removed and the call to the dw_pcie_ep_init() has been moved into artpec6_pcie_probe(). This change left a break statement behind that is not needed any more as as the function artpec6_pcie_probe() return immediately after making a call to dw_pcie_ep_init(). Thus remove this surplus break statement that became a dead code. Signed-off-by: Krzysztof Wilczyński Acked-by: Jesper Nilsson --- drivers/pci/controller/dwc/pcie-artpec6.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-artpec6.c b/drivers/pci/controller/dwc/pcie-artpec6.c index 597c282f586c..739871bece75 100644 --- a/drivers/pci/controller/dwc/pcie-artpec6.c +++ b/drivers/pci/controller/dwc/pcie-artpec6.c @@ -445,7 +445,6 @@ static int artpec6_pcie_probe(struct platform_device *pdev) pci->ep.ops = &pcie_ep_ops; return dw_pcie_ep_init(&pci->ep); - break; } default: dev_err(dev, "INVALID device type %d\n", artpec6_pcie->mode); From patchwork Thu Jul 1 20:44:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= X-Patchwork-Id: 12355091 X-Patchwork-Delegate: lorenzo.pieralisi@arm.com 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 9FDB8C11F6A for ; Thu, 1 Jul 2021 20:44:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84252613FE for ; Thu, 1 Jul 2021 20:44:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233491AbhGAUqg (ORCPT ); Thu, 1 Jul 2021 16:46:36 -0400 Received: from mail-lj1-f180.google.com ([209.85.208.180]:43606 "EHLO mail-lj1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229934AbhGAUqg (ORCPT ); Thu, 1 Jul 2021 16:46:36 -0400 Received: by mail-lj1-f180.google.com with SMTP id f13so10257676ljp.10 for ; Thu, 01 Jul 2021 13:44:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iVS1NuRQOjDJx0zHL86NloP+4ltmCaJEZU9LmlzJl70=; b=BPHhabjIkw1LqeiDQJPSU/Wfgk7Yc3GTvVFKNBHnGp8WYMcsRsAUcHr66nZwSUGc6O CG9RNjYgq2MqJpoq9jcYl3m5n+et2jbE1Jk2btOxsO8NybCfJh0hRnrOKZ3q5bJFtLXK K8HMDNaAdFR5m/SNfbxaNMTYFMoSKk7gICC05kBKZaqbrW37w5y//bG6/zNAdUjicnub S/H+Cw2C2VaQkD/98eUVFaVd8jZuG/GIPn3ytCWuLlgU6a+c5Fo6Grpdf5PUaIjZVh7b t05+H5k0sxobzy6pcC2FsGCD6+IKWeAjZrNdqDMa5QfjBTJgctdBcMjN5DTJjNvHVozN PsKw== X-Gm-Message-State: AOAM530I3PyenF4e82yMWAcSEV3fXANZTYwHt5TBWnwjqJzW9aPQwV8k R/wC7iS0+twl2bQrL86GBYQ= X-Google-Smtp-Source: ABdhPJxPjttGkitm9boSf7BhGN32AdPEJM6o9g14HbYXUz3SqqvQHZLSPPSBHc4jwawNaMO5/arCxA== X-Received: by 2002:a2e:9010:: with SMTP id h16mr1084171ljg.118.1625172244445; Thu, 01 Jul 2021 13:44:04 -0700 (PDT) Received: from workstation.lan ([95.155.85.46]) by smtp.gmail.com with ESMTPSA id w8sm69942lfq.27.2021.07.01.13.44.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 13:44:03 -0700 (PDT) From: =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= To: Jesper Nilsson Cc: Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , linux-pci@vger.kernel.org Subject: [PATCH v2 2/2] PCI: artpec6: Remove local code block from within switch statement Date: Thu, 1 Jul 2021 20:44:01 +0000 Message-Id: <20210701204401.1636562-2-kw@linux.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210701204401.1636562-1-kw@linux.com> References: <20210701204401.1636562-1-kw@linux.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org At the moment, the switch statement in the artpec6_pcie_probe() has a local code block where the local variable "val" is defined and immediately used by the artpec6_pcie_readl() within this local scope. This extra code block adds brackets at the same indentation level as the switch statement itself which can hinder readability of the code. Thus, move the variable "val" declaration and definition at the top of the function where other variables are already present, and remove the extra code block from within the select statement. This also is the preferred style in the PCI tree. Suggested-by: Bjorn Helgaas Signed-off-by: Krzysztof Wilczyński Acked-by: Jesper Nilsson --- drivers/pci/controller/dwc/pcie-artpec6.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-artpec6.c b/drivers/pci/controller/dwc/pcie-artpec6.c index 739871bece75..c91fc1954432 100644 --- a/drivers/pci/controller/dwc/pcie-artpec6.c +++ b/drivers/pci/controller/dwc/pcie-artpec6.c @@ -384,6 +384,7 @@ static int artpec6_pcie_probe(struct platform_device *pdev) const struct artpec_pcie_of_data *data; enum artpec_pcie_variants variant; enum dw_pcie_device_mode mode; + u32 val; match = of_match_device(artpec6_pcie_of_match, dev); if (!match) @@ -432,9 +433,7 @@ static int artpec6_pcie_probe(struct platform_device *pdev) if (ret < 0) return ret; break; - case DW_PCIE_EP_TYPE: { - u32 val; - + case DW_PCIE_EP_TYPE: if (!IS_ENABLED(CONFIG_PCIE_ARTPEC6_EP)) return -ENODEV; @@ -445,7 +444,6 @@ static int artpec6_pcie_probe(struct platform_device *pdev) pci->ep.ops = &pcie_ep_ops; return dw_pcie_ep_init(&pci->ep); - } default: dev_err(dev, "INVALID device type %d\n", artpec6_pcie->mode); }