linux/security/selinux
Eric Paris 92ae9e82d9 SELinux: remove needless sel_div function
I'm not really sure what the idea behind the sel_div function is, but it's
useless.  Since a and b are both unsigned, it's impossible for a % b < 0.
That means that part of the function never does anything.  Thus it's just a
normal /.  Just do that instead.  I don't even understand what that operation
was supposed to mean in the signed case however....

If it was signed:
sel_div(-2, 4) == ((-2 / 4) - ((-2 % 4) < 0))
		  ((0)      - ((-2)     < 0))
		  ((0)      - (1))
		  (-1)

What actually happens:
sel_div(-2, 4) == ((18446744073709551614 / 4) - ((18446744073709551614 % 4) < 0))
		  ((4611686018427387903)      - ((2 < 0))
		  (4611686018427387903        - 0)
		  ((unsigned int)4611686018427387903)
		  (4294967295)

Neither makes a whole ton of sense to me.  So I'm getting rid of the
function entirely.

Signed-off-by: Eric Paris <eparis@redhat.com>
2012-04-09 12:22:57 -04:00
..
include SELinux: add default_type statements 2012-04-09 12:22:48 -04:00
ss SELinux: possible NULL deref in context_struct_to_string 2012-04-09 12:22:56 -04:00
.gitignore SELinux: add .gitignore files for dynamic classes 2009-10-24 09:42:27 +08:00
Kconfig selinux: Deprecate and schedule the removal of the the compat_net functionality 2008-12-31 12:54:11 -05:00
Makefile selinux: change to new flag variable 2010-10-21 10:12:40 +11:00
avc.c lsm_audit: don't specify the audit pre/post callbacks in 'struct common_audit_data' 2012-04-03 09:49:59 -07:00
exports.c selinux: sparse fix: include selinux.h in exports.c 2011-09-09 16:56:32 -07:00
hooks.c SELinux: audit failed attempts to set invalid labels 2012-04-09 12:22:56 -04:00
netif.c doc: Update the email address for Paul Moore in various source files 2011-08-01 17:58:33 -07:00
netlabel.c doc: Update the email address for Paul Moore in various source files 2011-08-01 17:58:33 -07:00
netlink.c selinux: sparse fix: fix warnings in netlink code 2012-01-05 18:52:51 -05:00
netnode.c net: remove ipv6_addr_copy() 2011-11-22 16:43:32 -05:00
netport.c SELinux: Fix RCU deref check warning in sel_netport_insert() 2011-12-21 11:28:56 +11:00
nlmsgtab.c selinux: sparse fix: fix warnings in netlink code 2012-01-05 18:52:51 -05:00
selinuxfs.c SELinux: remove needless sel_div function 2012-04-09 12:22:57 -04:00
xfrm.c atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00