mtd: inftl: remove unnecessary oom message
authorZhen Lei <thunder.leizhen@huawei.com>
Thu, 10 Jun 2021 02:28:50 +0000 (10:28 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 11 Jun 2021 18:44:21 +0000 (20:44 +0200)
Fixes scripts/checkpatch.pl warning:
WARNING: Possible unnecessary 'out of memory' message

Remove it can help us save a bit of memory.

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210610022850.15397-1-thunder.leizhen@huawei.com
drivers/mtd/inftlmount.c

index 39d0241186102641eb89769386d4e38da6ec515a..6276daa296dab625237a3f4d00e6978f6a12001d 100644 (file)
@@ -259,20 +259,13 @@ static int find_boot_record(struct INFTLrecord *inftl)
                /* Memory alloc */
                inftl->PUtable = kmalloc_array(inftl->nb_blocks, sizeof(u16),
                                               GFP_KERNEL);
-               if (!inftl->PUtable) {
-                       printk(KERN_WARNING "INFTL: allocation of PUtable "
-                               "failed (%zd bytes)\n",
-                               inftl->nb_blocks * sizeof(u16));
+               if (!inftl->PUtable)
                        return -ENOMEM;
-               }
 
                inftl->VUtable = kmalloc_array(inftl->nb_blocks, sizeof(u16),
                                               GFP_KERNEL);
                if (!inftl->VUtable) {
                        kfree(inftl->PUtable);
-                       printk(KERN_WARNING "INFTL: allocation of VUtable "
-                               "failed (%zd bytes)\n",
-                               inftl->nb_blocks * sizeof(u16));
                        return -ENOMEM;
                }
 
@@ -558,12 +551,8 @@ int INFTL_mount(struct INFTLrecord *s)
 
        /* Temporary buffer to store ANAC numbers. */
        ANACtable = kcalloc(s->nb_blocks, sizeof(u8), GFP_KERNEL);
-       if (!ANACtable) {
-               printk(KERN_WARNING "INFTL: allocation of ANACtable "
-                               "failed (%zd bytes)\n",
-                               s->nb_blocks * sizeof(u8));
+       if (!ANACtable)
                return -ENOMEM;
-       }
 
        /*
         * First pass is to explore each physical unit, and construct the