netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net, mellanox mlx4 Fix compile warnings
@ 2013-09-13 12:30 Prarit Bhargava
  2013-09-14 19:10 ` Or Gerlitz
  2013-09-17  1:25 ` David Miller
  0 siblings, 2 replies; 12+ messages in thread
From: Prarit Bhargava @ 2013-09-13 12:30 UTC (permalink / raw)
  To: netdev; +Cc: Prarit Bhargava, dledford, Amir Vadai, Or Gerlitz

Fix unitialized variable warnings.

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function ‘mlx4_HW2SW_CQ_wrapper’:
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:2551:16: error: ‘cq’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  atomic_dec(&cq->mtt->ref_count);
                ^
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c: In function ‘mlx4_HW2SW_SRQ_wrapper’:
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c:2734:17: error: ‘srq’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  atomic_dec(&srq->mtt->ref_count);

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Cc: dledford@redhat.com
Cc: Amir Vadai <amirv@mellanox.com>
Cc: Or Gerlitz <ogerlitz@mellanox.com>
---
 .../net/ethernet/mellanox/mlx4/resource_tracker.c  |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index dd68763..d703838 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -2563,7 +2563,7 @@ int mlx4_HW2SW_CQ_wrapper(struct mlx4_dev *dev, int slave,
 {
 	int err;
 	int cqn = vhcr->in_modifier;
-	struct res_cq *cq;
+	struct res_cq *uninitialized_var(cq);
 
 	err = cq_res_start_move_to(dev, slave, cqn, RES_CQ_ALLOCATED, &cq);
 	if (err)
@@ -2746,7 +2746,7 @@ int mlx4_HW2SW_SRQ_wrapper(struct mlx4_dev *dev, int slave,
 {
 	int err;
 	int srqn = vhcr->in_modifier;
-	struct res_srq *srq;
+	struct res_srq *uninitialized_var(srq);
 
 	err = srq_res_start_move_to(dev, slave, srqn, RES_SRQ_ALLOCATED, &srq);
 	if (err)
-- 
1.7.9.3

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-09-17 19:28 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-13 12:30 [PATCH] net, mellanox mlx4 Fix compile warnings Prarit Bhargava
2013-09-14 19:10 ` Or Gerlitz
2013-09-15  6:14   ` Jack Morgenstein
2013-09-15  6:22     ` ZHAO Gang
2013-09-15  6:27       ` ZHAO Gang
2013-09-16  8:59     ` David Laight
2013-09-16 12:14       ` Prarit Bhargava
2013-09-16 13:52       ` Jack Morgenstein
2013-09-17  1:25 ` David Miller
2013-09-17 19:13   ` [PATCH 2/2] " Prarit Bhargava
2013-09-17 19:25     ` Or Gerlitz
2013-09-17 19:28       ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).