Skip to contentSkip to conversation

staging: lustre: fixed shadowed variable in socklnd_cb.c

PATCH In review Andrew Kanner 3 participants 3 messages Nov 3, 2016 – Nov 7, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 staging: lustre: fixed shadowed variable in socklnd_cb.c

Removed redundant declaration of variable 'tx' 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

---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +2 -2
index c1c6f60..f31f4a1 100644
@@ -2473,8 +2473,8 @@ 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);
+			tx = list_entry(peer->ksnp_tx_queue.next,
+					struct ksock_tx, tx_list);
 
 			if (cfs_time_aftereq(cfs_time_current(),
 					     tx->tx_deadline)) {
Signature · 1 line
2.1.4
Reviewed-by on v2 1/1
#1 lore raw
Quoted 7 lines · Andrew Kanner

Removed redundant declaration of variable 'tx' 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

Quoted 22 lines

---
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +2 -2
index c1c6f60..f31f4a1 100644
@@ -2473,8 +2473,8 @@ 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);
+			tx = list_entry(peer->ksnp_tx_queue.next,
+					struct ksock_tx, tx_list);
 
 			if (cfs_time_aftereq(cfs_time_current(),
 					     tx->tx_deadline)) {
Signature · 1 line
2.1.4
Reviewed-by on v2 1/1
#2 lore raw
In reply to Andrew Kanner
Quoted 5 lines

Removed redundant declaration of variable 'tx' 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

Quoted 24 lines
---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c +2 -2
index c1c6f60..f31f4a1 100644
@@ -2473,8 +2473,8 @@ 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);
+			tx = list_entry(peer->ksnp_tx_queue.next,
+					struct ksock_tx, tx_list);
 
 			if (cfs_time_aftereq(cfs_time_current(),
 					     tx->tx_deadline)) {
Signature · 1 line
2.1.4