Skip to content

Commit c183cf6

Browse files
Shyam Sundar S Kij-intel
authored andcommitted
platform/x86/amd/pmc: Remove unnecessary line breaks
Enhance code readability by fixing line break and blank line inconsistencies. Also make the return variable "rc" as function level local. Co-developed-by: Sanket Goswami <[email protected]> Signed-off-by: Sanket Goswami <[email protected]> Signed-off-by: Shyam Sundar S K <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent e3f1fe9 commit c183cf6

File tree

1 file changed

+11
-13
lines changed
  • drivers/platform/x86/amd/pmc

1 file changed

+11
-13
lines changed

drivers/platform/x86/amd/pmc/pmc.c

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,12 @@ static int amd_pmc_setup_smu_logging(struct amd_pmc_dev *dev)
166166

167167
static int get_metrics_table(struct amd_pmc_dev *pdev, struct smu_metrics *table)
168168
{
169-
if (!pdev->smu_virt_addr) {
170-
int ret = amd_pmc_setup_smu_logging(pdev);
169+
int rc;
171170

172-
if (ret)
173-
return ret;
171+
if (!pdev->smu_virt_addr) {
172+
rc = amd_pmc_setup_smu_logging(pdev);
173+
if (rc)
174+
return rc;
174175
}
175176

176177
if (pdev->cpu_id == AMD_CPU_ID_PCO)
@@ -219,10 +220,10 @@ static ssize_t smu_fw_version_show(struct device *d, struct device_attribute *at
219220
char *buf)
220221
{
221222
struct amd_pmc_dev *dev = dev_get_drvdata(d);
223+
int rc;
222224

223225
if (!dev->major) {
224-
int rc = amd_pmc_get_smu_version(dev);
225-
226+
rc = amd_pmc_get_smu_version(dev);
226227
if (rc)
227228
return rc;
228229
}
@@ -233,10 +234,10 @@ static ssize_t smu_program_show(struct device *d, struct device_attribute *attr,
233234
char *buf)
234235
{
235236
struct amd_pmc_dev *dev = dev_get_drvdata(d);
237+
int rc;
236238

237239
if (!dev->major) {
238-
int rc = amd_pmc_get_smu_version(dev);
239-
240+
rc = amd_pmc_get_smu_version(dev);
240241
if (rc)
241242
return rc;
242243
}
@@ -697,14 +698,14 @@ static struct acpi_s2idle_dev_ops amd_pmc_s2idle_dev_ops = {
697698
static int amd_pmc_suspend_handler(struct device *dev)
698699
{
699700
struct amd_pmc_dev *pdev = dev_get_drvdata(dev);
701+
int rc;
700702

701703
/*
702704
* Must be called only from the same set of dev_pm_ops handlers
703705
* as i8042_pm_suspend() is called: currently just from .suspend.
704706
*/
705707
if (pdev->disable_8042_wakeup && !disable_workarounds) {
706-
int rc = amd_pmc_wa_irq1(pdev);
707-
708+
rc = amd_pmc_wa_irq1(pdev);
708709
if (rc) {
709710
dev_err(pdev->dev, "failed to adjust keyboard wakeup: %d\n", rc);
710711
return rc;
@@ -743,15 +744,13 @@ static int amd_pmc_probe(struct platform_device *pdev)
743744
u32 val;
744745

745746
dev->dev = &pdev->dev;
746-
747747
rdev = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
748748
if (!rdev || !pci_match_id(pmc_pci_ids, rdev)) {
749749
err = -ENODEV;
750750
goto err_pci_dev_put;
751751
}
752752

753753
dev->cpu_id = rdev->device;
754-
755754
if (dev->cpu_id == AMD_CPU_ID_SP || dev->cpu_id == AMD_CPU_ID_SHP) {
756755
dev_warn_once(dev->dev, "S0i3 is not supported on this hardware\n");
757756
err = -ENODEV;
@@ -767,7 +766,6 @@ static int amd_pmc_probe(struct platform_device *pdev)
767766
}
768767

769768
base_addr_lo = val & AMD_PMC_BASE_ADDR_HI_MASK;
770-
771769
err = amd_smn_read(0, AMD_PMC_BASE_ADDR_HI, &val);
772770
if (err) {
773771
dev_err(dev->dev, "error reading 0x%x\n", AMD_PMC_BASE_ADDR_HI);

0 commit comments

Comments
 (0)