login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
July
»
7
Re: [PATCH] devcgroup: code cleanup
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Serge E. Hallyn
Subject:
Re: [PATCH] devcgroup: code cleanup
Date: Monday, July 7, 2008 - 8:54 am
Quoting Li Zefan (
lizf@cn.fujitsu.com
):
quoted text
> - remove a redundant memset() > - use simple_strtoul() to parse major/minor > > Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Thanks, all look good. Acked-by: Serge Hallyn <serue@us.ibm.com> thanks -serge
quoted text
> --- > security/device_cgroup.c | 15 +++------------ > 1 files changed, 3 insertions(+), 12 deletions(-) > > diff --git a/security/device_cgroup.c b/security/device_cgroup.c > index ddd92ce..98826b0 100644 > --- a/security/device_cgroup.c > +++ b/security/device_cgroup.c > @@ -188,7 +188,7 @@ static struct cgroup_subsys_state *devcgroup_create(struct cgroup_subsys *ss, > } > wh->minor = wh->major = ~0; > wh->type = DEV_ALL; > - wh->access = ACC_MKNOD | ACC_READ | ACC_WRITE; > + wh->access = ACC_MASK; > list_add(&wh->list, &dev_cgroup->whitelist); > } else { > parent_dev_cgroup = cgroup_to_devcgroup(parent_cgroup); > @@ -250,7 +250,6 @@ static char type_to_char(short type) > > static void set_majmin(char *str, unsigned m) > { > - memset(str, 0, MAJMINLEN); > if (m == ~0) > sprintf(str, "*"); > else > @@ -405,11 +404,7 @@ static ssize_t devcgroup_access_write(struct cgroup *cgroup, struct cftype *cft, > wh.major = ~0; > b++; > } else if (isdigit(*b)) { > - wh.major = 0; > - while (isdigit(*b)) { > - wh.major = wh.major*10+(*b-'0'); > - b++; > - } > + wh.major = simple_strtoul(b, &b, 0); > } else { > retval = -EINVAL; > goto out2; > @@ -425,11 +420,7 @@ static ssize_t devcgroup_access_write(struct cgroup *cgroup, struct cftype *cft, > wh.minor = ~0; > b++; > } else if (isdigit(*b)) { > - wh.minor = 0; > - while (isdigit(*b)) { > - wh.minor = wh.minor*10+(*b-'0'); > - b++; > - } > + wh.minor = simple_strtoul(b, &b, 0); > } else { > retval = -EINVAL; > goto out2; > -- > 1.5.4.rc3
--
unsubscribe notice
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/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH] devcgroup: code cleanup
, Li Zefan
, (Fri Jul 4, 11:30 pm)
Re: [PATCH] devcgroup: code cleanup
, Serge E. Hallyn
, (Mon Jul 7, 8:54 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Eric Sandeen
Re: [PATCH] xfs: do not pass unused params to xfs_flush_pages
Daniel Hazelton
Re: x86: 4kstacks default
Mathieu Desnoyers
Re: Linux 2.6.25-rc2
Alexey Dobriyan
Re: [2.6.22.2 review 09/84] Fix rfkill IRQ flags.
Alexandre Oliva
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
git
:
Felipe Contreras
Re: [kernel.org users] [RFD] On deprecating "git-foo" for builtins
Johannes Schindelin
[PATCH] fetch: refuse to fetch into the current branch in a non-bare repository
Johannes Schindelin
Re: [PATCH] Fix install-doc-quick target
Nicolas Pitre
Re: About git and the use of SHA-1
Alex Riesen
Re: git exclude patterns for directory
linux-netdev
:
Andi Kleen
Re: RFC: Nagle latency tuning
Herbert Xu
Re: Oops in tun: bisected to Limit amount of queued packets per device
gregkh
Patch "IPv6: keep route for tentative address" has been added to the 2.6.34-stable...
Patrick McHardy
Re: [rfc 02/13] [RFC 02/13] netfilter: nf_conntrack_sip: Add callid parser
Paul Gortmaker
[PATCH net-next 09/16] tipc: Relocate trivial link status functions to header file
git-commits-head
:
Linux Kernel Mailing List
sh: Fix compile error by operands(mov.l) in sh3/entry.S
Linux Kernel Mailing List
New device ID for sc92031 [1088:2031]
Linux Kernel Mailing List
tmpfs: depend on shmem
Linux Kernel Mailing List
drivers/acpi: use kasprintf
Linux Kernel Mailing List
Staging: et131x: prune all the debug code
openbsd-misc
:
Andres Salazar
About priorities in /etc/resolv.conf
Tonnerre LOMBARD
Re: bge0: watchdog timeout
Rob Shepherd
x86 hardware for router system
Damien Miller
Re: Patching a SSH 'Weakness'
ropers
Re: Real men don't attack straw men
Colocation donated by:
Syndicate