linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] acpi/arm64: remove unnecessary cast
@ 2024-09-17 23:38 Min-Hua Chen
  2024-10-19  6:47 ` Hanjun Guo
  2024-11-12 16:10 ` Catalin Marinas
  0 siblings, 2 replies; 4+ messages in thread
From: Min-Hua Chen @ 2024-09-17 23:38 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Rafael J. Wysocki,
	Len Brown
  Cc: Min-Hua Chen, linux-acpi, linux-arm-kernel, linux-kernel

DEFINE_RES_IRQ returns struct resource type, so it is
unnecessary to cast it to struct resource.

Remove the unnecessary cast to fix the following sparse warnings:

drivers/acpi/arm64/gtdt.c:355:19: sparse: warning: cast to non-scalar
drivers/acpi/arm64/gtdt.c:355:19: sparse: warning: cast from non-scalar

No functional changes intended.

Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
---
 drivers/acpi/arm64/gtdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/arm64/gtdt.c b/drivers/acpi/arm64/gtdt.c
index c0e77c1c8e09..24bd479de91f 100644
--- a/drivers/acpi/arm64/gtdt.c
+++ b/drivers/acpi/arm64/gtdt.c
@@ -352,7 +352,7 @@ static int __init gtdt_import_sbsa_gwdt(struct acpi_gtdt_watchdog *wd,
 	}
 
 	irq = map_gt_gsi(wd->timer_interrupt, wd->timer_flags);
-	res[2] = (struct resource)DEFINE_RES_IRQ(irq);
+	res[2] = DEFINE_RES_IRQ(irq);
 	if (irq <= 0) {
 		pr_warn("failed to map the Watchdog interrupt.\n");
 		nr_res--;
-- 
2.43.0



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

* Re: [PATCH] acpi/arm64: remove unnecessary cast
  2024-09-17 23:38 [PATCH] acpi/arm64: remove unnecessary cast Min-Hua Chen
@ 2024-10-19  6:47 ` Hanjun Guo
  2024-11-09  8:36   ` Hanjun Guo
  2024-11-12 16:10 ` Catalin Marinas
  1 sibling, 1 reply; 4+ messages in thread
From: Hanjun Guo @ 2024-10-19  6:47 UTC (permalink / raw)
  To: Min-Hua Chen, Lorenzo Pieralisi, Sudeep Holla, Rafael J. Wysocki,
	Len Brown
  Cc: linux-acpi, linux-arm-kernel, linux-kernel

On 2024/9/18 7:38, Min-Hua Chen wrote:
> DEFINE_RES_IRQ returns struct resource type, so it is
> unnecessary to cast it to struct resource.
> 
> Remove the unnecessary cast to fix the following sparse warnings:
> 
> drivers/acpi/arm64/gtdt.c:355:19: sparse: warning: cast to non-scalar
> drivers/acpi/arm64/gtdt.c:355:19: sparse: warning: cast from non-scalar
> 
> No functional changes intended.
> 
> Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
> ---
>   drivers/acpi/arm64/gtdt.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/arm64/gtdt.c b/drivers/acpi/arm64/gtdt.c
> index c0e77c1c8e09..24bd479de91f 100644
> --- a/drivers/acpi/arm64/gtdt.c
> +++ b/drivers/acpi/arm64/gtdt.c
> @@ -352,7 +352,7 @@ static int __init gtdt_import_sbsa_gwdt(struct acpi_gtdt_watchdog *wd,
>   	}
>   
>   	irq = map_gt_gsi(wd->timer_interrupt, wd->timer_flags);
> -	res[2] = (struct resource)DEFINE_RES_IRQ(irq);
> +	res[2] = DEFINE_RES_IRQ(irq);
>   	if (irq <= 0) {
>   		pr_warn("failed to map the Watchdog interrupt.\n");
>   		nr_res--;
> 

It's a minor issue, but I think it deserves a patch to make
the code cleaner,

Acked-by: Hanjun Guo <guohanjun@huawei.com>

Thanks
Hanjun


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

* Re: [PATCH] acpi/arm64: remove unnecessary cast
  2024-10-19  6:47 ` Hanjun Guo
@ 2024-11-09  8:36   ` Hanjun Guo
  0 siblings, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2024-11-09  8:36 UTC (permalink / raw)
  To: Min-Hua Chen, Lorenzo Pieralisi, Sudeep Holla
  Cc: Rafael J. Wysocki, Len Brown, linux-acpi, linux-arm-kernel,
	linux-kernel, Catalin Marinas, Will Deacon

On 2024/10/19 14:47, Hanjun Guo wrote:
> On 2024/9/18 7:38, Min-Hua Chen wrote:
>> DEFINE_RES_IRQ returns struct resource type, so it is
>> unnecessary to cast it to struct resource.
>>
>> Remove the unnecessary cast to fix the following sparse warnings:
>>
>> drivers/acpi/arm64/gtdt.c:355:19: sparse: warning: cast to non-scalar
>> drivers/acpi/arm64/gtdt.c:355:19: sparse: warning: cast from non-scalar
>>
>> No functional changes intended.
>>
>> Signed-off-by: Min-Hua Chen <minhuadotchen@gmail.com>
>> ---
>>   drivers/acpi/arm64/gtdt.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/arm64/gtdt.c b/drivers/acpi/arm64/gtdt.c
>> index c0e77c1c8e09..24bd479de91f 100644
>> --- a/drivers/acpi/arm64/gtdt.c
>> +++ b/drivers/acpi/arm64/gtdt.c
>> @@ -352,7 +352,7 @@ static int __init gtdt_import_sbsa_gwdt(struct 
>> acpi_gtdt_watchdog *wd,
>>       }
>>       irq = map_gt_gsi(wd->timer_interrupt, wd->timer_flags);
>> -    res[2] = (struct resource)DEFINE_RES_IRQ(irq);
>> +    res[2] = DEFINE_RES_IRQ(irq);
>>       if (irq <= 0) {
>>           pr_warn("failed to map the Watchdog interrupt.\n");
>>           nr_res--;
>>
> 
> It's a minor issue, but I think it deserves a patch to make
> the code cleaner,
> 
> Acked-by: Hanjun Guo <guohanjun@huawei.com>

Lorenzo, Sudeep, please take a look at this patch.

Thanks
Hanjun


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

* Re: [PATCH] acpi/arm64: remove unnecessary cast
  2024-09-17 23:38 [PATCH] acpi/arm64: remove unnecessary cast Min-Hua Chen
  2024-10-19  6:47 ` Hanjun Guo
@ 2024-11-12 16:10 ` Catalin Marinas
  1 sibling, 0 replies; 4+ messages in thread
From: Catalin Marinas @ 2024-11-12 16:10 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Hanjun Guo, Sudeep Holla, Rafael J. Wysocki,
	Len Brown, Min-Hua Chen
  Cc: Will Deacon, linux-acpi, linux-arm-kernel, linux-kernel

On Wed, 18 Sep 2024 07:38:24 +0800, Min-Hua Chen wrote:
> DEFINE_RES_IRQ returns struct resource type, so it is
> unnecessary to cast it to struct resource.
> 
> Remove the unnecessary cast to fix the following sparse warnings:
> 
> drivers/acpi/arm64/gtdt.c:355:19: sparse: warning: cast to non-scalar
> drivers/acpi/arm64/gtdt.c:355:19: sparse: warning: cast from non-scalar
> 
> [...]

Applied to arm64 (for-next/misc), thanks!

[1/1] acpi/arm64: remove unnecessary cast
      https://git.kernel.org/arm64/c/f95382d73ec8

-- 
Catalin



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

end of thread, other threads:[~2024-11-12 16:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-17 23:38 [PATCH] acpi/arm64: remove unnecessary cast Min-Hua Chen
2024-10-19  6:47 ` Hanjun Guo
2024-11-09  8:36   ` Hanjun Guo
2024-11-12 16:10 ` Catalin Marinas

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).