Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1480554 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2016-09-10 11:40 +0200 |
| Last post | 2016-09-10 12:20 +0200 |
| Articles | 20 on this page of 30 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 00/30] ACPI-processor: Fine-tuning for several function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:40 +0200
[PATCH 03/30] ACPI-processor: Rename jump labels in acpi_processor_get_performance_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200
[PATCH 05/30] ACPI-processor: Rename jump labels in acpi_processor_preregister_performance() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200
[PATCH 04/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_performance_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200
[PATCH 08/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_psd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200
[PATCH 07/30] ACPI-processor: Rename jump labels in acpi_processor_get_psd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200
[PATCH 06/30] ACPI-processor: Move a success indication in acpi_processor_preregister_performance() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 11:50 +0200
[PATCH 15/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_get_platform_limit() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200
[PATCH 17/30] ACPI-processor: Improve another size determination in acpi_processor_get_throttling_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200
[PATCH 10/30] ACPI-processor: Rename jump labels in acpi_processor_get_performance_control() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200
[PATCH 16/30] ACPI-processor: Use kmalloc_array() in acpi_processor_get_throttling_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200
[PATCH 11/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_performance_control() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200
[PATCH 09/30] ACPI-processor: Improve a size determination in acpi_processor_get_psd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200
[PATCH 14/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_get_performance_info() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200
Re: [PATCH 00/30] ACPI-processor: Fine-tuning for several function implementations Paolo Bonzini <pbonzini@redhat.com> - 2016-09-10 12:00 +0200
[PATCH 13/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_ppc_notifier() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200
[PATCH 12/30] ACPI-processor: Rename jump labels in acpi_processor_ppc_notifier() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:00 +0200
[PATCH 23/30] ACPI-processor: Improve a size determination in acpi_processor_get_tsd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200
[PATCH 25/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_throttling_control() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200
[PATCH 27/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_reevaluate_tstate() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200
[PATCH 26/30] ACPI-processor: Fix jump targets in acpi_processor_reevaluate_tstate() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200
[PATCH 19/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_throttling_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200
[PATCH 18/30] ACPI-processor: Rename jump labels in acpi_processor_get_throttling_states() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200
[PATCH 21/30] ACPI-processor: Rename jump labels in acpi_processor_get_tsd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200
[PATCH 22/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_tsd() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200
[PATCH 24/30] ACPI-processor: Rename jump labels in acpi_processor_get_throttling_control() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200
[PATCH 20/30] ACPI-processor: Fix jump targets in acpi_processor_get_throttling_info() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:10 +0200
[PATCH 29/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_get_platform_limit() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:20 +0200
[PATCH 28/30] ACPI-processor: Rename a jump label in acpi_processor_get_platform_limit() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:20 +0200
[PATCH 30/30] ACPI-processor: Improve jump targets in acpi_processor_update_tsd_coord() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-09-10 12:20 +0200
Page 1 of 2 [1] 2 Next page →
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 11:40 +0200 |
| Subject | [PATCH 00/30] ACPI-processor: Fine-tuning for several function implementations |
| Message-ID | <sfMVr-6Un-3@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Tue, 9 Sep 2016 20:15:05 +0200 Several update suggestions were taken into account from static source code analysis. Markus Elfring (30): Use kmalloc_array() in acpi_processor_get_performance_states() Improve two size determinations in acpi_processor_get_performance_states() Rename jump labels in acpi_processor_get_performance_states() Delete two unnecessary initialisations in acpi_processor_get_performance_states() Rename jump labels in acpi_processor_preregister_performance() Move a success indication in acpi_processor_preregister_performance() Rename jump labels in acpi_processor_get_psd() Delete two unnecessary initialisations in acpi_processor_get_psd() Improve a size determination in acpi_processor_get_psd() Rename jump labels in acpi_processor_get_performance_control() Delete two unnecessary initialisations in acpi_processor_get_performance_control() Rename jump labels in acpi_processor_ppc_notifier() Delete an unnecessary initialisation in acpi_processor_ppc_notifier() Delete an unnecessary initialisation in acpi_processor_get_performance_info() Delete an unnecessary initialisation in acpi_processor_get_platform_limit() Use kmalloc_array() in acpi_processor_get_throttling_states() Improve another size determination in acpi_processor_get_throttling_states() Rename jump labels in acpi_processor_get_throttling_states() Delete two unnecessary initialisations in acpi_processor_get_throttling_states() Fix jump targets in acpi_processor_get_throttling_info() Rename jump labels in acpi_processor_get_tsd() Delete two unnecessary initialisations in acpi_processor_get_tsd() Improve a size determination in acpi_processor_get_tsd() Rename jump labels in acpi_processor_get_throttling_control() Delete two unnecessary initialisations in acpi_processor_get_throttling_control() Fix jump targets in acpi_processor_reevaluate_tstate() Delete an unnecessary initialisation in acpi_processor_reevaluate_tstate() Rename a jump label in acpi_processor_get_platform_limit() Delete an unnecessary initialisation in acpi_processor_get_platform_limit() Improve jump targets in acpi_processor_update_tsd_coord() drivers/acpi/processor_perflib.c | 87 +++++++++++++-------------- drivers/acpi/processor_throttling.c | 116 ++++++++++++++++-------------------- 2 files changed, 93 insertions(+), 110 deletions(-) -- 2.10.0
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 11:50 +0200 |
| Subject | [PATCH 03/30] ACPI-processor: Rename jump labels in acpi_processor_get_performance_states() |
| Message-ID | <sfN57-6Xu-3@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 11:27:45 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 004e24c..49889b1 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -339,7 +339,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
if (!pss || (pss->type != ACPI_TYPE_PACKAGE)) {
printk(KERN_ERR PREFIX "Invalid _PSS data\n");
result = -EFAULT;
- goto end;
+ goto free_buffer;
}
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found %d performance states\n",
@@ -351,7 +351,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
GFP_KERNEL);
if (!pr->performance->states) {
result = -ENOMEM;
- goto end;
+ goto free_buffer;
}
for (i = 0; i < pr->performance->state_count; i++) {
@@ -369,7 +369,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
ACPI_EXCEPTION((AE_INFO, status, "Invalid _PSS data"));
result = -EFAULT;
kfree(pr->performance->states);
- goto end;
+ goto free_buffer;
}
amd_fixup_frequency(px, i);
@@ -417,8 +417,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
if (last_invalid > 0)
pr->performance->state_count = last_invalid;
-
- end:
+ free_buffer:
kfree(buffer.pointer);
return result;
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 11:50 +0200 |
| Subject | [PATCH 05/30] ACPI-processor: Rename jump labels in acpi_processor_preregister_performance() |
| Message-ID | <sfN57-6Xu-11@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 12:38:40 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 1ebe580..2fc82e7 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -621,12 +621,12 @@ int acpi_processor_preregister_performance(
if (pr->performance) {
retval = -EBUSY;
- goto err_out;
+ goto unlock;
}
if (!performance || !per_cpu_ptr(performance, i)) {
retval = -EINVAL;
- goto err_out;
+ goto unlock;
}
}
@@ -644,7 +644,7 @@ int acpi_processor_preregister_performance(
}
}
if (retval)
- goto err_ret;
+ goto clear_cpu;
/*
* Now that we have _PSD data from all CPUs, lets setup P-state
@@ -689,12 +689,12 @@ int acpi_processor_preregister_performance(
if (match_pdomain->num_processors != count_target) {
retval = -EINVAL;
- goto err_ret;
+ goto clear_cpu;
}
if (pdomain->coord_type != match_pdomain->coord_type) {
retval = -EINVAL;
- goto err_ret;
+ goto clear_cpu;
}
cpumask_set_cpu(j, covered_cpus);
@@ -719,8 +719,7 @@ int acpi_processor_preregister_performance(
pr->performance->shared_cpu_map);
}
}
-
-err_ret:
+ clear_cpu:
for_each_possible_cpu(i) {
pr = per_cpu(processors, i);
if (!pr || !pr->performance)
@@ -734,8 +733,7 @@ err_ret:
}
pr->performance = NULL; /* Will be set for real in register */
}
-
-err_out:
+ unlock:
mutex_unlock(&performance_mutex);
free_cpumask_var(covered_cpus);
return retval;
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 11:50 +0200 |
| Subject | [PATCH 04/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_performance_states() |
| Message-ID | <sfN57-6Xu-9@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 11:48:52 +0200
The local variables "pss" and "status" will be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 49889b1..1ebe580 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -320,11 +320,11 @@ static void amd_fixup_frequency(struct acpi_processor_px *px, int i) {};
static int acpi_processor_get_performance_states(struct acpi_processor *pr)
{
int result = 0;
- acpi_status status = AE_OK;
+ acpi_status status;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
struct acpi_buffer format = { sizeof("NNNNNN"), "NNNNNN" };
struct acpi_buffer state = { 0, NULL };
- union acpi_object *pss = NULL;
+ union acpi_object *pss;
int i;
int last_invalid = -1;
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 11:50 +0200 |
| Subject | [PATCH 08/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_psd() |
| Message-ID | <sfN57-6Xu-15@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 13:55:52 +0200
The local variables "psd" and "status" will be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index c2813cc..3f94279 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -529,11 +529,11 @@ EXPORT_SYMBOL(acpi_processor_notify_smm);
static int acpi_processor_get_psd(struct acpi_processor *pr)
{
int result = 0;
- acpi_status status = AE_OK;
+ acpi_status status;
struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL};
struct acpi_buffer format = {sizeof("NNNNN"), "NNNNN"};
struct acpi_buffer state = {0, NULL};
- union acpi_object *psd = NULL;
+ union acpi_object *psd;
struct acpi_psd_package *pdomain;
status = acpi_evaluate_object(pr->handle, "_PSD", NULL, &buffer);
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 11:50 +0200 |
| Subject | [PATCH 07/30] ACPI-processor: Rename jump labels in acpi_processor_get_psd() |
| Message-ID | <sfN57-6Xu-17@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 13:50:41 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 417e181..c2813cc 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -545,13 +545,13 @@ static int acpi_processor_get_psd(struct acpi_processor *pr)
if (!psd || (psd->type != ACPI_TYPE_PACKAGE)) {
printk(KERN_ERR PREFIX "Invalid _PSD data\n");
result = -EFAULT;
- goto end;
+ goto free_buffer;
}
if (psd->package.count != 1) {
printk(KERN_ERR PREFIX "Invalid _PSD data\n");
result = -EFAULT;
- goto end;
+ goto free_buffer;
}
pdomain = &(pr->performance->domain_info);
@@ -564,19 +564,19 @@ static int acpi_processor_get_psd(struct acpi_processor *pr)
if (ACPI_FAILURE(status)) {
printk(KERN_ERR PREFIX "Invalid _PSD data\n");
result = -EFAULT;
- goto end;
+ goto free_buffer;
}
if (pdomain->num_entries != ACPI_PSD_REV0_ENTRIES) {
printk(KERN_ERR PREFIX "Unknown _PSD:num_entries\n");
result = -EFAULT;
- goto end;
+ goto free_buffer;
}
if (pdomain->revision != ACPI_PSD_REV0_REVISION) {
printk(KERN_ERR PREFIX "Unknown _PSD:revision\n");
result = -EFAULT;
- goto end;
+ goto free_buffer;
}
if (pdomain->coord_type != DOMAIN_COORD_TYPE_SW_ALL &&
@@ -584,9 +584,8 @@ static int acpi_processor_get_psd(struct acpi_processor *pr)
pdomain->coord_type != DOMAIN_COORD_TYPE_HW_ALL) {
printk(KERN_ERR PREFIX "Invalid _PSD:coord_type\n");
result = -EFAULT;
- goto end;
}
-end:
+ free_buffer:
kfree(buffer.pointer);
return result;
}
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 11:50 +0200 |
| Subject | [PATCH 06/30] ACPI-processor: Move a success indication in acpi_processor_preregister_performance() |
| Message-ID | <sfN57-6Xu-13@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 13:03:56 +0200
The local variable "retval" was initialised with a zero at the beginning
as an indication for a successful function execution despite of
the possibility that following function calls could fail.
Move the desired assignment down to the source code place where some system
clean-up is performed.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 2fc82e7..417e181 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -595,7 +595,7 @@ int acpi_processor_preregister_performance(
struct acpi_processor_performance __percpu *performance)
{
int count_target;
- int retval = 0;
+ int retval;
unsigned int i, j;
cpumask_var_t covered_cpus;
struct acpi_processor *pr;
@@ -719,6 +719,8 @@ int acpi_processor_preregister_performance(
pr->performance->shared_cpu_map);
}
}
+
+ retval = 0;
clear_cpu:
for_each_possible_cpu(i) {
pr = per_cpu(processors, i);
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:00 +0200 |
| Subject | [PATCH 15/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_get_platform_limit() |
| Message-ID | <sfNeN-70F-1@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 19:12:06 +0200
The local variable "status" will be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index de82338..bab5a564d 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -112,7 +112,7 @@ static struct notifier_block acpi_ppc_notifier_block = {
static int acpi_processor_get_platform_limit(struct acpi_processor *pr)
{
- acpi_status status = 0;
+ acpi_status status;
unsigned long long ppc = 0;
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:00 +0200 |
| Subject | [PATCH 17/30] ACPI-processor: Improve another size determination in acpi_processor_get_throttling_states() |
| Message-ID | <sfNeN-70F-7@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Tue, 6 Sep 2016 19:19:27 +0200 Replace the specification of a data structure by a pointer dereference as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/acpi/processor_throttling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index 0a46b7f..c5ddf96 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -548,7 +548,7 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr) (struct acpi_processor_tx_tss *)&(pr->throttling. states_tss[i]); - state.length = sizeof(struct acpi_processor_tx_tss); + state.length = sizeof(*tx); state.pointer = tx; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Extracting state %d\n", i)); -- 2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:00 +0200 |
| Subject | [PATCH 10/30] ACPI-processor: Rename jump labels in acpi_processor_get_performance_control() |
| Message-ID | <sfNeN-70F-9@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 18:50:48 +0200
Adjust jump labels according to the current Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index b7e2f51..3a48c3a 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -240,7 +240,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
|| (pct->package.count != 2)) {
printk(KERN_ERR PREFIX "Invalid _PCT data\n");
result = -EFAULT;
- goto end;
+ goto free_buffer;
}
/*
@@ -254,7 +254,7 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
|| (obj.buffer.pointer == NULL)) {
printk(KERN_ERR PREFIX "Invalid _PCT data (control_register)\n");
result = -EFAULT;
- goto end;
+ goto free_buffer;
}
memcpy(&pr->performance->control_register, obj.buffer.pointer,
sizeof(struct acpi_pct_register));
@@ -270,13 +270,12 @@ static int acpi_processor_get_performance_control(struct acpi_processor *pr)
|| (obj.buffer.pointer == NULL)) {
printk(KERN_ERR PREFIX "Invalid _PCT data (status_register)\n");
result = -EFAULT;
- goto end;
+ goto free_buffer;
}
memcpy(&pr->performance->status_register, obj.buffer.pointer,
sizeof(struct acpi_pct_register));
-
- end:
+ free_buffer:
kfree(buffer.pointer);
return result;
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:00 +0200 |
| Subject | [PATCH 16/30] ACPI-processor: Use kmalloc_array() in acpi_processor_get_throttling_states() |
| Message-ID | <sfNeN-70F-11@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 19:15:02 +0200
* A multiplication for the size determination of a memory allocation
indicated that an array data structure should be processed.
Thus reuse the corresponding function "kmalloc_array".
This issue was detected by using the Coccinelle software.
* Replace the specification of a data structure by a pointer dereference
to make the corresponding size determination a bit safer according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_throttling.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index c72e648..0a46b7f 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -533,9 +533,10 @@ static int acpi_processor_get_throttling_states(struct acpi_processor *pr)
tss->package.count));
pr->throttling.state_count = tss->package.count;
- pr->throttling.states_tss =
- kmalloc(sizeof(struct acpi_processor_tx_tss) * tss->package.count,
- GFP_KERNEL);
+ pr->throttling.states_tss = kmalloc_array(tss->package.count,
+ sizeof(*pr->
+ throttling.states_tss),
+ GFP_KERNEL);
if (!pr->throttling.states_tss) {
result = -ENOMEM;
goto end;
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:00 +0200 |
| Subject | [PATCH 11/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_performance_control() |
| Message-ID | <sfNeN-70F-13@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 19:01:36 +0200
The local variables "pct" and "status" will be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 3a48c3a..07e5e59 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -223,9 +223,9 @@ void acpi_processor_ppc_exit(void)
static int acpi_processor_get_performance_control(struct acpi_processor *pr)
{
int result = 0;
- acpi_status status = 0;
+ acpi_status status;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
- union acpi_object *pct = NULL;
+ union acpi_object *pct;
union acpi_object obj = { 0 };
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:00 +0200 |
| Subject | [PATCH 09/30] ACPI-processor: Improve a size determination in acpi_processor_get_psd() |
| Message-ID | <sfNeO-70F-19@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Tue, 6 Sep 2016 18:48:37 +0200 Replace the specification of a data structure by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/acpi/processor_perflib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 3f94279..b7e2f51 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -556,7 +556,7 @@ static int acpi_processor_get_psd(struct acpi_processor *pr) pdomain = &(pr->performance->domain_info); - state.length = sizeof(struct acpi_psd_package); + state.length = sizeof(*pdomain); state.pointer = pdomain; status = acpi_extract_package(&(psd->package.elements[0]), -- 2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:00 +0200 |
| Subject | [PATCH 14/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_get_performance_info() |
| Message-ID | <sfNeO-70F-21@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 19:09:32 +0200
The local variable "result" will be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 43f8eef..de82338 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -423,7 +423,7 @@ static int acpi_processor_get_performance_states(struct acpi_processor *pr)
int acpi_processor_get_performance_info(struct acpi_processor *pr)
{
- int result = 0;
+ int result;
if (!pr || !pr->performance || !pr->handle)
return -EINVAL;
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | Paolo Bonzini <pbonzini@redhat.com> |
|---|---|
| Date | 2016-09-10 12:00 +0200 |
| Message-ID | <sfNeO-70F-23@gated-at.bofh.it> |
| In reply to | #1480554 |
I have nothing to do with ACPI. Please stop spamming me, or you'll end up on a kill file... Paolo ----- Original Message ----- > From: "SF Markus Elfring" <elfring@users.sourceforge.net> > To: linux-acpi@vger.kernel.org, "Len Brown" <lenb@kernel.org>, "Rafael J. Wysocki" <rjw@rjwysocki.net> > Cc: "LKML" <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org, "Julia Lawall" <julia.lawall@lip6.fr>, > "Paolo Bonzini" <pbonzini@redhat.com> > Sent: Saturday, September 10, 2016 11:30:08 AM > Subject: [PATCH 00/30] ACPI-processor: Fine-tuning for several function implementations > > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Tue, 9 Sep 2016 20:15:05 +0200 > > Several update suggestions were taken into account > from static source code analysis. > > Markus Elfring (30): > Use kmalloc_array() in acpi_processor_get_performance_states() > Improve two size determinations in acpi_processor_get_performance_states() > Rename jump labels in acpi_processor_get_performance_states() > Delete two unnecessary initialisations in > acpi_processor_get_performance_states() > Rename jump labels in acpi_processor_preregister_performance() > Move a success indication in acpi_processor_preregister_performance() > Rename jump labels in acpi_processor_get_psd() > Delete two unnecessary initialisations in acpi_processor_get_psd() > Improve a size determination in acpi_processor_get_psd() > Rename jump labels in acpi_processor_get_performance_control() > Delete two unnecessary initialisations in > acpi_processor_get_performance_control() > Rename jump labels in acpi_processor_ppc_notifier() > Delete an unnecessary initialisation in acpi_processor_ppc_notifier() > Delete an unnecessary initialisation in > acpi_processor_get_performance_info() > Delete an unnecessary initialisation in acpi_processor_get_platform_limit() > Use kmalloc_array() in acpi_processor_get_throttling_states() > Improve another size determination in > acpi_processor_get_throttling_states() > Rename jump labels in acpi_processor_get_throttling_states() > Delete two unnecessary initialisations in > acpi_processor_get_throttling_states() > Fix jump targets in acpi_processor_get_throttling_info() > Rename jump labels in acpi_processor_get_tsd() > Delete two unnecessary initialisations in acpi_processor_get_tsd() > Improve a size determination in acpi_processor_get_tsd() > Rename jump labels in acpi_processor_get_throttling_control() > Delete two unnecessary initialisations in > acpi_processor_get_throttling_control() > Fix jump targets in acpi_processor_reevaluate_tstate() > Delete an unnecessary initialisation in acpi_processor_reevaluate_tstate() > Rename a jump label in acpi_processor_get_platform_limit() > Delete an unnecessary initialisation in acpi_processor_get_platform_limit() > Improve jump targets in acpi_processor_update_tsd_coord() > > drivers/acpi/processor_perflib.c | 87 +++++++++++++-------------- > drivers/acpi/processor_throttling.c | 116 > ++++++++++++++++-------------------- > 2 files changed, 93 insertions(+), 110 deletions(-) > > -- > 2.10.0 > >
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:00 +0200 |
| Subject | [PATCH 13/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_ppc_notifier() |
| Message-ID | <sfNeO-70F-27@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 19:06:18 +0200
The local variable "ppc" will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_perflib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c
index 86256bd..43f8eef 100644
--- a/drivers/acpi/processor_perflib.c
+++ b/drivers/acpi/processor_perflib.c
@@ -73,7 +73,7 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb,
{
struct cpufreq_policy *policy = data;
struct acpi_processor *pr;
- unsigned int ppc = 0;
+ unsigned int ppc;
if (event == CPUFREQ_START && ignore_ppc <= 0) {
ignore_ppc = 0;
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:00 +0200 |
| Subject | [PATCH 12/30] ACPI-processor: Rename jump labels in acpi_processor_ppc_notifier() |
| Message-ID | <sfNeO-70F-31@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Tue, 6 Sep 2016 19:04:05 +0200 Adjust jump labels according to the current Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/acpi/processor_perflib.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/processor_perflib.c b/drivers/acpi/processor_perflib.c index 07e5e59..86256bd 100644 --- a/drivers/acpi/processor_perflib.c +++ b/drivers/acpi/processor_perflib.c @@ -90,18 +90,17 @@ static int acpi_processor_ppc_notifier(struct notifier_block *nb, pr = per_cpu(processors, policy->cpu); if (!pr || !pr->performance) - goto out; + goto unlock; ppc = (unsigned int)pr->performance_platform_limit; if (ppc >= pr->performance->state_count) - goto out; + goto unlock; cpufreq_verify_within_limits(policy, 0, pr->performance->states[ppc]. core_frequency * 1000); - - out: + unlock: mutex_unlock(&performance_mutex); return 0; -- 2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:10 +0200 |
| Subject | [PATCH 23/30] ACPI-processor: Improve a size determination in acpi_processor_get_tsd() |
| Message-ID | <sfNot-7ju-1@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Tue, 6 Sep 2016 20:55:45 +0200 Replace the specification of a data structure by pointer dereferences as the parameter for the operator "sizeof" to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/acpi/processor_throttling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index ea1e959..dcebb4b2 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -616,7 +616,7 @@ static int acpi_processor_get_tsd(struct acpi_processor *pr) pdomain = &(pr->throttling.domain_info); - state.length = sizeof(struct acpi_tsd_package); + state.length = sizeof(*pdomain); state.pointer = pdomain; status = acpi_extract_package(&(tsd->package.elements[0]), -- 2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:10 +0200 |
| Subject | [PATCH 25/30] ACPI-processor: Delete two unnecessary initialisations in acpi_processor_get_throttling_control() |
| Message-ID | <sfNot-7ju-3@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 21:17:12 +0200
The local variables "ptc" and "status" will be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_throttling.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index cdcd5d6f..0b4e058 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -423,9 +423,9 @@ end:
static int acpi_processor_get_throttling_control(struct acpi_processor *pr)
{
int result = 0;
- acpi_status status = 0;
+ acpi_status status;
struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
- union acpi_object *ptc = NULL;
+ union acpi_object *ptc;
union acpi_object obj = { 0 };
struct acpi_processor_throttling *throttling;
--
2.10.0
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-09-10 12:10 +0200 |
| Subject | [PATCH 27/30] ACPI-processor: Delete an unnecessary initialisation in acpi_processor_reevaluate_tstate() |
| Message-ID | <sfNot-7ju-11@gated-at.bofh.it> |
| In reply to | #1480554 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 6 Sep 2016 21:42:34 +0200
The local variable "result" will be set to an appropriate value
a bit later. Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/acpi/processor_throttling.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c
index 994f21c..d22bcfc 100644
--- a/drivers/acpi/processor_throttling.c
+++ b/drivers/acpi/processor_throttling.c
@@ -377,7 +377,7 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr)
void acpi_processor_reevaluate_tstate(struct acpi_processor *pr,
unsigned long action)
{
- int result = 0;
+ int result;
if (action == CPU_DEAD)
/* When one CPU is offline, the T-state throttling
--
2.10.0
[toc] | [prev] | [next] | [standalone]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | linux.kernel
csiph-web