Re: [PATCH] lib/kstrtox.c clean kstrtoll function

2015-01-23 Thread Anshul Garg
se give your views on this change.. If this change seems correct i will update overflow logic in my sent patch. Hope to hear from you soon. Thanks Anshul Garg On Thu, Jan 22, 2015 at 10:55 PM, Jeff Epler wrote: > On Thu, Jan 22, 2015 at 05:54:10AM -0800, Anshul Garg wrote: >> -

[PATCH] iio/inkern.c Use list_for_each_entry_safe

2015-12-08 Thread Anshul Garg
Use list_for_each_entry_safe instead of list_for_each_safe and list_entry call. Signed-off-by: Anshul Garg --- drivers/iio/inkern.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index c8bad3c..f764eb6 100644 --- a

[PATCH] iio/inkern.c Use list_for_each_entry_safe

2015-12-08 Thread Anshul Garg
Use list_for_each_entry_safe instead of list_for_each_safe and list_entry call. Signed-off-by: Anshul Garg --- drivers/iio/inkern.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c index c8bad3c..f764eb6 100644 --- a

Re: [PATCH] lib/int_sqrt.c: Optimize square root function

2015-02-08 Thread Anshul Garg
Dear Mr. linus, Thanks for quick replies. Yes performance numbers are not conclusive enough. So its better to discard this patch as of now. I will try to explore more in this area. Thanks & regards Anshul Garg On Fri, Feb 6, 2015 at 1:07 AM, Linus Torvalds wrote: > On Thu, Feb 5,

Re: [PATCH] lib/int_sqrt.c: Optimize square root function

2015-02-05 Thread Anshul Garg
On Thu, Feb 5, 2015 at 10:33 AM, Linus Torvalds wrote: > On Thu, Feb 5, 2015 at 10:20 AM, Linus Torvalds > wrote: >> >> Hmm. I did that too [..] > > Side note: one difference in our results (apart from possibly just CPU > uarch details) is that my loop goes to 100M to make it easier to just > tim

[PATCH] lib/int_sqrt.c: Optimize square root function

2015-02-02 Thread Anshul Garg
From: Anshul Garg Unnecessary instructions are executing even though m is greater than x so added logic to make m less than equal to x before performing these operations. Signed-off-by: Anshul Garg --- lib/int_sqrt.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/int_sqrt.c b

Re: [PATCH] lib/int_sqrt.c: Optimize square root function

2015-02-03 Thread Anshul Garg
On Tue, Feb 3, 2015 at 10:17 AM, Davidlohr Bueso wrote: > On Mon, 2015-02-02 at 11:00 -0800, Linus Torvalds wrote: >> Hmm. I don't disagree, but would like some more feedback. >> >> Davidlohr - you were the person to touch this function last (commit >> 30493cc9dddb: "lib/int_sqrt.c: optimize squar

Re: [PATCH] lib/int_sqrt.c: Optimize square root function

2015-02-03 Thread Anshul Garg
e of x. But in future also range of x can change if apart from memory some other module starts using this function more extensively. So in worst case it will be almost same as current implementation. So i think its better to scale m according to x by doing while(m > x) m>>=2; rather than acco

[PATCH] lib/int_sqrt.c: Optimize square root function

2015-01-29 Thread Anshul Garg
From: Anshul Garg Unnecessary instructions are executing even though m is greater than x so added logic to make m less than equal to x before performing these operations. Signed-off-by: Anshul Garg --- lib/int_sqrt.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/int_sqrt.c b

[RESEND PATCH] lib/int_sqrt.c: Optimize square root function

2015-01-31 Thread Anshul Garg
From: Anshul Garg Unnecessary instructions are executing even though m is greater than x so added logic to make m less than equal to x before performing these operations. Signed-off-by: Anshul Garg --- lib/int_sqrt.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/int_sqrt.c b

[PATCH] lib/kstrtox.c break if overflow is detected

2015-01-21 Thread Anshul Garg
From: Anshul Garg 1. While converting string representation to integer break the loop if overflow is detected. 2. Clean kstrtoll function Signed-off-by: Anshul Garg --- lib/kstrtox.c | 28 +--- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/lib

Re: [PATCH] lib/kstrtox.c break if overflow is detected

2015-01-22 Thread Anshul Garg
Dear Mr. Levente , Thanks for the reply. I will segregate this patch in two different patches. I will send these patches again. Thanks Anshul Garg On Thu, Jan 22, 2015 at 1:09 AM, Levente Kurusa wrote: > Hi, > > On Wed, Jan 21, 2015 at 11:26:26AM -0800, Anshul Garg wrote: >&g

[PATCH] lib/kstrtox.c clean kstrtoll function

2015-01-22 Thread Anshul Garg
From: Anshul Garg Instead of having same code for negative and postive integer, use sign variable for integer parsing. Signed-off-by: Anshul Garg --- lib/kstrtox.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/kstrtox.c b/lib/kstrtox.c

[PATCH] lib/kstrtox.c Stop parsing integer on overflow

2015-01-22 Thread Anshul Garg
From: Anshul Garg While converting string representation to integer break the loop if overflow is detected. Signed-off-by: Anshul Garg --- lib/kstrtox.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/kstrtox.c b/lib/kstrtox.c index ec8da78..6f30209 100644 --- a

Re: Fw: [PATCH] lib/kstrtox.c Stop parsing integer on overflow

2015-02-19 Thread Anshul Garg
On Wed, Feb 18, 2015 at 1:14 PM, Alexey Dobriyan wrote: > On Tue, Feb 17, 2015 at 04:17:24PM -0800, Andrew Morton wrote: >> ? >> >> Begin forwarded message: >> >> Date: Mon, 16 Feb 2015 10:48:50 -0800 >> From: Anshul Garg >> To: linux-kernel@vger.k

[PATCH] lib/kstrtox.c Stop parsing integer on overflow

2015-02-16 Thread Anshul Garg
From: Anshul Garg While converting string representation to integer break the loop if overflow is detected. Signed-off-by: Anshul Garg --- lib/kstrtox.c |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/kstrtox.c b/lib/kstrtox.c index ec8da78..6f30209 100644 --- a

[PATCH] lib/vsprintf.c:Avoid extra operation in dentry_name

2015-02-16 Thread Anshul Garg
From: Anshul Garg Remove unnecessary increment and decrement operation in dentry_name function as after increment operation loop is breaked and then decrement operation is performed. So remove increment and decrement operation from the function. Signed-off-by: Anshul Garg --- lib/vsprintf.c

Re: [PATCH] lib/vsprintf.c:Avoid extra operation in dentry_name

2015-02-17 Thread Anshul Garg
Yes suggested code modification will break if (p==d) branch is not taken. Thanks for pointing out this point. So its better to keep code as it is. On Tue, Feb 17, 2015 at 12:44 AM, Richard Weinberger wrote: > On Mon, Feb 16, 2015 at 7:49 PM, Anshul Garg wrote: >> From: An

[PATCH] Sched/rt:Fix memory leak in alloc_rt_sched_group

2015-07-01 Thread Anshul Garg
From: Anshul Garg Added code to free allocated memory by function alloc_rt_sched_group in case kzalloc api fails. Signed-off-by: Anshul Garg --- kernel/sched/rt.c |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index f4d4b07

Re: [tip:sched/core] sched/rt: Fix memory leak in alloc_rt_sched_group()

2015-07-06 Thread Anshul Garg
Sorry for inconvenience. Thanks Anshul Garg On Mon, Jul 6, 2015 at 9:05 PM, tip-bot for Anshul Garg wrote: > Commit-ID: ecdd6804b7c9e15fe8fc836ba0233d9912834e8b > Gitweb: http://git.kernel.org/tip/ecdd6804b7c9e15fe8fc836ba0233d9912834e8b > Author: Anshul Garg > AuthorDate: Wed, 1 J

[tip:sched/core] sched/rt: Fix memory leak in alloc_rt_sched_group()

2015-07-06 Thread tip-bot for Anshul Garg
Commit-ID: ecdd6804b7c9e15fe8fc836ba0233d9912834e8b Gitweb: http://git.kernel.org/tip/ecdd6804b7c9e15fe8fc836ba0233d9912834e8b Author: Anshul Garg AuthorDate: Wed, 1 Jul 2015 12:29:26 -0700 Committer: Ingo Molnar CommitDate: Mon, 6 Jul 2015 14:17:14 +0200 sched/rt: Fix memory leak in