]> Git Repo - linux.git/commit
cpuset: remove unneeded NODEMASK_ALLOC() in cpuset_sprintf_memlist()
authorLi Zefan <[email protected]>
Wed, 23 Mar 2011 23:42:45 +0000 (16:42 -0700)
committerLinus Torvalds <[email protected]>
Thu, 24 Mar 2011 02:46:34 +0000 (19:46 -0700)
commit9303e0c4814d2a6afca878cc35433291e862169c
tree786866f6f0639edcc2996d4157ea7128b2400898
parentf9434ad1552427fab49336e1a6e3ef121895b9d1
cpuset: remove unneeded NODEMASK_ALLOC() in cpuset_sprintf_memlist()

It's not necessary to copy cpuset->mems_allowed to a buffer allocated by
NODEMASK_ALLOC().  Just pass it to nodelist_scnprintf().

As spotted by Paul, a side effect is we fix a bug that the function can
return -ENOMEM but the caller doesn't expect negative return value.
Therefore change the return value of cpuset_sprintf_cpulist() and
cpuset_sprintf_memlist() from int to size_t.

Signed-off-by: Li Zefan <[email protected]>
Acked-by: Paul Menage <[email protected]>
Acked-by: David Rientjes <[email protected]>
Cc: Miao Xie <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
kernel/cpuset.c
This page took 0.052305 seconds and 4 git commands to generate.