Skip to contentSkip to conversation

mtd: esb2rom: remove unnecessary oom message

PATCH Applied Zhen Lei 2 participants 2 messages Jun 10, 2021 – Jun 11, 2021 Memory technology devices (MTD)

lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

PATCH 1/1 mtd: esb2rom: remove unnecessary oom message

Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message

Remove it can help us save a bit of memory.

---
 drivers/mtd/maps/esb2rom.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/mtd/maps/esb2rom.c +3 -4
index 85e14150a073068..15d5b76ff50450e 100644
@@ -277,11 +277,10 @@ static int __init esb2rom_init_one(struct pci_dev *pdev,
 		unsigned long offset;
 		int i;
 
-		if (!map)
-			map = kmalloc(sizeof(*map), GFP_KERNEL);
 		if (!map) {
-			printk(KERN_ERR MOD_NAME ": kmalloc failed");
-			goto out;
+			map = kmalloc(sizeof(*map), GFP_KERNEL);
+			if (!map)
+				goto out;
 		}
 		memset(map, 0, sizeof(*map));
 		INIT_LIST_HEAD(&map->list);
Signature · 7 lines
2.26.0.106.g9fadedd



______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer Applied
#1 lore raw
Quoted 6 lines · Zhen Lei

Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message

Remove it can help us save a bit of memory.

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/