Commit 9d11bd15 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

wimax: Remove unnecessary alloc/OOM messages, alloc cleanups

alloc failures already get standardized OOM
messages and a dump_stack.

Convert kzalloc's with multiplies to kcalloc.
Remove now unused size variables.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1d5d1fdc
...@@ -1351,24 +1351,18 @@ int i2400m_rx_setup(struct i2400m *i2400m) ...@@ -1351,24 +1351,18 @@ int i2400m_rx_setup(struct i2400m *i2400m)
i2400m->rx_reorder = i2400m_rx_reorder_disabled? 0 : 1; i2400m->rx_reorder = i2400m_rx_reorder_disabled? 0 : 1;
if (i2400m->rx_reorder) { if (i2400m->rx_reorder) {
unsigned itr; unsigned itr;
size_t size;
struct i2400m_roq_log *rd; struct i2400m_roq_log *rd;
result = -ENOMEM; result = -ENOMEM;
size = sizeof(i2400m->rx_roq[0]) * (I2400M_RO_CIN + 1); i2400m->rx_roq = kcalloc(I2400M_RO_CIN + 1,
i2400m->rx_roq = kzalloc(size, GFP_KERNEL); sizeof(i2400m->rx_roq[0]), GFP_KERNEL);
if (i2400m->rx_roq == NULL) { if (i2400m->rx_roq == NULL)
dev_err(dev, "RX: cannot allocate %zu bytes for "
"reorder queues\n", size);
goto error_roq_alloc; goto error_roq_alloc;
}
size = sizeof(*i2400m->rx_roq[0].log) * (I2400M_RO_CIN + 1); rd = kcalloc(I2400M_RO_CIN + 1, sizeof(*i2400m->rx_roq[0].log),
rd = kzalloc(size, GFP_KERNEL); GFP_KERNEL);
if (rd == NULL) { if (rd == NULL) {
dev_err(dev, "RX: cannot allocate %zu bytes for "
"reorder queues log areas\n", size);
result = -ENOMEM; result = -ENOMEM;
goto error_roq_log_alloc; goto error_roq_log_alloc;
} }
......
...@@ -199,7 +199,6 @@ int i2400mu_notification_setup(struct i2400mu *i2400mu) ...@@ -199,7 +199,6 @@ int i2400mu_notification_setup(struct i2400mu *i2400mu)
d_fnstart(4, dev, "(i2400m %p)\n", i2400mu); d_fnstart(4, dev, "(i2400m %p)\n", i2400mu);
buf = kmalloc(I2400MU_MAX_NOTIFICATION_LEN, GFP_KERNEL | GFP_DMA); buf = kmalloc(I2400MU_MAX_NOTIFICATION_LEN, GFP_KERNEL | GFP_DMA);
if (buf == NULL) { if (buf == NULL) {
dev_err(dev, "notification: buffer allocation failed\n");
ret = -ENOMEM; ret = -ENOMEM;
goto error_buf_alloc; goto error_buf_alloc;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment