Skip to contentSkip to conversation

IB/qib: define max IB ports instead of variable stack allocation

PATCH Applied Ralph Campbell 2 participants 2 messages Jun 3, 2010 – Jul 19, 2010 1 message not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/qib: define max IB ports instead of variable stack allocation

Rather than use a variable size array allocation on the stack, define a constant for the maximum array size possible.

---

 drivers/infiniband/hw/qib/qib.h    |    3 +++
 drivers/infiniband/hw/qib/qib_tx.c |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)
drivers/infiniband/hw/qib/qib.h +3 -0
index 32d9208..211ff6a 100644
@@ -326,6 +326,9 @@ struct qib_verbs_txreq {
 
 #define QIB_DEFAULT_MTU 4096
 
+/* max number of IB ports supported per HCA */
+#define QIB_MAX_IB_PORTS 2
+
 /*
  * Possible IB config parameters for f_get/set_ib_table()
  */
drivers/infiniband/hw/qib/qib_tx.c +1 -1
index f7eb1dd..77909b5 100644
@@ -170,7 +170,7 @@ static int find_ctxt(struct qib_devdata *dd, unsigned bufn)
 void qib_disarm_piobufs_set(struct qib_devdata *dd, unsigned long *mask,
 			    unsigned cnt)
 {
-	struct qib_pportdata *ppd, *pppd[dd->num_pports];
+	struct qib_pportdata *ppd, *pppd[QIB_MAX_IB_PORTS];
 	unsigned i;
 	unsigned long flags;
 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20100603002107.8958.18499.stgit-/[email protected]

#2 lore raw

thanks, applied.

Signature · 6 lines
Roland Dreier <[email protected]> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html