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>] [day] [month] [year] [list]
Date:	Wed, 10 Jun 2015 18:32:21 +0200
From:	Fabian Frederick <fabf@...net.be>
To:	linux-kernel@...r.kernel.org
Cc:	Julia Lawall <Julia.Lawall@...6.fr>,
	Fabian Frederick <fabf@...net.be>,
	Oleg Drokin <oleg.drokin@...el.com>,
	Andreas Dilger <andreas.dilger@...el.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	HPDD-discuss@...ts.01.org, devel@...verdev.osuosl.org
Subject: [PATCH 1/1 linux-next] staging: lustre: lnet: o2iblnd: use swap() in kiblnd_dev_failover()

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <fabf@...net.be>
---
 drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
index a57c5c3..6044337 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c
@@ -2463,7 +2463,6 @@ int kiblnd_dev_failover(kib_dev_t *dev)
 	LIST_HEAD(zombie_fpo);
 	struct rdma_cm_id *cmid  = NULL;
 	kib_hca_dev_t *hdev  = NULL;
-	kib_hca_dev_t *old;
 	struct ib_pd *pd;
 	kib_net_t *net;
 	struct sockaddr_in addr;
@@ -2555,9 +2554,7 @@ int kiblnd_dev_failover(kib_dev_t *dev)
 
 	write_lock_irqsave(&kiblnd_data.kib_global_lock, flags);
 
-	old = dev->ibd_hdev;
-	dev->ibd_hdev = hdev; /* take over the refcount */
-	hdev = old;
+	swap(dev->ibd_hdev, hdev); /* take over the refcount */
 
 	list_for_each_entry(net, &dev->ibd_nets, ibn_list) {
 		cfs_cpt_for_each(i, lnet_cpt_table()) {
-- 
2.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ