[openib-general] [PATCH 24 of 28] IB/mthca - Fix compiler warnings with gcc4 on possible unitialized variables

Bryan O'Sullivan bos at pathscale.com
Thu Sep 28 09:00:20 PDT 2006


It's possible (from the compiler perspective) that f0 is unitialized
in two functions (shows up with gcc4.0.2 on fc4, for example).  Initialize
to zero to fix warning.

Signed-off-by: Bryan O'Sullivan <bryan.osullivan at qlogic.com>

diff -r 6a9a67c2b35a -r 9fa624c592af drivers/infiniband/hw/mthca/mthca_qp.c
--- a/drivers/infiniband/hw/mthca/mthca_qp.c	Thu Sep 28 08:57:13 2006 -0700
+++ b/drivers/infiniband/hw/mthca/mthca_qp.c	Thu Sep 28 08:57:13 2006 -0700
@@ -1527,7 +1527,7 @@ int mthca_tavor_post_send(struct ib_qp *
 	int i;
 	int size;
 	int size0 = 0;
-	u32 f0;
+	u32 f0 = 0;
 	int ind;
 	u8 op0 = 0;
 
@@ -1870,7 +1870,7 @@ int mthca_arbel_post_send(struct ib_qp *
 	int i;
 	int size;
 	int size0 = 0;
-	u32 f0;
+	u32 f0 = 0;
 	int ind;
 	u8 op0 = 0;
 




More information about the general mailing list