lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <C754133A-93C3-4E41-92B2-F8CCA2B668FA@intel.com>
Date:   Thu, 3 Nov 2016 22:12:26 +0000
From:   "Dilger, Andreas" <andreas.dilger@...el.com>
To:     Andrew Kanner <andrew.kanner@...il.com>
CC:     "Drokin, Oleg" <oleg.drokin@...el.com>,
        James Simmons <jsimmons@...radead.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        "bevans@...y.com" <bevans@...y.com>,
        "bhaktipriya96@...il.com" <bhaktipriya96@...il.com>,
        "lustre-devel@...ts.lustre.org" <lustre-devel@...ts.lustre.org>,
        "devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: lustre: fixed shadowed variable in socklnd_cb.c

On Nov 3, 2016, at 15:54, Andrew Kanner <andrew.kanner@...il.com> wrote:
> 
> Changed variable 'tx' name in local scope
> Fixed: sparse warning:
> socklnd_cb.c:2476:41: warning: symbol 'tx' shadows an earlier one
> socklnd_cb.c:2435:25: originally declared here

Looking at this more closely (or from a greater distance, hard to say),
the outer-scope "tx" is used only after this inner-scope "tx", so in
fact there is no benefit to having the inner-scope declaration at all.

Removing it may save a stack variable (depending on how the compiler
optimizes), and shouldn't affect functionality.

Cheers, Andreas

> Signed-off-by: Andrew Kanner <andrew.kanner@...il.com>
> ---
> drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
> index c1c6f60..03fe4e5 100644
> --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
> +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
> @@ -2473,11 +2473,11 @@ ksocknal_check_peer_timeouts(int idx)
> 		 * holding only shared lock
> 		 */
> 		if (!list_empty(&peer->ksnp_tx_queue)) {
> -			struct ksock_tx *tx = list_entry(peer->ksnp_tx_queue.next,
> +			struct ksock_tx *_tx = list_entry(peer->ksnp_tx_queue.next,
> 						    struct ksock_tx, tx_list);
> 
> 			if (cfs_time_aftereq(cfs_time_current(),
> -					     tx->tx_deadline)) {
> +					     _tx->tx_deadline)) {
> 				ksocknal_peer_addref(peer);
> 				read_unlock(&ksocknal_data.ksnd_global_lock);
> 
> -- 
> 2.1.4
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ