From: Paul Moore <paul@paul-moore.com>
To: Thorsten Blum <thorsten.blum@linux.dev>,
Stephen Smalley <stephen.smalley.work@gmail.com>,
Ondrej Mosnacek <omosnace@redhat.com>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
selinux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selinux: use QSTR() instead of QSTR_INIT() in init_sel_fs
Date: Mon, 27 Apr 2026 18:24:05 -0400 [thread overview]
Message-ID: <3fa89f553526d4d68e1d5c0ba51a9664@paul-moore.com> (raw)
In-Reply-To: <20260422123104.100014-3-thorsten.blum@linux.dev>
On Apr 22, 2026 Thorsten Blum <thorsten.blum@linux.dev> wrote:
>
> Drop the length argument and use the simpler QSTR().
>
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
> security/selinux/selinuxfs.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
> index 83aa765a09f9..8c107af5140e 100644
> --- a/security/selinux/selinuxfs.c
> +++ b/security/selinux/selinuxfs.c
> @@ -2107,8 +2107,7 @@ struct path selinux_null __ro_after_init;
>
> int __init init_sel_fs(void)
> {
> - struct qstr null_name = QSTR_INIT(NULL_FILE_NAME,
> - sizeof(NULL_FILE_NAME)-1);
> + struct qstr null_name = QSTR(NULL_FILE_NAME);
> int err;
>
> if (!selinux_enabled_boot)
Technically I imagine QSTR_INIT() would be slightly quicker since we use
sizeof() instead of strlen(), but the code is simpler and I can't we only
pay the performance hit once at boot.
Merged into selinux/dev, thanks.
--
paul-moore.com
prev parent reply other threads:[~2026-04-27 22:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-22 12:31 Thorsten Blum
2026-04-27 22:24 ` Paul Moore [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3fa89f553526d4d68e1d5c0ba51a9664@paul-moore.com \
--to=paul@paul-moore.com \
--cc=linux-kernel@vger.kernel.org \
--cc=omosnace@redhat.com \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.com \
--cc=thorsten.blum@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome