Re: [PATCH 2/5] cifs: remove unneeded variable initialization in cifs_reconnect_tcon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 5, 2011 at 12:17 PM, Jeff Layton <jlayton@xxxxxxxxxx> wrote:
> On Tue, 5 Apr 2011 12:06:59 -0500
> Steve French <smfrench@xxxxxxxxx> wrote:
>
>> This is fine, but what about this alternative (initializing variables
>> can make code easier to read, and given dumb compiler warnings
>> sometimes better to leave in variable initialization ...):
>>
>> stevef@stevef-laptop:~/cifs-2.6$ git diff -a
>> diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
>> index 92e33d4..e4993a2 100644
>> --- a/fs/cifs/cifssmb.c
>> +++ b/fs/cifs/cifssmb.c
>> @@ -117,7 +117,7 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
>>          * calling routine
>>          */
>>         if (!tcon)
>> -               return 0;
>> +               return rc;
>>
>>         ses = tcon->ses;
>>         server = ses->server;
>>
>>
>
> So instead of eliminating a useless variable initialization, we instead
> manufacture a use for it? That seems sort of counter-productive, no?

since we do "return rc" later in the function, why wouldn't we do the
same earlier
in the function for consistency? With rc initialized it is a bit easier to read.



-- 
Thanks,

Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux