Skip to content

Commit

Permalink
HSI: nokia-modem: Delete error messages for a failed memory allocatio…
Browse files Browse the repository at this point in the history
…n in two functions

The script "checkpatch.pl" pointed information out like the following.

WARNING: Possible unnecessary 'out of memory' message

Thus remove such statements here.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
  • Loading branch information
elfring authored and sre committed Jun 8, 2017
1 parent 1be0593 commit 4e3b9ba
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/hsi/clients/nokia-modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ static int nokia_modem_gpio_probe(struct device *dev)

modem->gpios = devm_kcalloc(dev, gpio_count, sizeof(*modem->gpios),
GFP_KERNEL);
if (!modem->gpios) {
dev_err(dev, "Could not allocate memory for gpios\n");
if (!modem->gpios)
return -ENOMEM;
}

modem->gpio_amount = gpio_count;

Expand Down Expand Up @@ -156,10 +154,9 @@ static int nokia_modem_probe(struct device *dev)
}

modem = devm_kzalloc(dev, sizeof(*modem), GFP_KERNEL);
if (!modem) {
dev_err(dev, "Could not allocate memory for nokia_modem_device\n");
if (!modem)
return -ENOMEM;
}

dev_set_drvdata(dev, modem);
modem->device = dev;

Expand Down

0 comments on commit 4e3b9ba

Please sign in to comment.