z2ram: remove unnecessary oom message
authorZhen Lei <thunder.leizhen@huawei.com>
Wed, 9 Jun 2021 12:27:39 +0000 (20:27 +0800)
committerJens Axboe <axboe@kernel.dk>
Wed, 9 Jun 2021 15:41:55 +0000 (09:41 -0600)
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: Jens Axboe <axboe@kernel.dk>
drivers/block/z2ram.c

index c1d2081..dce119f 100644 (file)
@@ -236,11 +236,8 @@ static int z2_open(struct block_device *bdev, fmode_t mode)
 
                        case Z2MINOR_Z2ONLY:
                                z2ram_map = kmalloc(max_z2_map, GFP_KERNEL);
-                               if (z2ram_map == NULL) {
-                                       printk(KERN_ERR DEVICE_NAME
-                                              ": cannot get mem for z2ram_map\n");
+                               if (!z2ram_map)
                                        goto err_out;
-                               }
 
                                get_z2ram();
 
@@ -253,11 +250,8 @@ static int z2_open(struct block_device *bdev, fmode_t mode)
 
                        case Z2MINOR_CHIPONLY:
                                z2ram_map = kmalloc(max_chip_map, GFP_KERNEL);
-                               if (z2ram_map == NULL) {
-                                       printk(KERN_ERR DEVICE_NAME
-                                              ": cannot get mem for z2ram_map\n");
+                               if (!z2ram_map)
                                        goto err_out;
-                               }
 
                                get_chipram();