diff mbox series

acpi/arm64: remove unnecessary cast

Message ID 20240917233827.73167-1-minhuadotchen@gmail.com
State Accepted
Commit f95382d73ec8bfee2b4a00b2ac4aa4530f7c4af3
Headers show
Series acpi/arm64: remove unnecessary cast | expand

Commit Message

Min-Hua Chen Sept. 17, 2024, 11:38 p.m. UTC
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(-)

Comments

Hanjun Guo Oct. 19, 2024, 6:47 a.m. UTC | #1
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
Hanjun Guo Nov. 9, 2024, 8:36 a.m. UTC | #2
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
Catalin Marinas Nov. 12, 2024, 4:10 p.m. UTC | #3
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
diff mbox series

Patch

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--;