]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
landlock: Constify get_mode_access()
authorMickaël Salaün <mic@digikod.net>
Fri, 10 Jan 2025 15:39:14 +0000 (16:39 +0100)
committerMickaël Salaün <mic@digikod.net>
Tue, 14 Jan 2025 10:57:44 +0000 (11:57 +0100)
Use __attribute_const__ for get_mode_access().

Reviewed-by: Günther Noack <gnoack3000@gmail.com>
Link: https://lore.kernel.org/r/20250110153918.241810-2-mic@digikod.net
Signed-off-by: Mickaël Salaün <mic@digikod.net>
security/landlock/fs.c

index 7adb25150488fc07f349e0a690e10e85c5c10a52..f81d0335b8257579be24191b29be64a2a2cd76be 100644 (file)
@@ -932,7 +932,7 @@ static int current_check_access_path(const struct path *const path,
        return check_access_path(dom, path, access_request);
 }
 
-static access_mask_t get_mode_access(const umode_t mode)
+static __attribute_const__ access_mask_t get_mode_access(const umode_t mode)
 {
        switch (mode & S_IFMT) {
        case S_IFLNK: