From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/5] cifs: remove unneeded variable initialization in cifs_reconnect_tcon
Date: Tue, 5 Apr 2011 10:17:29 -0700 [thread overview]
Message-ID: <20110405101729.27657db0@corrin.poochiereds.net> (raw)
In-Reply-To: <BANLkTin4Js462-nZcBcSYD6YO_1b9UEeRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Tue, 5 Apr 2011 12:06:59 -0500
Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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?
--
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
next prev parent reply other threads:[~2011-04-05 17:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-31 21:36 [PATCH 0/5] cifs: various cleanups pointed out by David Howells Jeff Layton
[not found] ` <1301607405-4379-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-03-31 21:36 ` [PATCH 1/5] cifs: turn BCC into a static inlined function Jeff Layton
2011-03-31 21:36 ` [PATCH 2/5] cifs: remove unneeded variable initialization in cifs_reconnect_tcon Jeff Layton
[not found] ` <1301607405-4379-3-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-04-05 17:06 ` Steve French
[not found] ` <BANLkTin4Js462-nZcBcSYD6YO_1b9UEeRA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-05 17:17 ` Jeff Layton [this message]
[not found] ` <20110405101729.27657db0-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-04-05 17:20 ` Steve French
[not found] ` <BANLkTi=pfFJKs3ZE1ogZrxpaJGf94RFxew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-05 17:28 ` Jeff Layton
2011-03-31 21:36 ` [PATCH 3/5] cifs: fix comment in validate_t2 Jeff Layton
2011-03-31 21:36 ` [PATCH 4/5] cifs: clean up length checks in check2ndT2 Jeff Layton
2011-03-31 21:36 ` [PATCH 5/5] cifs: clean up various nits in unicode routines Jeff Layton
[not found] ` <1301607405-4379-6-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-04-05 17:23 ` Steve French
[not found] ` <BANLkTino1a1Wr55BCynPGK176Zbm5DPcXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-04-05 17:32 ` Jeff Layton
2011-04-05 19:02 ` [PATCH] cifs: clean up various nits in unicode routines (try #2) Jeff Layton
[not found] ` <1302030157-5486-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-04-05 19:11 ` Steve French
[not found] ` <20110405103209.75fb7da5-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2011-04-05 17:58 ` [PATCH 5/5] cifs: clean up various nits in unicode routines David Howells
[not found] ` <7828.1302026339-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-04-05 18:00 ` Steve French
2011-04-05 18:01 ` David Howells
[not found] ` <7882.1302026478-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-04-05 18:37 ` Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110405101729.27657db0@corrin.poochiereds.net \
--to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=dhowells-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox