You need to sign in or sign up before continuing.
提交 cc323b2a 编写于 作者: R Ralph Campbell 提交者: Roland Dreier

IB/qib: Avoid variable-length array

Rather than use a variable size array allocation on the stack,
define a constant for the maximum array size possible.
Signed-off-by: NRalph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: NRoland Dreier <rolandd@cisco.com>
上级 589643be
...@@ -326,6 +326,9 @@ struct qib_verbs_txreq { ...@@ -326,6 +326,9 @@ struct qib_verbs_txreq {
#define QIB_DEFAULT_MTU 4096 #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() * Possible IB config parameters for f_get/set_ib_table()
*/ */
......
...@@ -170,7 +170,7 @@ static int find_ctxt(struct qib_devdata *dd, unsigned bufn) ...@@ -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, void qib_disarm_piobufs_set(struct qib_devdata *dd, unsigned long *mask,
unsigned cnt) unsigned cnt)
{ {
struct qib_pportdata *ppd, *pppd[dd->num_pports]; struct qib_pportdata *ppd, *pppd[QIB_MAX_IB_PORTS];
unsigned i; unsigned i;
unsigned long flags; unsigned long flags;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册