Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mmc: core: Delete error messages for failed memory allocations

Omit an extra message for memory allocation failures.

This issue was detected by using the Coccinelle software.

Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Markus Elfring and committed by
Ulf Hansson
e1df7ae3 9b344ba4

+3 -15
-2
drivers/mmc/core/mmc_test.c
··· 3220 3220 df = kmalloc(sizeof(*df), GFP_KERNEL); 3221 3221 if (!df) { 3222 3222 debugfs_remove(file); 3223 - dev_err(&card->dev, 3224 - "Can't allocate memory for internal usage.\n"); 3225 3223 return -ENOMEM; 3226 3224 } 3227 3225
+3 -13
drivers/mmc/core/sd.c
··· 294 294 err = -EIO; 295 295 296 296 status = kmalloc(64, GFP_KERNEL); 297 - if (!status) { 298 - pr_err("%s: could not allocate a buffer for " 299 - "switch capabilities.\n", 300 - mmc_hostname(card->host)); 297 + if (!status) 301 298 return -ENOMEM; 302 - } 303 299 304 300 /* 305 301 * Find out the card's support bits with a mode 0 operation. ··· 355 359 return 0; 356 360 357 361 status = kmalloc(64, GFP_KERNEL); 358 - if (!status) { 359 - pr_err("%s: could not allocate a buffer for " 360 - "switch capabilities.\n", mmc_hostname(card->host)); 362 + if (!status) 361 363 return -ENOMEM; 362 - } 363 364 364 365 err = mmc_sd_switch(card, 1, 0, 1, status); 365 366 if (err) ··· 589 596 return 0; 590 597 591 598 status = kmalloc(64, GFP_KERNEL); 592 - if (!status) { 593 - pr_err("%s: could not allocate a buffer for " 594 - "switch capabilities.\n", mmc_hostname(card->host)); 599 + if (!status) 595 600 return -ENOMEM; 596 - } 597 601 598 602 /* Set 4-bit bus width */ 599 603 if ((card->host->caps & MMC_CAP_4_BIT_DATA) &&