lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <51e3c38c-42a3-49b6-ab19-50f4f37336aa@linaro.org>
Date: Mon, 19 Aug 2024 10:18:39 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Uros Bizjak <ubizjak@...il.com>, linux-kernel@...r.kernel.org
Cc: Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH] clocksource/timer-of: Add missing casts to percpu address
 space

On 19/08/2024 08:13, Uros Bizjak wrote:
> Add missing casts to percpu address space to fix
> 
> timer-of.c:29:46: warning: incorrect type in argument 2 (different address spaces)
> timer-of.c:29:46:    expected void [noderef] __percpu *
> timer-of.c:29:46:    got struct clock_event_device *clkevt
> timer-of.c:74:51: warning: incorrect type in argument 4 (different address spaces)
> timer-of.c:74:51:    expected void [noderef] __percpu *percpu_dev_id
> timer-of.c:74:51:    got struct clock_event_device *clkevt
> 
> sparse warnings.
> 
> Found by GCC's named address space checks.
> 
> There were no changes in the resulting object file.

The warning may go away but the problem sparse is spotting is still there.

IMO sparse is totally right and the code related to the percpu is 
broken. It seems the .percpu flag is never used in the drivers and we 
should be able to just remove the percpu related code in timer-of.c

> Signed-off-by: Uros Bizjak <ubizjak@...il.com>
> Cc: Daniel Lezcano <daniel.lezcano@...aro.org>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> ---
>   drivers/clocksource/timer-of.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c
> index c3f54d9912be..7e0375a804ff 100644
> --- a/drivers/clocksource/timer-of.c
> +++ b/drivers/clocksource/timer-of.c
> @@ -26,7 +26,8 @@ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)
>   	struct clock_event_device *clkevt = &to->clkevt;
>   
>   	if (of_irq->percpu)
> -		free_percpu_irq(of_irq->irq, clkevt);
> +		free_percpu_irq(of_irq->irq,
> +				(void __percpu *)(unsigned long)clkevt);
>   	else
>   		free_irq(of_irq->irq, clkevt);
>   }
> @@ -70,8 +71,8 @@ static __init int timer_of_irq_init(struct device_node *np,
>   	}
>   
>   	ret = of_irq->percpu ?
> -		request_percpu_irq(of_irq->irq, of_irq->handler,
> -				   np->full_name, clkevt) :
> +		request_percpu_irq(of_irq->irq, of_irq->handler, np->full_name,
> +				   (void __percpu *)(unsigned long)clkevt) :
>   		request_irq(of_irq->irq, of_irq->handler,
>   			    of_irq->flags ? of_irq->flags : IRQF_TIMER,
>   			    np->full_name, clkevt);


-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ