if (pgcnt > phba->sli4_hba.pc_sli4_params.wqpcnt)
pgcnt = phba->sli4_hba.pc_sli4_params.wqpcnt;
- queue = kzalloc_node(sizeof(*queue) + (sizeof(void *) * pgcnt),
+ queue = kzalloc_node(struct_size(queue, q_pgs, pgcnt),
GFP_KERNEL, cpu_to_node(cpu));
if (!queue)
return NULL;
* resources, the free routine needs to know what was allocated.
*/
queue->page_count = pgcnt;
- queue->q_pgs = (void **)&queue[1];
queue->entry_cnt_per_pg = hw_page_size / entry_size;
queue->entry_size = entry_size;
queue->entry_count = entry_count;
uint64_t isr_timestamp;
struct lpfc_queue *assoc_qp;
struct list_head _poll_list;
- void **q_pgs; /* array to index entries per page */
enum lpfc_poll_mode poll_mode;
+
+ void *q_pgs[]; /* array to index entries per page */
};
struct lpfc_sli4_link {