Skip to contentSkip to conversation

mtd: amd76xrom: 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: amd76xrom: 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/amd76xrom.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/mtd/maps/amd76xrom.c +2 -4
index 42a95ba40f2cb74..281fcbaa74e70c1 100644
@@ -189,10 +189,8 @@ static int amd76xrom_init_one(struct pci_dev *pdev,
 
 		if (!map) {
 			map = kmalloc(sizeof(*map), GFP_KERNEL);
-		}
-		if (!map) {
-			printk(KERN_ERR MOD_NAME ": kmalloc failed");
-			goto out;
+			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/