Skip to content

Commit

Permalink
IB/qib: Avoid variable-length array
Browse files Browse the repository at this point in the history
Rather than use a variable size array allocation on the stack,
define a constant for the maximum array size possible.

Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
  • Loading branch information
Ralph Campbell authored and Roland Dreier committed Jul 19, 2010
1 parent 589643b commit cc323b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/infiniband/hw/qib/qib.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
*/
Expand Down
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/qib/qib_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit cc323b2

Please sign in to comment.