* [PATCH] ACPI/PPTT: fixed some parameter type is not right
@ 2019-11-05 1:07 Tian Tao
2019-11-05 1:15 ` Hanjun Guo
2019-11-13 23:25 ` Rafael J. Wysocki
0 siblings, 2 replies; 4+ messages in thread
From: Tian Tao @ 2019-11-05 1:07 UTC (permalink / raw)
To: rjw, lenb, linux-acpi, jonathan.cameron; +Cc: linuxarm
acpi_find_cache_level with level parameter as a signed integer,
is called by acpi_find_cache_node where the level parameter is unsigned.
This in turn calls acpi_find_cache_level with the level parameter is
signed.Make the type consistent as unsigned through all 3 calls.
Signed-off-by: Tian Tao <tiantao6@huawei.com>
---
drivers/acpi/pptt.c | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
index 5af1e9e..bbe9b7a 100644
--- a/drivers/acpi/pptt.c
+++ b/drivers/acpi/pptt.c
@@ -98,11 +98,11 @@ static inline bool acpi_pptt_match_type(int table_type, int type)
*
* Return: The cache structure and the level we terminated with.
*/
-static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
- int local_level,
- struct acpi_subtable_header *res,
- struct acpi_pptt_cache **found,
- int level, int type)
+static unsigned int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
+ unsigned int local_level,
+ struct acpi_subtable_header *res,
+ struct acpi_pptt_cache **found,
+ unsigned int level, int type)
{
struct acpi_pptt_cache *cache;
@@ -119,7 +119,7 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
if (*found != NULL && cache != *found)
pr_warn("Found duplicate cache level/type unable to determine uniqueness\n");
- pr_debug("Found cache @ level %d\n", level);
+ pr_debug("Found cache @ level %u\n", level);
*found = cache;
/*
* continue looking at this node's resource list
@@ -132,16 +132,18 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
return local_level;
}
-static struct acpi_pptt_cache *acpi_find_cache_level(struct acpi_table_header *table_hdr,
- struct acpi_pptt_processor *cpu_node,
- int *starting_level, int level,
- int type)
+static struct
+acpi_pptt_cache *acpi_find_cache_level(struct acpi_table_header *table_hdr,
+ struct acpi_pptt_processor *cpu_node,
+ unsigned int *starting_level,
+ unsigned int level,
+ int type)
{
struct acpi_subtable_header *res;
- int number_of_levels = *starting_level;
+ unsigned int number_of_levels = *starting_level;
int resource = 0;
struct acpi_pptt_cache *ret = NULL;
- int local_level;
+ unsigned int local_level;
/* walk down from processor node */
while ((res = acpi_get_pptt_resource(table_hdr, cpu_node, resource))) {
@@ -318,15 +320,15 @@ static u8 acpi_cache_type(enum cache_type type)
static struct acpi_pptt_cache *acpi_find_cache_node(struct acpi_table_header *table_hdr,
u32 acpi_cpu_id,
enum cache_type type,
- int level,
+ unsigned int level,
struct acpi_pptt_processor **node)
{
- int total_levels = 0;
+ unsigned int total_levels = 0;
struct acpi_pptt_cache *found = NULL;
struct acpi_pptt_processor *cpu_node;
u8 acpi_type = acpi_cache_type(type);
- pr_debug("Looking for CPU %d's level %d cache type %d\n",
+ pr_debug("Looking for CPU %d's level %u cache type %d\n",
acpi_cpu_id, level, acpi_type);
cpu_node = acpi_find_processor_node(table_hdr, acpi_cpu_id);
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI/PPTT: fixed some parameter type is not right
2019-11-05 1:07 [PATCH] ACPI/PPTT: fixed some parameter type is not right Tian Tao
@ 2019-11-05 1:15 ` Hanjun Guo
2019-11-05 1:27 ` Hanjun Guo
2019-11-13 23:25 ` Rafael J. Wysocki
1 sibling, 1 reply; 4+ messages in thread
From: Hanjun Guo @ 2019-11-05 1:15 UTC (permalink / raw)
To: Tian Tao, rjw, lenb, linux-acpi, jonathan.cameron; +Cc: linuxarm
On 2019/11/5 9:07, Tian Tao wrote:
> acpi_find_cache_level with level parameter as a signed integer,
> is called by acpi_find_cache_node where the level parameter is unsigned.
> This in turn calls acpi_find_cache_level with the level parameter is
> signed.Make the type consistent as unsigned through all 3 calls.
I'm not against doing this, but it's not a big deal :)
Maybe send to upstream to see what's happening, Rafael is a nice guy.
Thanks
Hanjun
>
> Signed-off-by: Tian Tao <tiantao6@huawei.com>
> ---
> drivers/acpi/pptt.c | 32 +++++++++++++++++---------------
> 1 file changed, 17 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
> index 5af1e9e..bbe9b7a 100644
> --- a/drivers/acpi/pptt.c
> +++ b/drivers/acpi/pptt.c
> @@ -98,11 +98,11 @@ static inline bool acpi_pptt_match_type(int table_type, int type)
> *
> * Return: The cache structure and the level we terminated with.
> */
> -static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
> - int local_level,
> - struct acpi_subtable_header *res,
> - struct acpi_pptt_cache **found,
> - int level, int type)
> +static unsigned int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
> + unsigned int local_level,
> + struct acpi_subtable_header *res,
> + struct acpi_pptt_cache **found,
> + unsigned int level, int type)
> {
> struct acpi_pptt_cache *cache;
>
> @@ -119,7 +119,7 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
> if (*found != NULL && cache != *found)
> pr_warn("Found duplicate cache level/type unable to determine uniqueness\n");
>
> - pr_debug("Found cache @ level %d\n", level);
> + pr_debug("Found cache @ level %u\n", level);
> *found = cache;
> /*
> * continue looking at this node's resource list
> @@ -132,16 +132,18 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
> return local_level;
> }
>
> -static struct acpi_pptt_cache *acpi_find_cache_level(struct acpi_table_header *table_hdr,
> - struct acpi_pptt_processor *cpu_node,
> - int *starting_level, int level,
> - int type)
> +static struct
> +acpi_pptt_cache *acpi_find_cache_level(struct acpi_table_header *table_hdr,
> + struct acpi_pptt_processor *cpu_node,
> + unsigned int *starting_level,
> + unsigned int level,
> + int type)
> {
> struct acpi_subtable_header *res;
> - int number_of_levels = *starting_level;
> + unsigned int number_of_levels = *starting_level;
> int resource = 0;
> struct acpi_pptt_cache *ret = NULL;
> - int local_level;
> + unsigned int local_level;
>
> /* walk down from processor node */
> while ((res = acpi_get_pptt_resource(table_hdr, cpu_node, resource))) {
> @@ -318,15 +320,15 @@ static u8 acpi_cache_type(enum cache_type type)
> static struct acpi_pptt_cache *acpi_find_cache_node(struct acpi_table_header *table_hdr,
> u32 acpi_cpu_id,
> enum cache_type type,
> - int level,
> + unsigned int level,
> struct acpi_pptt_processor **node)
> {
> - int total_levels = 0;
> + unsigned int total_levels = 0;
> struct acpi_pptt_cache *found = NULL;
> struct acpi_pptt_processor *cpu_node;
> u8 acpi_type = acpi_cache_type(type);
>
> - pr_debug("Looking for CPU %d's level %d cache type %d\n",
> + pr_debug("Looking for CPU %d's level %u cache type %d\n",
> acpi_cpu_id, level, acpi_type);
>
> cpu_node = acpi_find_processor_node(table_hdr, acpi_cpu_id);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI/PPTT: fixed some parameter type is not right
2019-11-05 1:15 ` Hanjun Guo
@ 2019-11-05 1:27 ` Hanjun Guo
0 siblings, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2019-11-05 1:27 UTC (permalink / raw)
To: Tian Tao, rjw, lenb, linux-acpi, jonathan.cameron; +Cc: linuxarm
On 2019/11/5 9:15, Hanjun Guo wrote:
> On 2019/11/5 9:07, Tian Tao wrote:
>> acpi_find_cache_level with level parameter as a signed integer,
>> is called by acpi_find_cache_node where the level parameter is unsigned.
>> This in turn calls acpi_find_cache_level with the level parameter is
>> signed.Make the type consistent as unsigned through all 3 calls.
>
> I'm not against doing this, but it's not a big deal :)
>
> Maybe send to upstream to see what's happening, Rafael is a nice guy.
Oh, already sent to upstream, my bad :(
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ACPI/PPTT: fixed some parameter type is not right
2019-11-05 1:07 [PATCH] ACPI/PPTT: fixed some parameter type is not right Tian Tao
2019-11-05 1:15 ` Hanjun Guo
@ 2019-11-13 23:25 ` Rafael J. Wysocki
1 sibling, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2019-11-13 23:25 UTC (permalink / raw)
To: Tian Tao; +Cc: lenb, linux-acpi, jonathan.cameron, linuxarm
On Tuesday, November 5, 2019 2:07:35 AM CET Tian Tao wrote:
> acpi_find_cache_level with level parameter as a signed integer,
> is called by acpi_find_cache_node where the level parameter is unsigned.
> This in turn calls acpi_find_cache_level with the level parameter is
> signed.Make the type consistent as unsigned through all 3 calls.
>
> Signed-off-by: Tian Tao <tiantao6@huawei.com>
Well, it is good to be consistent in general, but the patch doesn't apply
(because of the last hunk) and the changelog is incorrect AFAICS.
> ---
> drivers/acpi/pptt.c | 32 +++++++++++++++++---------------
> 1 file changed, 17 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
> index 5af1e9e..bbe9b7a 100644
> --- a/drivers/acpi/pptt.c
> +++ b/drivers/acpi/pptt.c
> @@ -98,11 +98,11 @@ static inline bool acpi_pptt_match_type(int table_type, int type)
> *
> * Return: The cache structure and the level we terminated with.
> */
> -static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
> - int local_level,
> - struct acpi_subtable_header *res,
> - struct acpi_pptt_cache **found,
> - int level, int type)
> +static unsigned int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
> + unsigned int local_level,
> + struct acpi_subtable_header *res,
> + struct acpi_pptt_cache **found,
> + unsigned int level, int type)
> {
> struct acpi_pptt_cache *cache;
>
> @@ -119,7 +119,7 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
> if (*found != NULL && cache != *found)
> pr_warn("Found duplicate cache level/type unable to determine uniqueness\n");
>
> - pr_debug("Found cache @ level %d\n", level);
> + pr_debug("Found cache @ level %u\n", level);
> *found = cache;
> /*
> * continue looking at this node's resource list
> @@ -132,16 +132,18 @@ static int acpi_pptt_walk_cache(struct acpi_table_header *table_hdr,
> return local_level;
> }
>
> -static struct acpi_pptt_cache *acpi_find_cache_level(struct acpi_table_header *table_hdr,
> - struct acpi_pptt_processor *cpu_node,
> - int *starting_level, int level,
> - int type)
> +static struct
> +acpi_pptt_cache *acpi_find_cache_level(struct acpi_table_header *table_hdr,
> + struct acpi_pptt_processor *cpu_node,
> + unsigned int *starting_level,
> + unsigned int level,
> + int type)
> {
> struct acpi_subtable_header *res;
> - int number_of_levels = *starting_level;
> + unsigned int number_of_levels = *starting_level;
> int resource = 0;
> struct acpi_pptt_cache *ret = NULL;
> - int local_level;
> + unsigned int local_level;
>
> /* walk down from processor node */
> while ((res = acpi_get_pptt_resource(table_hdr, cpu_node, resource))) {
> @@ -318,15 +320,15 @@ static u8 acpi_cache_type(enum cache_type type)
> static struct acpi_pptt_cache *acpi_find_cache_node(struct acpi_table_header *table_hdr,
> u32 acpi_cpu_id,
> enum cache_type type,
> - int level,
> + unsigned int level,
> struct acpi_pptt_processor **node)
> {
> - int total_levels = 0;
> + unsigned int total_levels = 0;
> struct acpi_pptt_cache *found = NULL;
> struct acpi_pptt_processor *cpu_node;
> u8 acpi_type = acpi_cache_type(type);
>
> - pr_debug("Looking for CPU %d's level %d cache type %d\n",
> + pr_debug("Looking for CPU %d's level %u cache type %d\n",
> acpi_cpu_id, level, acpi_type);
>
> cpu_node = acpi_find_processor_node(table_hdr, acpi_cpu_id);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-13 23:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 1:07 [PATCH] ACPI/PPTT: fixed some parameter type is not right Tian Tao
2019-11-05 1:15 ` Hanjun Guo
2019-11-05 1:27 ` Hanjun Guo
2019-11-13 23:25 ` Rafael J. Wysocki
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).