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: <DD62CDB3C1812AAF+6ce777e6-4a79-4d10-bfaa-65021ba64821@uniontech.com>
Date: Fri, 7 Feb 2025 15:54:03 +0800
From: WangYuli <wangyuli@...ontech.com>
To: chenhuacai@...nel.org, kernel@...0n.name, jiaxun.yang@...goat.com,
 guanwentao@...ontech.com
Cc: loongarch@...ts.linux.dev, linux-kernel@...r.kernel.org,
 zhanjun@...ontech.com, chenlinxuan@...ontech.com
Subject: Re: [PATCH] LoongArch: kernel: proc: Use str_yes_no() helper function

Deprecated.

On 2025/2/7 14:52, WangYuli wrote:
> Remove hard-coded strings by using the str_yes_no() helper function.
>
> Similar to commit c4a0a4a45a45 ("MIPS: kernel: proc: Use str_yes_no()
> helper function").
>
> Co-developed-by: Wentao Guan <guanwentao@...ontech.com>
> Signed-off-by: Wentao Guan <guanwentao@...ontech.com>
> Signed-off-by: Yuli Wang <wangyuli@...ontech.com>
> ---
>   arch/loongarch/kernel/proc.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/arch/loongarch/kernel/proc.c b/arch/loongarch/kernel/proc.c
> index 6ce46d92f1f1..56a230238c9c 100644
> --- a/arch/loongarch/kernel/proc.c
> +++ b/arch/loongarch/kernel/proc.c
> @@ -91,10 +91,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
>   	if (cpu_has_lbt_mips)	seq_printf(m, " lbt_mips");
>   	seq_printf(m, "\n");
>   
> -	seq_printf(m, "Hardware Watchpoint\t: %s",
> -		      cpu_has_watch ? "yes, " : "no\n");
> +	seq_printf(m, "Hardware Watchpoint\t: %s", str_yes_no(cpu_has_watch));
>   	if (cpu_has_watch) {
> -		seq_printf(m, "iwatch count: %d, dwatch count: %d\n",
> +		seq_printf(m, ", iwatch count: %d, dwatch count: %d",
>   		      cpu_data[n].watch_ireg_count, cpu_data[n].watch_dreg_count);
>   	}
>   
> @@ -104,7 +103,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
>   	raw_notifier_call_chain(&proc_cpuinfo_chain, 0,
>   				&proc_cpuinfo_notifier_args);
>   
> -	seq_printf(m, "\n");
> +	seq_printf(m, "\n\n");
>   
>   	return 0;
>   }
Best wishes,
-- 
WangYuli

Download attachment "OpenPGP_0xC5DA1F3046F40BEE.asc" of type "application/pgp-keys" (633 bytes)

Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ