Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5269710 authored by Eric Paris's avatar Eric Paris Committed by James Morris
Browse files

SELinux: keep the code clean formating and syntax



Formatting and syntax changes

whitespace, tabs to spaces, trailing space
put open { on same line as struct def
remove unneeded {} after if statements
change printk("Lu") to printk("llu")
convert asm/uaccess.h to linux/uaacess.h includes
remove unnecessary asm/bug.h includes
convert all users of simple_strtol to strict_strtol

Signed-off-by: default avatarEric Paris <eparis@redhat.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 9a59daa0
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@
#include <net/tcp.h>		/* struct or_callable used in sock_rcv_skb */
#include <net/net_namespace.h>
#include <net/netlabel.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>
#include <asm/ioctls.h>
#include <asm/atomic.h>
#include <linux/bitops.h>
@@ -104,7 +104,9 @@ int selinux_enforcing;

static int __init enforcing_setup(char *str)
{
	selinux_enforcing = simple_strtol(str, NULL, 0);
	unsigned long enforcing;
	if (!strict_strtoul(str, 0, &enforcing))
		selinux_enforcing = enforcing ? 1 : 0;
	return 1;
}
__setup("enforcing=", enforcing_setup);
@@ -115,7 +117,9 @@ int selinux_enabled = CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE;

static int __init selinux_enabled_setup(char *str)
{
	selinux_enabled = simple_strtol(str, NULL, 0);
	unsigned long enabled;
	if (!strict_strtoul(str, 0, &enabled))
		selinux_enabled = enabled ? 1 : 0;
	return 1;
}
__setup("selinux=", selinux_enabled_setup);
+7 −8
Original line number Diff line number Diff line
@@ -80,8 +80,7 @@ struct avc_audit_data {
/*
 * AVC statistics
 */
struct avc_cache_stats
{
struct avc_cache_stats {
	unsigned int lookups;
	unsigned int hits;
	unsigned int misses;
+0 −1
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@
#include <linux/ipv6.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <asm/bug.h>

#include "netnode.h"
#include "objsec.h"
+1 −2
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@
#include <linux/ipv6.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <asm/bug.h>

#include "netport.h"
#include "objsec.h"
+7 −3
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@
#include <linux/seq_file.h>
#include <linux/percpu.h>
#include <linux/audit.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>

/* selinuxfs pseudo filesystem for exporting the security policy API.
   Based on the proc code and the fs/nfsd/nfsctl.c code. */
@@ -57,14 +57,18 @@ int selinux_compat_net = SELINUX_COMPAT_NET_VALUE;

static int __init checkreqprot_setup(char *str)
{
	selinux_checkreqprot = simple_strtoul(str, NULL, 0) ? 1 : 0;
	unsigned long checkreqprot;
	if (!strict_strtoul(str, 0, &checkreqprot))
		selinux_checkreqprot = checkreqprot ? 1 : 0;
	return 1;
}
__setup("checkreqprot=", checkreqprot_setup);

static int __init selinux_compat_net_setup(char *str)
{
	selinux_compat_net = simple_strtoul(str, NULL, 0) ? 1 : 0;
	unsigned long compat_net;
	if (!strict_strtoul(str, 0, &compat_net))
		selinux_compat_net = compat_net ? 1 : 0;
	return 1;
}
__setup("selinux_compat_net=", selinux_compat_net_setup);
Loading