From patchwork Tue Apr 5 17:06:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 688331 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p35H733Y022886 for ; Tue, 5 Apr 2011 17:07:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753740Ab1DERHB (ORCPT ); Tue, 5 Apr 2011 13:07:01 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:45911 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751996Ab1DERHA convert rfc822-to-8bit (ORCPT ); Tue, 5 Apr 2011 13:07:00 -0400 Received: by eyx24 with SMTP id 24so185066eyx.19 for ; Tue, 05 Apr 2011 10:06:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=o4QroI5kxmVkySRs8pWI1oXG5cl+XerBwU3CAhOHZH0=; b=XNXqoBnmo0Ut34xXLLNTmpkF0dimqBhOHtSE5f8MCOi+bXZ1BpH+7PtPzDtZmu6khC oGnygZYl9vqKXVXyBSy0anskgatmnyLUMsb9UElxmxxlurOfgIH0JR62OrEf3c2b/WN3 h6M3KzLo8EnKNWsfveEQ5eF9PDZKZZmzcCYTw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=mTxgfVC70axhVEdl5JqItYamysJchENHrbX294nirMphQvJgx7rL7lJPNPAfCj3pYR VhrXqTOXIs/e3es7lTA+ULe78fE6X+4M4uOxtJzO8PEOBHF9pE9eiAbDIukEOaDp9w1S u/hFFEoJoTLVfhsoY9fIp0t/2oOnDMg9J17u4= MIME-Version: 1.0 Received: by 10.14.50.3 with SMTP id y3mr3966989eeb.225.1302023219650; Tue, 05 Apr 2011 10:06:59 -0700 (PDT) Received: by 10.14.126.69 with HTTP; Tue, 5 Apr 2011 10:06:59 -0700 (PDT) In-Reply-To: <1301607405-4379-3-git-send-email-jlayton@redhat.com> References: <1301607405-4379-1-git-send-email-jlayton@redhat.com> <1301607405-4379-3-git-send-email-jlayton@redhat.com> Date: Tue, 5 Apr 2011 12:06:59 -0500 Message-ID: Subject: Re: [PATCH 2/5] cifs: remove unneeded variable initialization in cifs_reconnect_tcon From: Steve French To: Jeff Layton Cc: dhowells@redhat.com, linux-cifs@vger.kernel.org Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 05 Apr 2011 17:07:03 +0000 (UTC) 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 On Thu, Mar 31, 2011 at 4:36 PM, Jeff Layton wrote: > Reported-and-acked-by: David Howells > Signed-off-by: Jeff Layton > --- >  fs/cifs/cifssmb.c |    2 +- >  1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c > index 1622978..4f5c6d0 100644 > --- a/fs/cifs/cifssmb.c > +++ b/fs/cifs/cifssmb.c > @@ -106,7 +106,7 @@ static void mark_open_files_invalid(struct cifs_tcon *pTcon) >  static int >  cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command) >  { > -       int rc = 0; > +       int rc; >        struct cifs_ses *ses; >        struct TCP_Server_Info *server; >        struct nls_table *nls_codepage; > -- > 1.7.4 > > 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;