* [PATCH] FC: cifs: Initialized an uninitialized variable
@ 2011-03-08 4:00 ` Vinay Sawal
0 siblings, 0 replies; 7+ messages in thread
From: Vinay Sawal @ 2011-03-08 4:00 UTC (permalink / raw)
To: sfrench-eUNUBHrolfbYtjvyW6yDsg
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA,
samba-technical-w/Ol4Ecudpl8XjKLYN78aQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, Vinay Sawal
Removed a compile time warning by initializing an uninitialized variable.
Signed-off-by: Vinay Sawal <vinaysawal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
fs/cifs/file.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index e964b1c..a9e5901 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1819,7 +1819,7 @@ static ssize_t
cifs_iovec_read(struct file *file, const struct iovec *iov,
unsigned long nr_segs, loff_t *poffset)
{
- int rc;
+ int rc = -EFAULT;
int xid;
ssize_t total_read;
unsigned int bytes_read = 0;
--
1.6.2.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] FC: cifs: Initialized an uninitialized variable
@ 2011-03-08 4:00 ` Vinay Sawal
0 siblings, 0 replies; 7+ messages in thread
From: Vinay Sawal @ 2011-03-08 4:00 UTC (permalink / raw)
To: sfrench; +Cc: linux-cifs, samba-technical, linux-kernel, Vinay Sawal
Removed a compile time warning by initializing an uninitialized variable.
Signed-off-by: Vinay Sawal <vinaysawal@gmail.com>
---
fs/cifs/file.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index e964b1c..a9e5901 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1819,7 +1819,7 @@ static ssize_t
cifs_iovec_read(struct file *file, const struct iovec *iov,
unsigned long nr_segs, loff_t *poffset)
{
- int rc;
+ int rc = -EFAULT;
int xid;
ssize_t total_read;
unsigned int bytes_read = 0;
--
1.6.2.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] FC: cifs: Initialized an uninitialized variable
2011-03-08 4:00 ` Vinay Sawal
@ 2011-03-08 4:26 ` Al Viro
-1 siblings, 0 replies; 7+ messages in thread
From: Al Viro @ 2011-03-08 4:26 UTC (permalink / raw)
To: Vinay Sawal
Cc: sfrench-eUNUBHrolfbYtjvyW6yDsg, linux-cifs-u79uwXL29TY76Z2rM5mHXA,
samba-technical-w/Ol4Ecudpl8XjKLYN78aQ,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
On Mon, Mar 07, 2011 at 08:00:09PM -0800, Vinay Sawal wrote:
> Removed a compile time warning by initializing an uninitialized variable.
> - int rc;
> + int rc = -EFAULT;
Why is that the right thing to do? Other than "it made the compiler to
STFU, therefore it is Good(tm)", please.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] FC: cifs: Initialized an uninitialized variable
@ 2011-03-08 4:26 ` Al Viro
0 siblings, 0 replies; 7+ messages in thread
From: Al Viro @ 2011-03-08 4:26 UTC (permalink / raw)
To: Vinay Sawal; +Cc: sfrench, linux-cifs, samba-technical, linux-kernel
On Mon, Mar 07, 2011 at 08:00:09PM -0800, Vinay Sawal wrote:
> Removed a compile time warning by initializing an uninitialized variable.
> - int rc;
> + int rc = -EFAULT;
Why is that the right thing to do? Other than "it made the compiler to
STFU, therefore it is Good(tm)", please.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] FC: cifs: Initialized an uninitialized variable
2011-03-08 4:26 ` Al Viro
@ 2011-03-08 4:38 ` Steve French
-1 siblings, 0 replies; 7+ messages in thread
From: Steve French @ 2011-03-08 4:38 UTC (permalink / raw)
To: Al Viro; +Cc: sfrench, linux-cifs, Vinay Sawal, samba-technical, linux-kernel
On Mon, Mar 7, 2011 at 10:26 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Mon, Mar 07, 2011 at 08:00:09PM -0800, Vinay Sawal wrote:
>> Removed a compile time warning by initializing an uninitialized variable.
>
>> - int rc;
>> + int rc = -EFAULT;
>
> Why is that the right thing to do? Other than "it made the compiler to
> STFU, therefore it is Good(tm)", please.
Hard to disagree with Al's logic, although changing the scope of rc to
within the for loop might also make both your compiler happy and more
sense. In any case, I prefer real bug fixes.
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] FC: cifs: Initialized an uninitialized variable
@ 2011-03-08 4:38 ` Steve French
0 siblings, 0 replies; 7+ messages in thread
From: Steve French @ 2011-03-08 4:38 UTC (permalink / raw)
To: Al Viro; +Cc: Vinay Sawal, sfrench, linux-cifs, samba-technical, linux-kernel
On Mon, Mar 7, 2011 at 10:26 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> On Mon, Mar 07, 2011 at 08:00:09PM -0800, Vinay Sawal wrote:
>> Removed a compile time warning by initializing an uninitialized variable.
>
>> - int rc;
>> + int rc = -EFAULT;
>
> Why is that the right thing to do? Other than "it made the compiler to
> STFU, therefore it is Good(tm)", please.
Hard to disagree with Al's logic, although changing the scope of rc to
within the for loop might also make both your compiler happy and more
sense. In any case, I prefer real bug fixes.
--
Thanks,
Steve
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] FC: cifs: Initialized an uninitialized variable
2011-03-08 4:38 ` Steve French
(?)
@ 2011-03-08 4:48 ` Vinay Sawal
-1 siblings, 0 replies; 7+ messages in thread
From: Vinay Sawal @ 2011-03-08 4:48 UTC (permalink / raw)
To: Steve French; +Cc: Al Viro, sfrench, linux-cifs, samba-technical, linux-kernel
On Mon, Mar 7, 2011 at 8:38 PM, Steve French <smfrench@gmail.com> wrote:
> On Mon, Mar 7, 2011 at 10:26 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
>> On Mon, Mar 07, 2011 at 08:00:09PM -0800, Vinay Sawal wrote:
>>> Removed a compile time warning by initializing an uninitialized variable.
>>
>>> - int rc;
>>> + int rc = -EFAULT;
>>
>> Why is that the right thing to do? Other than "it made the compiler to
>> STFU, therefore it is Good(tm)", please.
>
> Hard to disagree with Al's logic, although changing the scope of rc to
> within the for loop might also make both your compiler happy and more
> sense. In any case, I prefer real bug fixes.
Completely agree. Thanks for the clarification. Sorry for the inconvenience.
Thanks,
Vinay
>
>
> --
> Thanks,
>
> Steve
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2011-03-08 4:48 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-08 4:00 [PATCH] FC: cifs: Initialized an uninitialized variable Vinay Sawal
2011-03-08 4:00 ` Vinay Sawal
[not found] ` <1299556809-16194-1-git-send-email-vinaysawal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2011-03-08 4:26 ` Al Viro
2011-03-08 4:26 ` Al Viro
2011-03-08 4:38 ` Steve French
2011-03-08 4:38 ` Steve French
2011-03-08 4:48 ` Vinay Sawal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.