wireless: 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.
Convert kmalloc's with multiplies to kmalloc_array.
Remove now unused variables.
Remove unnecessary memset after kzalloc->kcalloc.
Whitespace cleanups for these changes.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Joe Perches
2013-02-03 17:28:14 +00:00
committed by David S. Miller
parent 9d11bd1592
commit 0d2e7a5c60
22 changed files with 50 additions and 133 deletions

View File

@@ -229,10 +229,8 @@ static int wl1271_probe(struct sdio_func *func,
return -ENODEV;
glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(&func->dev, "can't allocate glue\n");
if (!glue)
goto out;
}
glue->dev = &func->dev;

View File

@@ -87,11 +87,8 @@ static void wl12xx_spi_reset(struct device *child)
struct spi_message m;
cmd = kzalloc(WSPI_INIT_CMD_LEN, GFP_KERNEL);
if (!cmd) {
dev_err(child->parent,
"could not allocate cmd for spi reset\n");
if (!cmd)
return;
}
memset(&t, 0, sizeof(t));
spi_message_init(&m);
@@ -115,11 +112,8 @@ static void wl12xx_spi_init(struct device *child)
struct spi_message m;
cmd = kzalloc(WSPI_INIT_CMD_LEN, GFP_KERNEL);
if (!cmd) {
dev_err(child->parent,
"could not allocate cmd for spi init\n");
if (!cmd)
return;
}
memset(crc, 0, sizeof(crc));
memset(&t, 0, sizeof(t));
@@ -340,10 +334,8 @@ static int wl1271_probe(struct spi_device *spi)
pdata->ops = &spi_ops;
glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(&spi->dev, "can't allocate glue\n");
if (!glue)
goto out;
}
glue->dev = &spi->dev;