aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorPaul Bolle <pebolle@tiscali.nl>2013-07-24 18:06:07 -0400
committerRoland Dreier <roland@purestorage.com>2013-07-30 19:11:22 -0400
commit8fb488d740582314534c278b5d1e3a1888b850b9 (patch)
tree5738d63f359794d2accab7a9ae8255e4e9b1a77b /drivers/infiniband
parent3b2f64d00c46e1e4e9bd0bb9bb12619adac27a4b (diff)
RDMA/cma: Fix gcc warning
Building cma.o triggers this gcc warning: drivers/infiniband/core/cma.c: In function ‘rdma_resolve_addr’: drivers/infiniband/core/cma.c:465:23: warning: ‘port’ may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/infiniband/core/cma.c:426:5: note: ‘port’ was declared here This is a false positive, as "port" will always be initialized if we're at "found". But if we assign to "id_priv->id.port_num" directly, we can drop "port". That will, obviously, silence gcc. Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Sean Hefty <sean.hefty@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/cma.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index f1c279fabe64..84487a2e651a 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -423,7 +423,7 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)
423 struct sockaddr_ib *addr; 423 struct sockaddr_ib *addr;
424 union ib_gid gid, sgid, *dgid; 424 union ib_gid gid, sgid, *dgid;
425 u16 pkey, index; 425 u16 pkey, index;
426 u8 port, p; 426 u8 p;
427 int i; 427 int i;
428 428
429 cma_dev = NULL; 429 cma_dev = NULL;
@@ -443,7 +443,7 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)
443 if (!memcmp(&gid, dgid, sizeof(gid))) { 443 if (!memcmp(&gid, dgid, sizeof(gid))) {
444 cma_dev = cur_dev; 444 cma_dev = cur_dev;
445 sgid = gid; 445 sgid = gid;
446 port = p; 446 id_priv->id.port_num = p;
447 goto found; 447 goto found;
448 } 448 }
449 449
@@ -451,7 +451,7 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)
451 dgid->global.subnet_prefix)) { 451 dgid->global.subnet_prefix)) {
452 cma_dev = cur_dev; 452 cma_dev = cur_dev;
453 sgid = gid; 453 sgid = gid;
454 port = p; 454 id_priv->id.port_num = p;
455 } 455 }
456 } 456 }
457 } 457 }
@@ -462,7 +462,6 @@ static int cma_resolve_ib_dev(struct rdma_id_private *id_priv)
462 462
463found: 463found:
464 cma_attach_to_dev(id_priv, cma_dev); 464 cma_attach_to_dev(id_priv, cma_dev);
465 id_priv->id.port_num = port;
466 addr = (struct sockaddr_ib *) cma_src_addr(id_priv); 465 addr = (struct sockaddr_ib *) cma_src_addr(id_priv);
467 memcpy(&addr->sib_addr, &sgid, sizeof sgid); 466 memcpy(&addr->sib_addr, &sgid, sizeof sgid);
468 cma_translate_ib(addr, &id_priv->id.route.addr.dev_addr); 467 cma_translate_ib(addr, &id_priv->id.route.addr.dev_addr);