Skip to contentSkip to conversation

apparmor: mark new functions static

PATCH In review Arnd Bergmann 2 participants 2 messages Oct 20, 2023 – Oct 22, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 apparmor: mark new functions static

From: Arnd Bergmann <[email protected]>

Two new functions were introduced as global functions when they are only called from inside the file that defines them and should have been static:

security/apparmor/lsm.c:658:5: error: no previous prototype for 'apparmor_uring_override_creds' [-Werror=missing-prototypes] security/apparmor/lsm.c:682:5: error: no previous prototype for 'apparmor_uring_sqpoll' [-Werror=missing-prototypes]

Fixes c4371d90633b7 ("apparmor: add io_uring mediation")
---
 security/apparmor/lsm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
security/apparmor/lsm.c +2 -2
index 91ff91cf1aaef..4981bdf029931 100644
@@ -655,7 +655,7 @@ static int profile_uring(struct aa_profile *profile, u32 request,
  * Check to see if the current task is allowed to override it's credentials
  * to service an io_uring operation.
  */
-int apparmor_uring_override_creds(const struct cred *new)
+static int apparmor_uring_override_creds(const struct cred *new)
 {
 	struct aa_profile *profile;
 	struct aa_label *label;
@@ -679,7 +679,7 @@ int apparmor_uring_override_creds(const struct cred *new)
  * Check to see if the current task is allowed to create a new io_uring
  * kernel polling thread.
  */
-int apparmor_uring_sqpoll(void)
+static int apparmor_uring_sqpoll(void)
 {
 	struct aa_profile *profile;
 	struct aa_label *label;
Signature · 1 line
2.39.2
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

Two new functions were introduced as global functions when they are only called from inside the file that defines them and should have been static:

security/apparmor/lsm.c:658:5: error: no previous prototype for 'apparmor_uring_override_creds' [-Werror=missing-prototypes] security/apparmor/lsm.c:682:5: error: no previous prototype for 'apparmor_uring_sqpoll' [-Werror=missing-prototypes]

Fixes c4371d90633b7 ("apparmor: add io_uring mediation")

I have pulled this into apparmor-next

Quoted 26 lines
---
  security/apparmor/lsm.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
security/apparmor/lsm.c +2 -2
index 91ff91cf1aaef..4981bdf029931 100644
@@ -655,7 +655,7 @@ static int profile_uring(struct aa_profile *profile, u32 request,
   * Check to see if the current task is allowed to override it's credentials
   * to service an io_uring operation.
   */
-int apparmor_uring_override_creds(const struct cred *new)
+static int apparmor_uring_override_creds(const struct cred *new)
  {
  	struct aa_profile *profile;
  	struct aa_label *label;
@@ -679,7 +679,7 @@ int apparmor_uring_override_creds(const struct cred *new)
   * Check to see if the current task is allowed to create a new io_uring
   * kernel polling thread.
   */
-int apparmor_uring_sqpoll(void)
+static int apparmor_uring_sqpoll(void)
  {
  	struct aa_profile *profile;
  	struct aa_label *label;