Commit 087feb98 authored by KaiGai Kohei's avatar KaiGai Kohei Committed by James Morris

SELinux: kills warnings in Improve SELinux performance when AVC misses

This patch kills ugly warnings when the "Improve SELinux performance
when ACV misses" patch.
Signed-off-by: default avatarKaiGai Kohei <kaigai@ak.jp.nec.com>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 9fe79ad1
...@@ -193,7 +193,7 @@ int ebitmap_netlbl_import(struct ebitmap *ebmap, ...@@ -193,7 +193,7 @@ int ebitmap_netlbl_import(struct ebitmap *ebmap,
e_sft = delta % EBITMAP_UNIT_SIZE; e_sft = delta % EBITMAP_UNIT_SIZE;
while (map) { while (map) {
e_iter->maps[e_idx++] |= map & (-1UL); e_iter->maps[e_idx++] |= map & (-1UL);
map >>= EBITMAP_UNIT_SIZE; map = EBITMAP_SHIFT_UNIT_SIZE(map);
} }
} }
c_iter = c_iter->next; c_iter = c_iter->next;
...@@ -389,13 +389,13 @@ int ebitmap_read(struct ebitmap *e, void *fp) ...@@ -389,13 +389,13 @@ int ebitmap_read(struct ebitmap *e, void *fp)
if (startbit & (mapunit - 1)) { if (startbit & (mapunit - 1)) {
printk(KERN_ERR "security: ebitmap start bit (%d) is " printk(KERN_ERR "security: ebitmap start bit (%d) is "
"not a multiple of the map unit size (%Zd)\n", "not a multiple of the map unit size (%u)\n",
startbit, mapunit); startbit, mapunit);
goto bad; goto bad;
} }
if (startbit > e->highbit - mapunit) { if (startbit > e->highbit - mapunit) {
printk(KERN_ERR "security: ebitmap start bit (%d) is " printk(KERN_ERR "security: ebitmap start bit (%d) is "
"beyond the end of the bitmap (%Zd)\n", "beyond the end of the bitmap (%u)\n",
startbit, (e->highbit - mapunit)); startbit, (e->highbit - mapunit));
goto bad; goto bad;
} }
...@@ -433,9 +433,8 @@ int ebitmap_read(struct ebitmap *e, void *fp) ...@@ -433,9 +433,8 @@ int ebitmap_read(struct ebitmap *e, void *fp)
index = (startbit - n->startbit) / EBITMAP_UNIT_SIZE; index = (startbit - n->startbit) / EBITMAP_UNIT_SIZE;
while (map) { while (map) {
n->maps[index] = map & (-1UL); n->maps[index++] = map & (-1UL);
map = map >> EBITMAP_UNIT_SIZE; map = EBITMAP_SHIFT_UNIT_SIZE(map);
index++;
} }
} }
ok: ok:
......
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
#define EBITMAP_UNIT_SIZE BITS_PER_LONG #define EBITMAP_UNIT_SIZE BITS_PER_LONG
#define EBITMAP_SIZE (EBITMAP_UNIT_NUMS * EBITMAP_UNIT_SIZE) #define EBITMAP_SIZE (EBITMAP_UNIT_NUMS * EBITMAP_UNIT_SIZE)
#define EBITMAP_BIT 1ULL #define EBITMAP_BIT 1ULL
#define EBITMAP_SHIFT_UNIT_SIZE(x) \
(((x) >> EBITMAP_UNIT_SIZE / 2) >> EBITMAP_UNIT_SIZE / 2)
struct ebitmap_node { struct ebitmap_node {
struct ebitmap_node *next; struct ebitmap_node *next;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment