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] [day] [month] [year] [list]
Message-ID:
 <IA1PR20MB49535179A6C3D854420939D4BBAD2@IA1PR20MB4953.namprd20.prod.outlook.com>
Date: Fri, 19 Jul 2024 20:21:13 +0800
From: Inochi Amaoto <inochiama@...look.com>
To: limiao <limiao870622@....com>, mturquette@...libre.com, 
	sboyd@...nel.org, unicorn_wang@...look.com, inochiama@...look.com
Cc: linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org, 
	limiao <limiao@...inos.cn>
Subject: Re: [PATCH] clk: sophgo: fix warning emitted by objtool

On Fri, Jul 19, 2024 at 07:57:27PM GMT, limiao wrote:
> From: limiao <limiao@...inos.cn>
> 
> for ARCH=x86, the combination of CONFIG_OBJTOOL=y enables
> a host tool named 'objtool' which runs at compile time,
> when CONFIG_CLK_SOPHGO_CV1800=y or m, objtool will produces
> the following warning:
> 
> drivers/clk/sophgo/clk-cv18xx-ip.o: warning: objtool:
> mmux_round_rate() falls through to next function aclk_set_rate()
> 
> we can find the reason from objtool help document(tools/objtool/
> Documentation/objtool.txt):
> 

I think it is duplicate of
https://lore.kernel.org/linux-clk/c8e66d51f880127549e2a3e623be6787f62b310d.1720506143.git.liqiang01@kylinos.cn/

> Objtool warnings
> ----------------
> ...
> 8. file.o: warning: objtool: funcA() falls through to next function funcB()
> ...
>    2) funcA() uses the unreachable() annotation in a section of code
>      that is actually reachable.
> 
> so we replace unreachable() with returning an errno to avoid this warning.
> 
> Signed-off-by: limiao<limiao@...inos.cn>
> ---
>  drivers/clk/sophgo/clk-cv18xx-ip.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/sophgo/clk-cv18xx-ip.c b/drivers/clk/sophgo/clk-cv18xx-ip.c
> index 805f561725ae..0fe9a9bd3f49 100644
> --- a/drivers/clk/sophgo/clk-cv18xx-ip.c
> +++ b/drivers/clk/sophgo/clk-cv18xx-ip.c
> @@ -602,7 +602,7 @@ static inline struct cv1800_clk_mmux *hw_to_cv1800_clk_mmux(struct clk_hw *hw)
>  	return container_of(common, struct cv1800_clk_mmux, common);
>  }
>  
> -static u8 mmux_get_parent_id(struct cv1800_clk_mmux *mmux)
> +static int mmux_get_parent_id(struct cv1800_clk_mmux *mmux)
>  {
>  	struct clk_hw *hw = &mmux->common.hw;
>  	struct clk_hw *parent = clk_hw_get_parent(hw);
> @@ -613,7 +613,7 @@ static u8 mmux_get_parent_id(struct cv1800_clk_mmux *mmux)
>  			return i;
>  	}
>  
> -	unreachable();
> +	return -EINVAL;
>  }
>  
>  static int mmux_enable(struct clk_hw *hw)
> @@ -648,6 +648,8 @@ static long mmux_round_rate(struct clk_hw *parent, unsigned long *parent_rate,
>  			return *parent_rate;
>  
>  		id = mmux_get_parent_id(mmux);
> +		if (id < 0)
> +			return *parent_rate;
>  	}
>  
>  	div_id = mmux->parent2sel[id];
> -- 
> 2.25.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ