From patchwork Thu Aug 9 11:32:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Milan P. Gandhi" X-Patchwork-Id: 10561191 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9108D13AC for ; Thu, 9 Aug 2018 11:32:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 816912AD74 for ; Thu, 9 Aug 2018 11:32:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75AFD2AD80; Thu, 9 Aug 2018 11:32:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31DC52AD74 for ; Thu, 9 Aug 2018 11:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730933AbeHIN4o (ORCPT ); Thu, 9 Aug 2018 09:56:44 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:40469 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730573AbeHIN4n (ORCPT ); Thu, 9 Aug 2018 09:56:43 -0400 Received: by mail-qk0-f195.google.com with SMTP id c126-v6so3742958qkd.7 for ; Thu, 09 Aug 2018 04:32:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=YttjmriCdFeiwcywr4cKKYNUdT7tbN8fhsxs8wQfu/s=; b=qB6EQRlDLArCJxCOyyJ7m6Zqz5dtYEsFieqFOonj5afnWEgKLjLZHu/S5Gdb0qzIFD OVYadrELq5Kht3XKpC/Urc7pAg6MdAlQYD8fyutEHLeEqpuh/KcknBgDzMUwEQpA7rI3 XZV735TlW1wFtUL67WdKqBXSEb+eletyp0TIftEhvbV988qSokawz3NsqYhHHcP0/90Z lGCQAy7EwyJ/RHRuZvqLLCl3DXgdf2CSYh8ZIWVqG8MkdTB6OqbukEjP8RfvhktFfVWX P2CXRzn/TU5yNcGOPNmQar+rS/1dqo5xW5dY7Ct6ENaHg+IbIwn3i6McuxBjIm3qtNVp Hk+A== X-Gm-Message-State: AOUpUlFp+PKYDY7VFzoOPuZ1lyvkGY5Sbyx2W6STpJtWGjK+bcKSBca/ NhbTnm/9ZXM0nJl64I7f+SDCJVTgB7A= X-Google-Smtp-Source: AA+uWPwPAfTwWttK4T+SfQgamYg5QHMq/jY22sTBAkH88Ql0Nll198n4u9vyaD5MEtYOZSbFtUdgfQ== X-Received: by 2002:a37:7d85:: with SMTP id y127-v6mr1352244qkc.335.1533814336436; Thu, 09 Aug 2018 04:32:16 -0700 (PDT) Received: from machine1 ([182.70.104.216]) by smtp.gmail.com with ESMTPSA id a19-v6sm5188431qta.50.2018.08.09.04.32.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 09 Aug 2018 04:32:15 -0700 (PDT) Date: Thu, 9 Aug 2018 17:02:09 +0530 From: "Milan P. Gandhi" To: linux-scsi@vger.kernel.org Subject: [PATCH] Simplify nvmet_init to remove extra out label Message-ID: <20180809113209.GA10820@machine1> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The out label at end could easily be removed by returning an error upon receiving non-zero error return code from nvmet_init_discovery. This would avoid need for 2nd out label. Signed-off-by: Milan P. Gandhi --- drivers/nvme/target/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index b40fb6d724b4..e667a3fa0d9b 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -1109,7 +1109,7 @@ static int __init nvmet_init(void) error = nvmet_init_discovery(); if (error) - goto out; + return error; error = nvmet_init_configfs(); if (error) @@ -1118,7 +1118,6 @@ static int __init nvmet_init(void) out_exit_discovery: nvmet_exit_discovery(); -out: return error; }