From patchwork Wed Jul 20 11:34:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9239463 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4D91A6077C for ; Wed, 20 Jul 2016 11:35:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BF1726C2F for ; Wed, 20 Jul 2016 11:35:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EC3027BF4; Wed, 20 Jul 2016 11:35:28 +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=-6.9 required=2.0 tests=BAYES_00,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 AAC1026C2F for ; Wed, 20 Jul 2016 11:35:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752526AbcGTLf0 (ORCPT ); Wed, 20 Jul 2016 07:35:26 -0400 Received: from mout.web.de ([212.227.15.14]:55170 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752004AbcGTLfY (ORCPT ); Wed, 20 Jul 2016 07:35:24 -0400 Received: from [192.168.1.2] ([77.181.180.179]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0M6Df8-1b9ysm1EqI-00y7w2; Wed, 20 Jul 2016 13:34:30 +0200 Subject: [PATCH v2 2/3] xen-scsiback: Rename jump labels in scsiback_device_action() To: xen-devel@lists.xenproject.org, linux-scsi@vger.kernel.org, =?UTF-8?B?SsO8cmdlbiBHcm/Dnw==?= , David Vrabel , Boris Ostrovsky References: <5307CAA2.8060406@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <59e51c7d-f7bb-c55f-d2fe-06dccfef6a99@users.sourceforge.net> <87e55a72-71ad-d0a1-b936-12565bbc6508@users.sourceforge.net> <8806e9cb-4200-8154-7914-6735805dfbe0@users.sourceforge.net> <83b0b1e2-900b-eefc-160b-7d837730571c@suse.com> <18256bfc-c6f9-8802-8d7d-55766f0b3624@users.sourceforge.net> <85b948e0-bf37-dff0-6792-77b5dacef9a0@suse.com> <6863b12b-9095-aaf3-6140-80968e0071e2@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <639f00cc-5041-7ec0-b7f2-6ddb81129d15@users.sourceforge.net> Date: Wed, 20 Jul 2016 13:34:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <6863b12b-9095-aaf3-6140-80968e0071e2@users.sourceforge.net> X-Provags-ID: V03:K0:hqEuBlkXJWF/a+0lZmzXc8uXA8ldIb2+xabDOuPmROymQQPdaJB SOAeA8dA/0C3ZnXDHSxOxs/74sAq8iCjjRSEEICT0tkLXIrJSJk6fggY2M2QBzaG9n99dQQ Az2M8gkoukfDkX6uwKG1JgNcnSrOP458GYhWmeedYieTwG3qRF/NG2AYitXN5rprBzU6bvq H2jkLGWW+77AReb/FPgJA== X-UI-Out-Filterresults: notjunk:1; V01:K0:DdGxj3MjQCE=:S7gO+IVhhW+sw9+H5TXQJF KYRIBGxHwoypQB3YNkC5HSIzIoNfUyb6nF8/HvnnsSePY6NN5u20tw35dEv4mtyLzyuuwtHAg nJyevNXboBK7dRYZ10ZCY1r7yp5T/DfTG3Ag4GIvVYzLzgc6npPsVGx3Ldt6Ivi5AUmEk6/MP hhElf0SabfS+phdOozXDrnfbEF62daNJOfI7EFbtgQFhzG9T1EpNyngKhzTB2600kxwVr/3bE 91GSll8Z0DohKD7/I8I3hhE/YUkCqGPLKZH0u73hI7czzn3NutXUAS+tt8YyIUFgIeUpDmUQ7 0gY15OWSw2mq1L3YR8WEOUN8iUAxZBOz9AMo14emOJnLdKbHjl+60cTHDYdBWsGRGZ+4iuBJL B7IaCdMIcBPJG9uvGZikRMBChGW5eDF86UU+lqPVj7WMmiSc7KsUHbs1zP3aph3VvswCmDyZl kDy9t4D9niyJ1JTmHTu32AOeuA6Na0IovUWtbJo/C5mKzPkI6xcc97LsJw7tkDe2z4NNuBieL wQAzNBrfVYsTit8VUQT2gHSf+SIWwBz6RzNNPzhnGDhO+Yv1j9VXCamkyyq58w3pt5YO1T0Tc g0rjYiC3okZRYFqtZUG+9KM6kkhNVKbgZle7HWkcInCLXR4jO31Cp7zy6iG0x7V1l6S9TBnUX 29GsxhHBZXrBaEdXhUNjr/z46nDTzUir1opzaQ/CwgR3CgyKp+Rilvu9rUCTWMzSHBjf5FM+a cSqxuXeJfe6MKGy9ZyBTOv4lJkIqlYUIVuPNQ5OmZZYXY4KUTzs0aF4eQfRY6w6D43fJ1e7ww TEVFXI9 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 From: Markus Elfring Date: Wed, 20 Jul 2016 13:03:16 +0200 * Adjust jump targets according to the Linux coding style convention. * A bit of refactoring for the control flow Suggested-by: Jürgen Groß Signed-off-by: Markus Elfring Reviewed-by: Juergen Gross --- v2: Rebased on source files from "Linux next-20160719" Changes from a bit of code review drivers/xen/xen-scsiback.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c index 4a48c06..eb274df 100644 --- a/drivers/xen/xen-scsiback.c +++ b/drivers/xen/xen-scsiback.c @@ -604,10 +604,8 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req, int rc, err = FAILED; tmr = kzalloc(sizeof(struct scsiback_tmr), GFP_KERNEL); - if (!tmr) { - target_put_sess_cmd(se_cmd); - goto err; - } + if (!tmr) + goto put_cmd; init_waitqueue_head(&tmr->tmr_wait); @@ -616,7 +614,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req, unpacked_lun, tmr, act, GFP_KERNEL, tag, TARGET_SCF_ACK_KREF); if (rc) - goto err; + goto free_tmr; wait_event(tmr->tmr_wait, atomic_read(&tmr->tmr_complete)); @@ -626,7 +624,9 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req, scsiback_do_resp_with_sense(NULL, err, 0, pending_req); transport_generic_free_cmd(&pending_req->se_cmd, 1); return; -err: +put_cmd: + target_put_sess_cmd(se_cmd); +free_tmr: kfree(tmr); scsiback_do_resp_with_sense(NULL, err, 0, pending_req); }