提交 30492c12 编写于 作者: K Krzysztof Wilczyński 提交者: Bjorn Helgaas

PCI: artpec6: Remove local code block from switch statement

The switch statement in the artpec6_pcie_probe() has a local code block
where "val" is defined and immediately used by the artpec6_pcie_readl().

This extra code block adds brackets at the same indentation level as the
switch statement itself which can hinder readability of the code.

Move the "val" declaration to the top of the function and remove
the extra code block from the switch statement.
Suggested-by: NBjorn Helgaas <bhelgaas@google.com>
Link: https://lore.kernel.org/r/20210701204401.1636562-2-kw@linux.comSigned-off-by: NKrzysztof Wilczyński <kw@linux.com>
Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Acked-by: NJesper Nilsson <jesper.nilsson@axis.com>
上级 ee6f8568
...@@ -384,6 +384,7 @@ static int artpec6_pcie_probe(struct platform_device *pdev) ...@@ -384,6 +384,7 @@ static int artpec6_pcie_probe(struct platform_device *pdev)
const struct artpec_pcie_of_data *data; const struct artpec_pcie_of_data *data;
enum artpec_pcie_variants variant; enum artpec_pcie_variants variant;
enum dw_pcie_device_mode mode; enum dw_pcie_device_mode mode;
u32 val;
match = of_match_device(artpec6_pcie_of_match, dev); match = of_match_device(artpec6_pcie_of_match, dev);
if (!match) if (!match)
...@@ -432,9 +433,7 @@ static int artpec6_pcie_probe(struct platform_device *pdev) ...@@ -432,9 +433,7 @@ static int artpec6_pcie_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
return ret; return ret;
break; break;
case DW_PCIE_EP_TYPE: { case DW_PCIE_EP_TYPE:
u32 val;
if (!IS_ENABLED(CONFIG_PCIE_ARTPEC6_EP)) if (!IS_ENABLED(CONFIG_PCIE_ARTPEC6_EP))
return -ENODEV; return -ENODEV;
...@@ -445,7 +444,6 @@ static int artpec6_pcie_probe(struct platform_device *pdev) ...@@ -445,7 +444,6 @@ static int artpec6_pcie_probe(struct platform_device *pdev)
pci->ep.ops = &pcie_ep_ops; pci->ep.ops = &pcie_ep_ops;
return dw_pcie_ep_init(&pci->ep); return dw_pcie_ep_init(&pci->ep);
}
default: default:
dev_err(dev, "INVALID device type %d\n", artpec6_pcie->mode); dev_err(dev, "INVALID device type %d\n", artpec6_pcie->mode);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册