Re: [PATCH v3 2/2] kexec: Use min_t to simplify logic

2013-02-27 Thread Andrew Morton
On Tue, 26 Feb 2013 16:55:57 +0800 Zhang Yanfei wrote: > ___ 2013___02___26___ 16:53, Andrew Morton __: > > On Tue, 26 Feb 2013 16:49:02 +0800 Zhang Yanfei > > wrote: > > > diff --git a/kernel/kexec.c b/kernel/kexec.c > >>> [] > @@ -822,13 +822,9 @@ static int kimage_load_normal_

Re: [PATCH v3 2/2] kexec: Use min_t to simplify logic

2013-02-26 Thread Zhang Yanfei
于 2013年02月26日 16:53, Andrew Morton 写道: > On Tue, 26 Feb 2013 16:49:02 +0800 Zhang Yanfei > wrote: > diff --git a/kernel/kexec.c b/kernel/kexec.c >>> [] @@ -822,13 +822,9 @@ static int kimage_load_normal_segment(struct kimage *image, >>> [] + mchunk = min_t(size_t, m

Re: [PATCH v3 2/2] kexec: Use min_t to simplify logic

2013-02-26 Thread Andrew Morton
On Tue, 26 Feb 2013 16:49:02 +0800 Zhang Yanfei wrote: > >> diff --git a/kernel/kexec.c b/kernel/kexec.c > > [] > >> @@ -822,13 +822,9 @@ static int kimage_load_normal_segment(struct kimage > >> *image, > > [] > >> + mchunk = min_t(size_t, mbytes, > >> + (size_t

Re: [PATCH v3 2/2] kexec: Use min_t to simplify logic

2013-02-26 Thread Zhang Yanfei
于 2013年02月26日 16:38, Joe Perches 写道: > On Tue, 2013-02-26 at 13:30 +0800, Zhang Yanfei wrote: >> This is just a tweak: using min_t to simplify logic of variable >> assignments. >> >> v3: >> - cast type of (PAGE_SIZE - (maddr & ~PAGE_MASK)) into size_t. > > Why? Isn't this just a redundant cast? >

Re: [PATCH v3 2/2] kexec: Use min_t to simplify logic

2013-02-26 Thread Joe Perches
On Tue, 2013-02-26 at 13:30 +0800, Zhang Yanfei wrote: > This is just a tweak: using min_t to simplify logic of variable > assignments. > > v3: > - cast type of (PAGE_SIZE - (maddr & ~PAGE_MASK)) into size_t. Why? Isn't this just a redundant cast? > diff --git a/kernel/kexec.c b/kernel/kexec.c

[PATCH v3 2/2] kexec: Use min_t to simplify logic

2013-02-25 Thread Zhang Yanfei
This is just a tweak: using min_t to simplify logic of variable assignments. v3: - cast type of (PAGE_SIZE - (maddr & ~PAGE_MASK)) into size_t. v2: - Rewrite patch description as Simon suggested. - Fix an inappropriate if test introduced by v1. Thanks Simon. Cc: "Eric W. Biederman" Cc: Andrew M