linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] ACPI/PPTT: fixed some parameter type is not right
@ 2019-12-30 11:56 Xiongfeng Wang
  2020-01-07 10:48 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Xiongfeng Wang @ 2019-12-30 11:56 UTC (permalink / raw)
  To: rjw, lenb
  Cc: linux-acpi, linux-kernel, tiantao6, jonathan.cameron, guohanjun,
	wangxiongfeng2

From: Tian Tao <tiantao6@huawei.com>

The fourth parameter 'level' of function 'acpi_find_cache_level()' is a
signed interger, but its caller 'acpi_find_cache_node()' passes that
parameter an unsigned interger. This patch fixes the paramter type
inconsistency.

Signed-off-by: Tian Tao <tiantao6@huawei.com>
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>

---
v2:	fix the conflicts in the third hunk.
	Modify the commit information a little bit.
---
 drivers/acpi/pptt.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
index f31544d..4ae9335 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,17 @@ 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))) {
@@ -321,12 +322,12 @@ static struct acpi_pptt_cache *acpi_find_cache_node(struct acpi_table_header *ta
 						    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);
-- 
1.7.12.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] ACPI/PPTT: fixed some parameter type is not right
  2019-12-30 11:56 [PATCH v2] ACPI/PPTT: fixed some parameter type is not right Xiongfeng Wang
@ 2020-01-07 10:48 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2020-01-07 10:48 UTC (permalink / raw)
  To: Xiongfeng Wang
  Cc: Rafael J. Wysocki, Len Brown, ACPI Devel Maling List,
	Linux Kernel Mailing List, tiantao, Jonathan Cameron, Hanjun Guo

On Mon, Dec 30, 2019 at 1:01 PM Xiongfeng Wang
<wangxiongfeng2@huawei.com> wrote:
>
> From: Tian Tao <tiantao6@huawei.com>
>
> The fourth parameter 'level' of function 'acpi_find_cache_level()' is a
> signed interger, but its caller 'acpi_find_cache_node()' passes that
> parameter an unsigned interger. This patch fixes the paramter type
> inconsistency.
>
> Signed-off-by: Tian Tao <tiantao6@huawei.com>
> Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
>
> ---
> v2:     fix the conflicts in the third hunk.
>         Modify the commit information a little bit.
> ---
>  drivers/acpi/pptt.c | 29 +++++++++++++++--------------
>  1 file changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
> index f31544d..4ae9335 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,17 @@ 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))) {
> @@ -321,12 +322,12 @@ static struct acpi_pptt_cache *acpi_find_cache_node(struct acpi_table_header *ta
>                                                     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);
> --

Applied for 5.6 as "ACPI: PPTT: Consistently use unsigned int as
parameter type" with some minor changes in the changelog.

Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-07 10:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-30 11:56 [PATCH v2] ACPI/PPTT: fixed some parameter type is not right Xiongfeng Wang
2020-01-07 10:48 ` 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).