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:
 <ZQ0PR01MB130295B1CB3568C596B12F2FF26A2@ZQ0PR01MB1302.CHNPR01.prod.partner.outlook.cn>
Date: Tue, 10 Jun 2025 08:51:30 +0000
From: Changhuang Liang <changhuang.liang@...rfivetech.com>
To: "shao.mingyin@....com.cn" <shao.mingyin@....com.cn>,
	"ulf.hansson@...aro.org" <ulf.hansson@...aro.org>
CC: "geert+renesas@...der.be" <geert+renesas@...der.be>,
	"magnus.damm@...il.com" <magnus.damm@...il.com>, "heiko@...ech.de"
	<heiko@...ech.de>, "krzk@...nel.org" <krzk@...nel.org>,
	"alim.akhtar@...sung.com" <alim.akhtar@...sung.com>, Walker Chen
	<walker.chen@...rfivetech.com>, "sebastian.reichel@...labora.com"
	<sebastian.reichel@...labora.com>, "detlev.casanova@...labora.com"
	<detlev.casanova@...labora.com>, "finley.xiao@...k-chips.com"
	<finley.xiao@...k-chips.com>, "shawn.lin@...k-chips.com"
	<shawn.lin@...k-chips.com>, "pgwipeout@...il.com" <pgwipeout@...il.com>,
	"qiu.yutan@....com.cn" <qiu.yutan@....com.cn>, "linux-pm@...r.kernel.org"
	<linux-pm@...r.kernel.org>, "linux-renesas-soc@...r.kernel.org"
	<linux-renesas-soc@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, "linux-arm-kernel@...ts.infradead.org"
	<linux-arm-kernel@...ts.infradead.org>, "linux-rockchip@...ts.infradead.org"
	<linux-rockchip@...ts.infradead.org>, "linux-samsung-soc@...r.kernel.org"
	<linux-samsung-soc@...r.kernel.org>, "yang.yang29@....com.cn"
	<yang.yang29@....com.cn>, "xu.xin16@....com.cn" <xu.xin16@....com.cn>,
	"yang.tao172@....com.cn" <yang.tao172@....com.cn>, "ye.xingchen@....com.cn"
	<ye.xingchen@....com.cn>
Subject:
 回复: pmdomain: Use str_enable_disable-like helpers

Hi, Mingyin

Thanks for your patch.

> From: Shao Mingyin <shao.mingyin@....com.cn>
> 
> Replace ternary (condition ? "enable" : "disable") syntax and ternary
> (condition ? "on" : "off") syntax with helpers from string_choices.h because:
> 1. Simple function call with one argument is easier to read.  Ternary
>    operator has three arguments and with wrapping might lead to quite
>    long code.
> 2. Is slightly shorter thus also easier to read.
> 3. It brings uniformity in the text - same string.
> 4. Allows deduping by the linker, which results in a smaller binary
>    file.
> 
> Signed-off-by: Shao Mingyin <shao.mingyin@....com.cn>

[...]

> diff --git a/drivers/pmdomain/starfive/jh71xx-pmu.c
> b/drivers/pmdomain/starfive/jh71xx-pmu.c
> index 74720c09a6e3..0e8fca4e2de9 100644
> --- a/drivers/pmdomain/starfive/jh71xx-pmu.c
> +++ b/drivers/pmdomain/starfive/jh71xx-pmu.c
> @@ -12,6 +12,7 @@
>  #include <linux/of.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_domain.h>
> +#include <linux/string_choices.h>
>  #include <dt-bindings/power/starfive,jh7110-pmu.h>
> 
>  /* register offset */
> @@ -155,7 +156,7 @@ static int jh7110_pmu_set_state(struct
> jh71xx_pmu_dev *pmd, u32 mask, bool on)
> 
>         if (ret) {
>                 dev_err(pmu->dev, "%s: failed to power %s\n",
> -                       pmd->genpd.name, on ? "on" : "off");
> +                       pmd->genpd.name, str_on_off(on));
>                 return -ETIMEDOUT;
>         }
> 
> @@ -198,7 +199,7 @@ static int jh71xx_pmu_set_state(struct
> jh71xx_pmu_dev *pmd, u32 mask, bool on)
> 
>         if (is_on == on) {
>                 dev_dbg(pmu->dev, "pm domain [%s] is already %sable
> status.\n",

%sable ==> %s

> -                       pmd->genpd.name, on ? "en" : "dis");
> +                       pmd->genpd.name, str_enable_disable(on));
>                 return 0;
>         }
> 

Best Regards,
Changhuang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ