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: <20250212120451.GO1977892@ZenIV>
Date: Wed, 12 Feb 2025 12:04:51 +0000
From: Al Viro <viro@...iv.linux.org.uk>
To: Thorsten Blum <thorsten.blum@...ux.dev>
Cc: Christian Brauner <brauner@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Jeff Layton <jlayton@...nel.org>,
	Adrian Ratiu <adrian.ratiu@...labora.com>,
	xu xin <xu.xin16@....com.cn>,
	Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
	Felix Moessbauer <felix.moessbauer@...mens.com>,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] proc: Use str_yes_no() helper in proc_pid_ksm_stat()

On Wed, Feb 12, 2025 at 12:59:52PM +0100, Thorsten Blum wrote:
> Remove hard-coded strings by using the str_yes_no() helper function.

>  		seq_printf(m, "ksm_merge_any: %s\n",
> -				test_bit(MMF_VM_MERGE_ANY, &mm->flags) ? "yes" : "no");
> +				str_yes_no(test_bit(MMF_VM_MERGE_ANY, &mm->flags)));
>  		ret = mmap_read_lock_killable(mm);
>  		if (ret) {
>  			mmput(mm);
>  			return ret;
>  		}
>  		seq_printf(m, "ksm_mergeable: %s\n",
> -				ksm_process_mergeable(mm) ? "yes" : "no");
> +				str_yes_no(ksm_process_mergeable(mm)));

Is that any more readable?  If anything, that might be better off with something
like a printf modifier...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ