Research Menu

.
Skip Search Box

SELinux Mailing List

Re: [PATCH] Improve SELinux performance when AVC misses.

From: James Morris <jmorris_at_namei.org>
Date: Thu, 27 Sep 2007 13:47:43 -0700 (PDT)


On Thu, 27 Sep 2007, KaiGai Kohei wrote:

> However, there are several ugly manner like as:
>
> -+ c_iter->startbit = e_startbit & ~(NETLBL_CATMAP_SIZE - 1);
> ++ c_iter->startbit
> ++ = e_startbit & ~(NETLBL_CATMAP_SIZE - 1);
> If both side of the formula is in a same line, the width of the line get overs
> the 80-char limitation.

This is pretty common, so don't worry.

>
>
> ++ char *nm;
> :
> ++ if (head != prev) {
> ++ nm = policydb.p_cat_val_to_name[prev];
> ++ len += strlen(nm) + 1;
> ++ }
>
> If the temporary char * variable is named as "cat_name", the above longest
> line overs 80-char limitation, so I named it as "nm".
> This naming may be unclear for its purpose.

I think it's better to keep the 80 column limit here.

> ++ struct ebitmap_node *_n;
> ++ _n = kzalloc(sizeof(*_n), GFP_KERNEL);

Leading underscores are usually used to indicate that core code is not supposed to use the symbol. Please change it to not have a leading underscore. 'tmp' or 'n2' is probably ok.

-- 
James Morris
<jmorris@namei.org>

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
Received on Thu 27 Sep 2007 - 16:48:13 EDT
 

Date Posted: Jan 15, 2009 | Last Modified: Jan 15, 2009 | Last Reviewed: Jan 15, 2009

 
bottom

National Security Agency / Central Security Service