linux/fs/hostfs
Nathan Chancellor 104eef133f
hostfs: Add const qualifier to host_root in hostfs_fill_super()
After the recent conversion to the new mount API, there is a warning
when building hostfs (which may be upgraded to an error via
CONFIG_WERROR=y):

  fs/hostfs/hostfs_kern.c: In function 'hostfs_fill_super':
  fs/hostfs/hostfs_kern.c:942:27: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    942 |         char *host_root = fc->source;
        |                           ^~

Add the 'const' qualifier, as host_root will not be modified after its
assignment. Move the assignment to keep the existing reverse Christmas
tree order intact.

Fixes: cd140ce9f6 ("hostfs: convert hostfs to use the new mount API")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20240611-hostfs-fix-mount-api-conversion-v1-1-ef75bbc77f44@kernel.org
Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2024-06-13 14:12:16 +02:00
..
hostfs_kern.c hostfs: Add const qualifier to host_root in hostfs_fill_super() 2024-06-13 14:12:16 +02:00
hostfs_user_exp.c um: hostfs: define our own API boundary 2023-04-20 23:04:40 +02:00
hostfs_user.c hostfs: Fix ephemeral inodes 2023-06-12 21:26:19 +02:00
hostfs.h hostfs: Fix ephemeral inodes 2023-06-12 21:26:19 +02:00
Makefile um: hostfs: define our own API boundary 2023-04-20 23:04:40 +02:00