All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selinux: use QSTR() instead of QSTR_INIT() in init_sel_fs
@ 2026-04-22 12:31 Thorsten Blum
  2026-04-27 22:24 ` Paul Moore
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Blum @ 2026-04-22 12:31 UTC (permalink / raw)
  To: Paul Moore, Stephen Smalley, Ondrej Mosnacek
  Cc: Thorsten Blum, selinux, linux-kernel

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)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] selinux: use QSTR() instead of QSTR_INIT() in init_sel_fs
  2026-04-22 12:31 [PATCH] selinux: use QSTR() instead of QSTR_INIT() in init_sel_fs Thorsten Blum
@ 2026-04-27 22:24 ` Paul Moore
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Moore @ 2026-04-27 22:24 UTC (permalink / raw)
  To: Thorsten Blum, Stephen Smalley, Ondrej Mosnacek
  Cc: Thorsten Blum, selinux, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-27 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-22 12:31 [PATCH] selinux: use QSTR() instead of QSTR_INIT() in init_sel_fs Thorsten Blum
2026-04-27 22:24 ` Paul Moore

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.