Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751692AbbLNAfU (ORCPT ); Sun, 13 Dec 2015 19:35:20 -0500 Received: from mail-pf0-f178.google.com ([209.85.192.178]:36058 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342AbbLNAfS (ORCPT ); Sun, 13 Dec 2015 19:35:18 -0500 Date: Mon, 14 Dec 2015 09:36:21 +0900 From: Sergey Senozhatsky To: SF Markus Elfring Cc: LKML , Minchan Kim , Nitin Gupta , Sergey Senozhatsky , kernel-janitors@vger.kernel.org, Julia Lawall , Andrew Morton , Jens Axboe , Geert Uytterhoeven Subject: Re: [PATCH 2/2] z2ram: Delete a jump label in z2_init() Message-ID: <20151214003621.GB718@swordfish> References: <566ABCD9.1060404@users.sourceforge.net> <566B13C1.50907@users.sourceforge.net> <566B1542.7040902@users.sourceforge.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <566B1542.7040902@users.sourceforge.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1391 Lines: 50 Cc Jens, Andrew, Geert On (12/11/15 19:26), SF Markus Elfring wrote: > > This issue was detected by using the Coccinelle software. > > * Let us return directly if a call of the function "register_blkdev" failed. > > * Remove the jump label "err" then. > > Signed-off-by: Markus Elfring > --- > drivers/block/z2ram.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c > index 968f9e5..b07581d 100644 > --- a/drivers/block/z2ram.c > +++ b/drivers/block/z2ram.c > @@ -345,9 +345,8 @@ z2_init(void) > if (!MACH_IS_AMIGA) > return -ENODEV; > > - ret = -EBUSY; > if (register_blkdev(Z2RAM_MAJOR, DEVICE_NAME)) > - goto err; > + return -EBUSY; > > ret = -ENOMEM; > z2ram_gendisk = alloc_disk(1); > @@ -374,7 +373,6 @@ out_queue: > put_disk(z2ram_gendisk); > out_disk: > unregister_blkdev(Z2RAM_MAJOR, DEVICE_NAME); > -err: > return ret; > } z2ram and zram are different drivers, but the change looks ok to me. z2ram can be improved in many ways, so my question is - do people still use it? -ss -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/