Skip to content

Commit

Permalink
cxgb4: Fix frame size warning for 32 bit arch
Browse files Browse the repository at this point in the history
Fixes below warning by dynamically allocating memory

All warnings:

   drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c: In function
   'cctrl_tbl_show':
   >> drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c:689:1: warning: the
   >> frame
   >> size of 1028 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Hariprasad Shenai authored and David S. Miller committed Mar 25, 2015
1 parent 6fd9909 commit dde93df
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,13 @@ static int cctrl_tbl_show(struct seq_file *seq, void *v)
"0.9375" };

int i;
u16 incr[NMTUS][NCCTRL_WIN];
u16 (*incr)[NCCTRL_WIN];
struct adapter *adap = seq->private;

incr = kmalloc(sizeof(*incr) * NMTUS, GFP_KERNEL);
if (!incr)
return -ENOMEM;

t4_read_cong_tbl(adap, incr);

for (i = 0; i < NCCTRL_WIN; ++i) {
Expand All @@ -685,6 +689,8 @@ static int cctrl_tbl_show(struct seq_file *seq, void *v)
adap->params.a_wnd[i],
dec_fac[adap->params.b_wnd[i]]);
}

kfree(incr);
return 0;
}

Expand Down

0 comments on commit dde93df

Please sign in to comment.