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: 9239467 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 345726077C for ; Wed, 20 Jul 2016 11:36:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24C672026B for ; Wed, 20 Jul 2016 11:36:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 196DE27BE5; Wed, 20 Jul 2016 11:36:53 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 948B92026B for ; Wed, 20 Jul 2016 11:36:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPplt-0002Pj-Cd; Wed, 20 Jul 2016 11:34:37 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPpls-0002Pb-GE for xen-devel@lists.xenproject.org; Wed, 20 Jul 2016 11:34:36 +0000 Received: from [193.109.254.147] by server-16.bemta-14.messagelabs.com id A8/48-20378-BC16F875; Wed, 20 Jul 2016 11:34:35 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFIsWRWlGSWpSXmKPExsVy5TE/n+6pxP5 wgxcTLC2+b5nM5MDocfjDFZYAxijWzLyk/IoE1oyr33awFFzmqfh4VLCB8QlXFyMXh5DAfEaJ 1W/2s3QxcnIIC4RKXNz9jREkISJwmlFi94fHzBBVP9klfu7tYAapYhbIk5h74Bk7iM0mYC7Ru /YzUDc7B6+Ah8TJfJAoi4CqxPc9t8BmigLNXPHmBBuIzSsgKHFy5hOwOKeAp8T7SeehJupJ7L j+ixXClpdo3jobLC4h8JlRYu02B5ATJAT62CV+7//GPIGRfxaSWbOQ9M9C0r+AkXkVo0ZxalF ZapGukZFeUlFmekZJbmJmjq6hoYlebmpxcWJ6ak5iUrFecn7uJkZgGNYzMDDuYLx9ye8QoyQH k5Ior6pob7gQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCV5+YFgLCRalpqdWpGXmACMCJi3BwaMkw psKkuYtLkjMLc5Mh0idYlSUEucVBkkIgCQySvPg2mBReIlRVkqYl5GBgUGIpyC1KDezBFX+Fa M4B6OSMO/HBKApPJl5JXDTXwEtZgJaPEcAbHFJIkJKqoFxYk7tE8WPejZCf59L9h5W4bhYp/Y 0MXbGqvqu6P5AlymNDXZ3lhstFXu5YmLw1T2K/1P8Wpmy93o0cdob7A0KvcDK335dIrdRjdvh 6B7HHVt+9P/82sfy6l3Qg5sd/JarLLYKBiin6CyWf7bUmpUt/YXM8aSXL1+xTlRT6p51VZZPx OPf3GIlluKMREMt5qLiRAAgN1rqvQIAAA== X-Env-Sender: elfring@users.sourceforge.net X-Msg-Ref: server-10.tower-27.messagelabs.com!1469014474!54977100!1 X-Originating-IP: [212.227.15.14] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 7434 invoked from network); 20 Jul 2016 11:34:34 -0000 Received: from mout.web.de (HELO mout.web.de) (212.227.15.14) by server-10.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Jul 2016 11:34:34 -0000 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 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> 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 Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML Subject: [Xen-devel] [PATCH v2 2/3] xen-scsiback: Rename jump labels in scsiback_device_action() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" 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); }