lkml.org 
[lkml]   [2003]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ~/kernel/sys.c (2.5.64) (trivial)
Apologies in advance if this is so trivial as to be non-patch-worthy.

Was poking around and noticed a possible improvement to kernekl/sys.c.
This change results in marginally better output using gcc 3.2 on x86.

As a test I constructed look-alike functions and a small driver. There
appeared to be a ~40% speedup on the "true" branch and ~5% slowdown on the
"false" branch. No effort was made to account for overhead when figuring
the percentages.

Unfortunately I don't know enough to say which side of the branch is more
commonly taken.



--- linux-2.5.64.orig/kernel/sys.c Tue Mar 4 21:28:58 2003
+++ linux-2.5.64/kernel/sys.c Tue Mar 11 22:06:12 2003
@@ -1096,18 +1096,12 @@
*/
int in_group_p(gid_t grp)
{
- int retval = 1;
- if (grp != current->fsgid)
- retval = supplemental_group_member(grp);
- return retval;
+ return (grp != current->fsgid) ? supplemental_group_member(grp) : 1;
}

int in_egroup_p(gid_t grp)
{
- int retval = 1;
- if (grp != current->egid)
- retval = supplemental_group_member(grp);
- return retval;
+ return (grp != current->egid) ? supplemental_group_member(grp) : 1;
}

DECLARE_RWSEM(uts_sem);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.120 / U:1.188 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site