selinux: resolve checkpatch errors
PATCH 1/1 selinux: resolve checkpatch errors
Reported by checkpatch:
security/selinux/nlmsgtab.c
---------------------------
ERROR: that open brace { should be on the previous line
#29: FILE: security/selinux/nlmsgtab.c:29:
+static const struct nlmsg_perm nlmsg_route_perms[] =
+{
ERROR: that open brace { should be on the previous line
#97: FILE: security/selinux/nlmsgtab.c:97:
+static const struct nlmsg_perm nlmsg_tcpdiag_perms[] =
+{
ERROR: that open brace { should be on the previous line
#105: FILE: security/selinux/nlmsgtab.c:105:
+static const struct nlmsg_perm nlmsg_xfrm_perms[] =
+{
ERROR: that open brace { should be on the previous line
#134: FILE: security/selinux/nlmsgtab.c:134:
+static const struct nlmsg_perm nlmsg_audit_perms[] =
+{
security/selinux/ss/policydb.c
------------------------------
ERROR: that open brace { should be on the previous line
#318: FILE: security/selinux/ss/policydb.c:318:
+static int (*destroy_f[SYM_NUM]) (void *key, void *datum, void *datap) =
+{
ERROR: that open brace { should be on the previous line
#674: FILE: security/selinux/ss/policydb.c:674:
+static int (*index_f[SYM_NUM]) (void *key, void *datum, void *datap) =
+{
ERROR: that open brace { should be on the previous line
#1643: FILE: security/selinux/ss/policydb.c:1643:
+static int (*read_f[SYM_NUM]) (struct policydb *p, struct symtab *s, void *fp) =
+{
ERROR: that open brace { should be on the previous line
#3246: FILE: security/selinux/ss/policydb.c:3246:
+ void *datap) =
+{Signed-off-by Christian Göttsche <[email protected]>
--- security/selinux/include/initial_sid_to_string.h | 3 +-- security/selinux/nlmsgtab.c | 12 ++++-------- security/selinux/ss/policydb.c | 12 ++++-------- 3 files changed, 9 insertions(+), 18 deletions(-)
security/selinux/include/initial_sid_to_string.h +1 -2
@@ -1,6 +1,5 @@/* SPDX-License-Identifier: GPL-2.0 */ -static const char *initial_sid_to_string[] = -{ +static const char *initial_sid_to_string[] = {NULL ,"kernel" ,"security" ,
security/selinux/nlmsgtab.c +4 -8
@@ -25,8 +25,7 @@ struct nlmsg_perm {u32 perm; }; -static const struct nlmsg_perm nlmsg_route_perms[] = -{ +static const struct nlmsg_perm nlmsg_route_perms[] = { {RTM_NEWLINK ,NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, {RTM_DELLINK ,NETLINK_ROUTE_SOCKET__NLMSG_WRITE }, {RTM_GETLINK ,NETLINK_ROUTE_SOCKET__NLMSG_READ },
@@ -97,16 +96,14 @@ static const struct nlmsg_perm nlmsg_route_perms[] = { RTM_GETTUNNEL, NETLINK_ROUTE_SOCKET__NLMSG_READ }, }; -static const struct nlmsg_perm nlmsg_tcpdiag_perms[] = -{ +static const struct nlmsg_perm nlmsg_tcpdiag_perms[] = { {TCPDIAG_GETSOCK ,NETLINK_TCPDIAG_SOCKET__NLMSG_READ }, {DCCPDIAG_GETSOCK ,NETLINK_TCPDIAG_SOCKET__NLMSG_READ }, {SOCK_DIAG_BY_FAMILY ,NETLINK_TCPDIAG_SOCKET__NLMSG_READ }, {SOCK_DESTROY ,NETLINK_TCPDIAG_SOCKET__NLMSG_WRITE }, }; -static const struct nlmsg_perm nlmsg_xfrm_perms[] = -{ +static const struct nlmsg_perm nlmsg_xfrm_perms[] = { {XFRM_MSG_NEWSA ,NETLINK_XFRM_SOCKET__NLMSG_WRITE }, {XFRM_MSG_DELSA ,NETLINK_XFRM_SOCKET__NLMSG_WRITE }, { XFRM_MSG_GETSA, NETLINK_XFRM_SOCKET__NLMSG_READ },
@@ -134,8 +131,7 @@ static const struct nlmsg_perm nlmsg_xfrm_perms[] = { XFRM_MSG_GETDEFAULT, NETLINK_XFRM_SOCKET__NLMSG_READ }, }; -static const struct nlmsg_perm nlmsg_audit_perms[] = -{ +static const struct nlmsg_perm nlmsg_audit_perms[] = { {AUDIT_GET ,NETLINK_AUDIT_SOCKET__NLMSG_READ }, {AUDIT_SET ,NETLINK_AUDIT_SOCKET__NLMSG_WRITE }, { AUDIT_LIST, NETLINK_AUDIT_SOCKET__NLMSG_READPRIV },
security/selinux/ss/policydb.c +4 -8
@@ -314,8 +314,7 @@ static int cat_destroy(void *key, void *datum, void *p)return 0 ; } -static int (*destroy_f[SYM_NUM ]) (void *key,void *datum,void *datap) = -{ +static int (*destroy_f[SYM_NUM ]) (void *key,void *datum,void *datap) = { common_destroy, cls_destroy, role_destroy,
@@ -670,8 +669,7 @@ static int cat_index(void *key, void *datum, void *datap)return 0 ; } -static int (*index_f[SYM_NUM ]) (void *key,void *datum,void *datap) = -{ +static int (*index_f[SYM_NUM ]) (void *key,void *datum,void *datap) = { common_index, class_index, role_index,
@@ -1639,8 +1637,7 @@ static int cat_read(struct policydb *p, struct symtab *s, void *fp)return rc; } -static int (*read_f[SYM_NUM ]) (struct policydb *p,struct symtab *s,void *fp) = -{ +static int (*read_f[SYM_NUM ]) (struct policydb *p,struct symtab *s,void *fp) = { common_read, class_read, role_read,
@@ -3242,8 +3239,7 @@ static int user_write(void *vkey, void *datum, void *ptr) }static int (*write_f[SYM_NUM ]) (void *key,void *datum, -void *datap) = -{ +void *datap) = { common_write, class_write, role_write,
Signature · 1 line
2.36.0
Paul Moore
maintainerQuoted 47 lines · Christian Göttsche
Reported by checkpatch:
security/selinux/nlmsgtab.c --------------------------- ERROR: that open brace { should be on the previous line #29: FILE: security/selinux/nlmsgtab.c:29: +static const struct nlmsg_perm nlmsg_route_perms[] = +{ ERROR: that open brace { should be on the previous line #97: FILE: security/selinux/nlmsgtab.c:97: +static const struct nlmsg_perm nlmsg_tcpdiag_perms[] = +{ ERROR: that open brace { should be on the previous line #105: FILE: security/selinux/nlmsgtab.c:105: +static const struct nlmsg_perm nlmsg_xfrm_perms[] = +{ ERROR: that open brace { should be on the previous line #134: FILE: security/selinux/nlmsgtab.c:134: +static const struct nlmsg_perm nlmsg_audit_perms[] = +{ security/selinux/ss/policydb.c ------------------------------ ERROR: that open brace { should be on the previous line #318: FILE: security/selinux/ss/policydb.c:318: +static int (*destroy_f[SYM_NUM]) (void *key, void *datum, void *datap) = +{ ERROR: that open brace { should be on the previous line #674: FILE: security/selinux/ss/policydb.c:674: +static int (*index_f[SYM_NUM]) (void *key, void *datum, void *datap) = +{ ERROR: that open brace { should be on the previous line #1643: FILE: security/selinux/ss/policydb.c:1643: +static int (*read_f[SYM_NUM]) (struct policydb *p, struct symtab *s, void *fp) = +{ ERROR: that open brace { should be on the previous line #3246: FILE: security/selinux/ss/policydb.c:3246: + void *datap) = +{
Quoted 6 lines
Signed-off-by Christian Göttsche <[email protected]>--- security/selinux/include/initial_sid_to_string.h | 3 +-- security/selinux/nlmsgtab.c | 12 ++++-------- security/selinux/ss/policydb.c | 12 ++++-------- 3 files changed, 9 insertions(+), 18 deletions(-)
I generally dislike checkpatch-only patches, but you've been fixing a lot of other things so I'll go ahead and merge this into selinux/next.
Signature · 1 line
paul-moore.com