Skip to contentSkip to conversation

smack: mark 'smack_enabled' global variable as __initdata

PATCH In review Austin Kim 2 participants 4 messages Jun 29, 2021 – Jul 20, 2021

Subsystems (2)
lore
Share & tools
lore

Austin Kim

author
#0 lore raw

PATCH 1/1 smack: mark 'smack_enabled' global variable as __initdata

From: Austin Kim <[email protected]>

Mark 'smack_enabled' as __initdata
since it is only used during initialization code.

---
 security/smack/smack.h     | 2 +-
 security/smack/smack_lsm.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
security/smack/smack.h +1 -1
index c3cfbdf4944a..99c3422596ab 100644
@@ -302,7 +302,7 @@ int smack_populate_secattr(struct smack_known *skp);
 /*
  * Shared data.
  */
-extern int smack_enabled;
+extern int smack_enabled __initdata;
 extern int smack_cipso_direct;
 extern int smack_cipso_mapped;
 extern struct smack_known *smack_net_ambient;
security/smack/smack_lsm.c +1 -1
index 223a6da0e6dc..cacbe7518519 100644
@@ -54,7 +54,7 @@
 static DEFINE_MUTEX(smack_ipv6_lock);
 static LIST_HEAD(smk_ipv6_port_list);
 struct kmem_cache *smack_rule_cache;
-int smack_enabled;
+int smack_enabled __initdata;
 
 #define A(s) {"smack"#s, sizeof("smack"#s) - 1, Opt_##s}
 static struct {
Signature · 1 line
2.20.1
author
#1 lore raw

2021년 6월 29일 (화) 오후 10:41, Austin Kim <[email protected]>님이 작성:

Quoted 39 lines

From: Austin Kim <[email protected]>

Mark 'smack_enabled' as __initdata
since it is only used during initialization code.

---
 security/smack/smack.h     | 2 +-
 security/smack/smack_lsm.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
security/smack/smack.h +1 -1
index c3cfbdf4944a..99c3422596ab 100644
@@ -302,7 +302,7 @@ int smack_populate_secattr(struct smack_known *skp);
 /*
  * Shared data.
  */
-extern int smack_enabled;
+extern int smack_enabled __initdata;
 extern int smack_cipso_direct;
 extern int smack_cipso_mapped;
 extern struct smack_known *smack_net_ambient;
security/smack/smack_lsm.c +1 -2
index 223a6da0e6dc..cacbe7518519 100644
@@ -54,7 +54,7 @@
 static DEFINE_MUTEX(smack_ipv6_lock);
 static LIST_HEAD(smk_ipv6_port_list);
 struct kmem_cache *smack_rule_cache;
-int smack_enabled;
+int smack_enabled __initdata;
 
 #define A(s) {"smack"#s, sizeof("smack"#s) - 1, Opt_##s}
 static struct {
--
Quoted 2 lines

2.20.1

Dear Maintainers

Would you please review the above patch if you are available? It might not take long.

Thanks.
Austin Kim

maintainer
#2 lore raw
Quoted 7 lines · Austin Kim

2021년 6월 29일 (화) 오후 10:41, Austin Kim <[email protected]>님이 작성:

Quoted 6 lines

From: Austin Kim <[email protected]>

Mark 'smack_enabled' as __initdata
since it is only used during initialization code.

I will be taking this patch for 5.15. You should see it in next shortly after the 5.14 merge window closes.

Quoted 41 lines
Quoted 32 lines
---
 security/smack/smack.h     | 2 +-
 security/smack/smack_lsm.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
security/smack/smack.h +1 -1
index c3cfbdf4944a..99c3422596ab 100644
@@ -302,7 +302,7 @@ int smack_populate_secattr(struct smack_known *skp);
 /*
  * Shared data.
  */
-extern int smack_enabled;
+extern int smack_enabled __initdata;
 extern int smack_cipso_direct;
 extern int smack_cipso_mapped;
 extern struct smack_known *smack_net_ambient;
security/smack/smack_lsm.c +1 -2
index 223a6da0e6dc..cacbe7518519 100644
@@ -54,7 +54,7 @@
 static DEFINE_MUTEX(smack_ipv6_lock);
 static LIST_HEAD(smk_ipv6_port_list);
 struct kmem_cache *smack_rule_cache;
-int smack_enabled;
+int smack_enabled __initdata;
 
 #define A(s) {"smack"#s, sizeof("smack"#s) - 1, Opt_##s}
 static struct {
--
Quoted 2 lines

2.20.1

Dear Maintainers

Would you please review the above patch if you are available? It might not take long.

Thanks.
Austin Kim

maintainer
#3 lore raw
In reply to Austin Kim
Quoted 6 lines · Austin Kim

From: Austin Kim <[email protected]>

Mark 'smack_enabled' as __initdata
since it is only used during initialization code.

Added to Smack next.

Quoted 31 lines
---
 security/smack/smack.h     | 2 +-
 security/smack/smack_lsm.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
security/smack/smack.h +1 -1
index c3cfbdf4944a..99c3422596ab 100644
@@ -302,7 +302,7 @@ int smack_populate_secattr(struct smack_known *skp);
 /*
  * Shared data.
  */
-extern int smack_enabled;
+extern int smack_enabled __initdata;
 extern int smack_cipso_direct;
 extern int smack_cipso_mapped;
 extern struct smack_known *smack_net_ambient;
security/smack/smack_lsm.c +1 -1
index 223a6da0e6dc..cacbe7518519 100644
@@ -54,7 +54,7 @@
 static DEFINE_MUTEX(smack_ipv6_lock);
 static LIST_HEAD(smk_ipv6_port_list);
 struct kmem_cache *smack_rule_cache;
-int smack_enabled;
+int smack_enabled __initdata;
 
 #define A(s) {"smack"#s, sizeof("smack"#s) - 1, Opt_##s}
 static struct {