From: Xiaofei Tan <tanxiaofei@huawei.com>
To: <rjw@rjwysocki.net>, <lenb@kernel.org>, <rui.zhang@intel.com>,
<bhelgaas@google.com>
Cc: Xiaofei Tan <tanxiaofei@huawei.com>, <linux-acpi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-pci@vger.kernel.org>,
<linuxarm@openeuler.org>
Subject: [PATCH v2 11/15] ACPI: CPPC: fix some coding style issues
Date: Sat, 27 Mar 2021 15:46:29 +0800 [thread overview]
Message-ID: <1616831193-17920-12-git-send-email-tanxiaofei@huawei.com> (raw)
In-Reply-To: <1616831193-17920-1-git-send-email-tanxiaofei@huawei.com>
Fix some coding style issues reported by checkpatch.pl, including
following types:
WARNING: Missing a blank line after declarations
WARNING: unnecessary whitespace before a quoted newline
ERROR: spaces required around that '>='
ERROR: switch and case should be at the same indent
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
---
drivers/acpi/cppc_acpi.c | 71 ++++++++++++++++++++++++------------------------
1 file changed, 36 insertions(+), 35 deletions(-)
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c
index ae53740..3dbaf47 100644
--- a/drivers/acpi/cppc_acpi.c
+++ b/drivers/acpi/cppc_acpi.c
@@ -326,6 +326,7 @@ static int send_pcc_cmd(int pcc_ss_id, u16 cmd)
if (unlikely(ret)) {
for_each_possible_cpu(i) {
struct cpc_desc *desc = per_cpu(cpc_desc_ptr, i);
+
if (!desc)
continue;
@@ -777,7 +778,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
cpc_ptr->cpc_regs[i-2].type = ACPI_TYPE_BUFFER;
memcpy(&cpc_ptr->cpc_regs[i-2].cpc_entry.reg, gas_t, sizeof(*gas_t));
} else {
- pr_debug("Err in entry:%d in CPC table of CPU:%d \n", i, pr->id);
+ pr_debug("Err in entry:%d in CPC table of CPU:%d\n", i, pr->id);
goto out_free;
}
}
@@ -867,7 +868,7 @@ void acpi_cppc_processor_exit(struct acpi_processor *pr)
void __iomem *addr;
int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, pr->id);
- if (pcc_ss_id >=0 && pcc_data[pcc_ss_id]) {
+ if (pcc_ss_id >= 0 && pcc_data[pcc_ss_id]) {
if (pcc_data[pcc_ss_id]->pcc_channel_acquired) {
pcc_data[pcc_ss_id]->refcount--;
if (!pcc_data[pcc_ss_id]->refcount) {
@@ -954,22 +955,22 @@ static int cpc_read(int cpu, struct cpc_register_resource *reg_res, u64 *val)
val, reg->bit_width);
switch (reg->bit_width) {
- case 8:
- *val = readb_relaxed(vaddr);
- break;
- case 16:
- *val = readw_relaxed(vaddr);
- break;
- case 32:
- *val = readl_relaxed(vaddr);
- break;
- case 64:
- *val = readq_relaxed(vaddr);
- break;
- default:
- pr_debug("Error: Cannot read %u bit width from PCC for ss: %d\n",
- reg->bit_width, pcc_ss_id);
- ret_val = -EFAULT;
+ case 8:
+ *val = readb_relaxed(vaddr);
+ break;
+ case 16:
+ *val = readw_relaxed(vaddr);
+ break;
+ case 32:
+ *val = readl_relaxed(vaddr);
+ break;
+ case 64:
+ *val = readq_relaxed(vaddr);
+ break;
+ default:
+ pr_debug("Error: Cannot read %u bit width from PCC for ss: %d\n",
+ reg->bit_width, pcc_ss_id);
+ ret_val = -EFAULT;
}
return ret_val;
@@ -993,23 +994,23 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
val, reg->bit_width);
switch (reg->bit_width) {
- case 8:
- writeb_relaxed(val, vaddr);
- break;
- case 16:
- writew_relaxed(val, vaddr);
- break;
- case 32:
- writel_relaxed(val, vaddr);
- break;
- case 64:
- writeq_relaxed(val, vaddr);
- break;
- default:
- pr_debug("Error: Cannot write %u bit width to PCC for ss: %d\n",
- reg->bit_width, pcc_ss_id);
- ret_val = -EFAULT;
- break;
+ case 8:
+ writeb_relaxed(val, vaddr);
+ break;
+ case 16:
+ writew_relaxed(val, vaddr);
+ break;
+ case 32:
+ writel_relaxed(val, vaddr);
+ break;
+ case 64:
+ writeq_relaxed(val, vaddr);
+ break;
+ default:
+ pr_debug("Error: Cannot write %u bit width to PCC for ss: %d\n",
+ reg->bit_width, pcc_ss_id);
+ ret_val = -EFAULT;
+ break;
}
return ret_val;
--
2.8.1
next prev parent reply other threads:[~2021-03-27 7:50 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-27 7:46 [PATCH v2 00/15] acpi: fix some coding style issues Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 01/15] ACPI: APD: fix a block comment align issue Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 02/15] ACPI: processor: fix some coding style issues Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 03/15] ACPI: debug: " Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 04/15] ACPI: table: replace __attribute__((packed)) by __packed Xiaofei Tan
2021-03-29 10:09 ` David Laight
2021-03-30 2:23 ` Xiaofei Tan
2021-03-30 7:31 ` Zhang Rui
2021-03-30 7:59 ` Zhang Rui
2021-03-30 8:14 ` David Laight
2021-03-30 17:00 ` Rafael J. Wysocki
2021-03-31 15:55 ` Zhang Rui
2021-03-31 16:14 ` David Laight
2021-03-31 17:22 ` Bjorn Helgaas
2021-04-01 8:59 ` David Laight
2021-04-01 13:49 ` Rafael J. Wysocki
2021-04-01 14:23 ` David Laight
2021-04-01 17:29 ` Rafael J. Wysocki
2021-03-27 7:46 ` [PATCH v2 05/15] ACPI: ipmi: remove useless return statement for void function Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 06/15] ACPI: LPSS: fix some coding style issues Xiaofei Tan
[not found] ` <CAHp75Vc+0hxLS_Ab7_VZfrG2jiQzvia9S=o+Gc+wg+vVk1Z39w@mail.gmail.com>
2021-03-27 9:55 ` Xiaofei Tan
[not found] ` <CAHp75Vd0hVqsfsZK=d1dz98Kbchqz-w4RqQQp6FwisxSGG5BzA@mail.gmail.com>
2021-03-27 9:58 ` Xiaofei Tan
2021-03-27 13:39 ` Joe Perches
2021-03-27 16:39 ` Andy Shevchenko
2021-03-27 7:46 ` [PATCH v2 07/15] ACPI: memhotplug: fix a coding style issue Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 08/15] ACPI: acpi_pad: " Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 09/15] ACPI: battery: fix some coding style issues Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 10/15] ACPI: button: " Xiaofei Tan
2021-03-27 7:46 ` Xiaofei Tan [this message]
2021-03-27 7:46 ` [PATCH v2 12/15] ACPI: custom_method: fix a coding style issue Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 13/15] ACPI: PM: fix some coding style issues Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 14/15] ACPI: sysfs: " Xiaofei Tan
2021-03-27 7:46 ` [PATCH v2 15/15] ACPI: dock: " Xiaofei Tan
[not found] ` <CAHp75VcwuFYWRYfVPxbqa4TFGgqOhHc_soefmTAZcGGk3bLuhw@mail.gmail.com>
2021-03-27 10:00 ` [PATCH 00/15] acpi: " Xiaofei Tan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1616831193-17920-12-git-send-email-tanxiaofei@huawei.com \
--to=tanxiaofei@huawei.com \
--cc=bhelgaas@google.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxarm@openeuler.org \
--cc=rjw@rjwysocki.net \
--cc=rui.zhang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).