Skip to contentSkip to conversation

z2ram: Delete four error messages for a failed memory allocation in z2_open()

PATCH In review SF Markus Elfring 3 participants 4 messages Aug 7, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 z2ram: Delete four error messages for a failed memory allocation in z2_open()

From: Markus Elfring <[email protected]>
Date: Mon, 7 Aug 2017 17:56:53 +0200

Omit extra messages for a memory allocation failure in this function.

This issue was detected by using the Coccinelle software.

---
 drivers/block/z2ram.c | 24 ++++--------------------
 1 file changed, 4 insertions(+), 20 deletions(-)
drivers/block/z2ram.c +4 -20
index 41c95c9b2ab4..66af886cb0a0 100644
@@ -199,12 +199,8 @@ static int z2_open(struct block_device *bdev, fmode_t mode)
 		z2ram_map = 
 			kmalloc((size/Z2RAM_CHUNKSIZE)*sizeof(z2ram_map[0]),
 				GFP_KERNEL);
-		if ( z2ram_map = NULL )
-		{
-		    printk( KERN_ERR DEVICE_NAME
-			": cannot get mem for z2ram_map\n" );
+		if (!z2ram_map)
 		    goto err_out;
-		}
 
 		while (size) {
 			z2ram_map[ z2ram_size++ ] = vaddr;
@@ -224,12 +220,8 @@ static int z2_open(struct block_device *bdev, fmode_t mode)
 	    case Z2MINOR_COMBINED:
 
 		z2ram_map = kmalloc( max_z2_map + 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_z2ram();
 		get_chipram();
@@ -245,12 +237,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();
 
@@ -263,12 +251,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();
 
Signature · 1 line
2.13.4
maintainer
#1 lore raw
Quoted 4 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 7 Aug 2017 17:56:53 +0200

Omit extra messages for a memory allocation failure in this function.

Please stop sending these, thanks.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 7 lines · Jens Axboe
Quoted 4 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 7 Aug 2017 17:56:53 +0200

Omit extra messages for a memory allocation failure in this function.

Please stop sending these, thanks.

It would be pretty funny if Markus actually had a working Amiga / Zorro II board running the latest kernel and had actually tested this patch.

maintainer
#3 lore raw
Quoted 5 lines · Joe Perches
Quoted 4 lines · Jens Axboe
Quoted 3 lines · SF Markus Elfring

From: Markus Elfring <[email protected]>
Date: Mon, 7 Aug 2017 17:56:53 +0200

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Omit extra messages for a memory allocation failure in this function.

Please stop sending these, thanks.

It would be pretty funny if Markus actually had a working Amiga / Zorro II board running the latest kernel and had actually tested this patch.

Doesn't look like he even compiles then. Which means that the investment I have to make in reviewing them is that much greater, it's just not worth it.

Signature · 1 line
Jens Axboe