[ipxe-devel] [PATCH] [infiniband] Fix uninitialized variables warning

Miller, Shao Shao.Miller at yrdsb.edu.on.ca
Tue Jun 1 17:57:46 UTC 2010


Uh oh, I'm not off to a good start.  That should have been "0" rather
than -ENOERR, down below.  Sorry. :)  - Shao

-----Original Message-----
From: Miller, Shao 
Sent: Tuesday, June 01, 2010 13:45
To: ipxe-devel at lists.ipxe.org
Subject: [PATCH] [infiniband] Fix uninitialized variables warning

Also at ipxe.org:/home/sha0/ipxe/ -- qib7322 branch.  - Shao



>From d4ea5ab47fc59ae44759f670dfad6162070fb660 Mon Sep 17 00:00:00 2001
From: Shao Miller <shao.miller at yrdsb.edu.on.ca>
Date: Tue, 1 Jun 2010 17:19:33 +0000
Subject: [PATCH] [infiniband] Fix uninitialized variables warning

Trivial patch for GCC 3.3.3 (Debian 20040429)

Signed-off-by: Shao Miller <shao.miller at yrdsb.edu.on.ca>
---
 src/drivers/infiniband/qib7322.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/drivers/infiniband/qib7322.c
b/src/drivers/infiniband/qib7322.c
index 9e8185d..14fe5ee 100644
--- a/src/drivers/infiniband/qib7322.c
+++ b/src/drivers/infiniband/qib7322.c
@@ -641,7 +641,7 @@ static int qib7322_init_send ( struct qib7322
*qib7322 ) {
 	unsigned long baseaddr_largepio;
 	unsigned long baseaddr_vl15_port0;
 	unsigned long baseaddr_vl15_port1;
-	int rc;
+	int rc = -ENOERR;
 
 	/* Create send buffer sets */
 	qib7322_readq ( qib7322, &sendbufbase,
QIB_7322_SendBufBase_offset );
@@ -701,7 +701,7 @@ static int qib7322_init_send ( struct qib7322
*qib7322 ) {
 	BIT_FILL_1 ( &sendctrl, SendBufAvailUpd, 1 );
 	qib7322_writeq ( qib7322, &sendctrl, QIB_7322_SendCtrl_offset );
 
-	return 0;
+	return rc;
 
 	free_dma ( qib7322->sendbufavail, sizeof (
*qib7322->sendbufavail ) );
  err_alloc_sendbufavail:
@@ -1665,7 +1665,7 @@ static unsigned int qib7322_link_speed_supported (
struct qib7322 *qib7322,
 						  unsigned int port ) {
 	struct QIB_7322_feature_mask features;
 	struct QIB_7322_Revision revision;
-	unsigned int supported;
+	unsigned int supported = 0;
 	unsigned int boardid;
 
 	/* Read the active feature mask */
-- 
1.5.3.4




More information about the ipxe-devel mailing list