Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

apparmor: remove useless static inline functions

Remove the following useless static inline functions:

1. label_is_visible() is a static function in
security/apparmor/label.c, and it's not used, aa_ns_visible()
can do the same things as it, so it's redundant.

2. is_deleted() is a static function in security/apparmor/file.c,
and it's not used since commit aebd873e8d3e ("apparmor: refactor
path name lookup and permission checks around labels"), so it's
redundant.

They are redundant, so remove them.

Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>

authored by

Gaosheng Cui and committed by
John Johansen
2f7a29de 53991aed

-19
-13
security/apparmor/file.c
··· 141 141 return aa_audit(type, profile, &sa, file_audit_cb); 142 142 } 143 143 144 - /** 145 - * is_deleted - test if a file has been completely unlinked 146 - * @dentry: dentry of file to test for deletion (NOT NULL) 147 - * 148 - * Returns: true if deleted else false 149 - */ 150 - static inline bool is_deleted(struct dentry *dentry) 151 - { 152 - if (d_unlinked(dentry) && d_backing_inode(dentry)->i_nlink == 0) 153 - return true; 154 - return false; 155 - } 156 - 157 144 static int path_name(const char *op, struct aa_label *label, 158 145 const struct path *path, int flags, char *buffer, 159 146 const char **name, struct path_cond *cond, u32 request)
-6
security/apparmor/label.c
··· 1256 1256 return label; 1257 1257 } 1258 1258 1259 - static inline bool label_is_visible(struct aa_profile *profile, 1260 - struct aa_label *label) 1261 - { 1262 - return aa_ns_visible(profile->ns, labels_ns(label), true); 1263 - } 1264 - 1265 1259 /* match a profile and its associated ns component if needed 1266 1260 * Assumes visibility test has already been done. 1267 1261 * If a subns profile is not to be matched should be prescreened with