From: Tao Ma <[email protected]>
'start' is set to buf + buflen and do the '--' immediately.
Just set it to 'buf + buflen - 1' directly.
Cc: Tejun Heo <[email protected]>
Cc: Li Zefan <[email protected]>
---
kernel/cgroup.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f24f724..a9f8388 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -1821,9 +1821,9 @@ int cgroup_path(const struct cgroup *cgrp, char *buf, int buflen)
return 0;
}
- start = buf + buflen;
+ start = buf + buflen - 1;
- *--start = '\0';
+ *start = '\0';
for (;;) {
int len = dentry->d_name.len;
--
1.7.1
Hello,
On Thu, Nov 08, 2012 at 09:36:38PM +0800, Tao Ma wrote:
> From: Tao Ma <[email protected]>
>
> 'start' is set to buf + buflen and do the '--' immediately.
> Just set it to 'buf + buflen - 1' directly.
>
> Cc: Tejun Heo <[email protected]>
> Cc: Li Zefan <[email protected]>
You're missing S-O-B. I added it while applying. Please ack if you
agree.
Heh, I'm not sure how much of an improvement this is but there's
obviously nothing wrong with it either. Applying to cgroup/for-3.8.
Thanks.
--
tejun
On 11/08/2012 10:24 PM, Tejun Heo wrote:
> Hello,
>
> On Thu, Nov 08, 2012 at 09:36:38PM +0800, Tao Ma wrote:
>> From: Tao Ma <[email protected]>
>>
>> 'start' is set to buf + buflen and do the '--' immediately.
>> Just set it to 'buf + buflen - 1' directly.
>>
>> Cc: Tejun Heo <[email protected]>
>> Cc: Li Zefan <[email protected]>
>
> You're missing S-O-B. I added it while applying. Please ack if you
> agree.
oops, sorry, please add
Signed-off-by: Tao Ma <[email protected]>
Thanks
Tao
>
> Heh, I'm not sure how much of an improvement this is but there's
> obviously nothing wrong with it either. Applying to cgroup/for-3.8.
>
> Thanks.
>