Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-12-03 Thread Hans J. Koch
On Mon, Dec 03, 2012 at 10:53:45AM +0200, Vitalii Demianets wrote: > > On Friday 30 November 2012 23:39:06 Hans J. Koch wrote: > > > Thanks a lot for reporting and discussing that problem. I'll add a > > > > > > Reported-by: Vitalii Demianets > > > > > > if you have no objections. > > > > No objec

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-12-03 Thread Vitalii Demianets
> On Friday 30 November 2012 23:39:06 Hans J. Koch wrote: > > Thanks a lot for reporting and discussing that problem. I'll add a > > > > Reported-by: Vitalii Demianets > > > > if you have no objections. > > No objections. Thanks, Hans. By the way, what do you think about my revised version of uio

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-12-03 Thread Vitalii Demianets
On Friday 30 November 2012 23:39:06 Hans J. Koch wrote: > > Thanks a lot for reporting and discussing that problem. I'll add a > > Reported-by: Vitalii Demianets > > if you have no objections. > No objections. Thanks, Hans. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-12-02 Thread Hans J. Koch
On Sat, Dec 01, 2012 at 09:58:32AM +, Cong Ding wrote: > If it is really necessary to save the 4 lines of codes, I would suggest to do > in the following style. But you are more senior than me, so I may be wrong in > this aspect. "Seniority" (whatever you mean by that) has got nothing to do

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-12-01 Thread Cong Ding
On Sat, Dec 01, 2012 at 04:56:25AM +0100, Hans J. Koch wrote: > On Sat, Dec 01, 2012 at 02:22:44AM +0100, Cong Ding wrote: > > On Fri, Nov 30, 2012 at 10:33 PM, Hans J. Koch wrote: > > > On Fri, Nov 30, 2012 at 12:12:46PM +0100, Tux9 wrote: > > >> I like Vitalii's solution more. Hans's solution as

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-30 Thread Hans J. Koch
On Sat, Dec 01, 2012 at 02:22:44AM +0100, Cong Ding wrote: > On Fri, Nov 30, 2012 at 10:33 PM, Hans J. Koch wrote: > > On Fri, Nov 30, 2012 at 12:12:46PM +0100, Tux9 wrote: > >> I like Vitalii's solution more. Hans's solution assign the value > >> -ENOMEM to ret in every round of the loop, which i

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-30 Thread Cong Ding
On Fri, Nov 30, 2012 at 10:33 PM, Hans J. Koch wrote: > On Fri, Nov 30, 2012 at 12:12:46PM +0100, Tux9 wrote: >> I like Vitalii's solution more. Hans's solution assign the value >> -ENOMEM to ret in every round of the loop, which is a kind of wasting >> CPU cycles. > > The difference between > 1 f

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-30 Thread Greg Kroah-Hartman
On Fri, Nov 30, 2012 at 10:39:06PM +0100, Hans J. Koch wrote: > On Fri, Nov 30, 2012 at 01:16:19PM +0200, Vitalii Demianets wrote: > > On Friday 30 November 2012 01:58:22 Hans J. Koch wrote: > > > On Thu, Nov 29, 2012 at 06:36:59PM +0200, Vitalii Demianets wrote: > > > > > On Thursday 29 November 2

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-30 Thread Hans J. Koch
On Fri, Nov 30, 2012 at 01:16:19PM +0200, Vitalii Demianets wrote: > On Friday 30 November 2012 01:58:22 Hans J. Koch wrote: > > On Thu, Nov 29, 2012 at 06:36:59PM +0200, Vitalii Demianets wrote: > > > > On Thursday 29 November 2012 18:05:27 Tux9 wrote: > > > > > Hans, I think there are something w

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-30 Thread Hans J. Koch
On Fri, Nov 30, 2012 at 12:12:46PM +0100, Tux9 wrote: > I like Vitalii's solution more. Hans's solution assign the value > -ENOMEM to ret in every round of the loop, which is a kind of wasting > CPU cycles. The difference between 1 files changed, 12 insertions(+), 4 deletions(-) and 1 files change

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-30 Thread Vitalii Demianets
On Friday 30 November 2012 01:58:22 Hans J. Koch wrote: > On Thu, Nov 29, 2012 at 06:36:59PM +0200, Vitalii Demianets wrote: > > > On Thursday 29 November 2012 18:05:27 Tux9 wrote: > > > > Hans, I think there are something wrong in your patch, while > > > > Vitalii's is right. The variable "ret" is

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-30 Thread Tux9
I like Vitalii's solution more. Hans's solution assign the value -ENOMEM to ret in every round of the loop, which is a kind of wasting CPU cycles. On Fri, Nov 30, 2012 at 12:58 AM, Hans J. Koch wrote: > On Thu, Nov 29, 2012 at 06:36:59PM +0200, Vitalii Demianets wrote: >> > On Thursday 29 Novembe

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-29 Thread Hans J. Koch
On Thu, Nov 29, 2012 at 06:36:59PM +0200, Vitalii Demianets wrote: > > On Thursday 29 November 2012 18:05:27 Tux9 wrote: > > > Hans, I think there are something wrong in your patch, while Vitalii's > > > is right. The variable "ret" is reused in line 292 and line 295, so > > > the value of "ret" wo

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-29 Thread Vitalii Demianets
> On Thursday 29 November 2012 18:05:27 Tux9 wrote: > > Hans, I think there are something wrong in your patch, while Vitalii's > > is right. The variable "ret" is reused in line 292 and line 295, so > > the value of "ret" would be overridden (if it goto err_map in line 284 > > when mi>=1). > > Actu

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-29 Thread Cong Ding
No, there are some exceptions. Imagine this case, when mi=0, everything works correct in the loop, and then mi=1, if the kzalloc in line 286 fails, you patch will goto err_map with ret=-ENOMEM, while Hans's patch will goto err_map with ret=0 (the ret=0 is from line 295 when mi=0). On Thu, Nov 29,

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-29 Thread Vitalii Demianets
On Thursday 29 November 2012 18:05:27 Tux9 wrote: > Hans, I think there are something wrong in your patch, while Vitalii's > is right. The variable "ret" is reused in line 292 and line 295, so > the value of "ret" would be overridden (if it goto err_map in line 284 > when mi>=1). > Actually, both

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-29 Thread Tux9
Hans, I think there are something wrong in your patch, while Vitalii's is right. The variable "ret" is reused in line 292 and line 295, so the value of "ret" would be overridden (if it goto err_map in line 284 when mi>=1). Best, Cong On Wed, Nov 28, 2012 at 10:05 PM, Hans J. Koch wrote: > On Wed

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-28 Thread Hans J. Koch
On Wed, Nov 28, 2012 at 10:58:32AM +0200, Vitalii Demianets wrote: > On Wednesday 28 November 2012 00:43:41 Hans J. Koch wrote: > > > > Thanks, good catch, but why don't you simply do this: > > > > Just a matter of personal preference. Your patch: 1 files changed, 12 insertions(+), 4 deletions(

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-28 Thread Vitalii Demianets
On Wednesday 28 November 2012 00:43:41 Hans J. Koch wrote: > > Thanks, good catch, but why don't you simply do this: > Just a matter of personal preference. As a maintainer you can apply either patch you want. I guess you would prefer your approach and I have no objections to that :) > > >Fr

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-27 Thread Hans J. Koch
On Tue, Nov 27, 2012 at 01:48:14PM +0200, Vitalii Demianets wrote: > Fix warning: 'ret' might be used uninitialized > > Signed-off-by: Vitalii Demianets > --- > drivers/uio/uio.c | 16 > 1 files changed, 12 insertions(+), 4 deletions(-) > > diff --git a/drivers/uio/uio.c b/dr

Re: [PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-27 Thread Vitalii Demianets
By the way, I've found that warning while working on the older kernel with older gcc (ver. 3.4.4). The modern gcc (ver. 4.5.4) does not emit that warning no matter how hard I try. For example, it does not warn even with the following line in the drivers/uio/Makefile: ccflags-$(CONFIG_UIO) +=

[PATCH] uio.c: Fix warning: 'ret' might be used uninitialized

2012-11-27 Thread Vitalii Demianets
Fix warning: 'ret' might be used uninitialized Signed-off-by: Vitalii Demianets --- drivers/uio/uio.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index 5110f36..c33fd18 100644 --- a/drivers/uio/uio.c +++ b/drivers