Skip to content

Commit

Permalink
z2ram: remove unnecessary oom message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zhen Lei authored and Jens Axboe committed Jun 9, 2021
1 parent c744b06 commit ec1e7e8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/block/z2ram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -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();

Expand Down

0 comments on commit ec1e7e8

Please sign in to comment.