From patchwork Sat Nov 4 13:16:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10041575 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 A3A3960384 for ; Sat, 4 Nov 2017 13:16:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93BC7294FB for ; Sat, 4 Nov 2017 13:16:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 87DC4295F4; Sat, 4 Nov 2017 13:16:54 +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=unavailable 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 3E6F5294FB for ; Sat, 4 Nov 2017 13:16:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752247AbdKDNQk (ORCPT ); Sat, 4 Nov 2017 09:16:40 -0400 Received: from mout.web.de ([217.72.192.78]:51682 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751643AbdKDNQj (ORCPT ); Sat, 4 Nov 2017 09:16:39 -0400 Received: from [192.168.1.3] ([92.226.117.170]) by smtp.web.de (mrweb102 [213.165.67.124]) with ESMTPSA (Nemesis) id 0LZeZU-1dPUPB086O-00lYvq; Sat, 04 Nov 2017 14:16:37 +0100 Subject: [PATCH 2/4] target: Combine two condition checks into one statement in target_xcopy_do_work() From: SF Markus Elfring To: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, "Nicholas A. Bellinger" Cc: LKML , kernel-janitors@vger.kernel.org References: <27e27d42-473d-e8db-fe9e-803fed646881@users.sourceforge.net> Message-ID: <09a6b5ba-70b7-ba4d-ad4f-6450c9da6208@users.sourceforge.net> Date: Sat, 4 Nov 2017 14:16:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <27e27d42-473d-e8db-fe9e-803fed646881@users.sourceforge.net> Content-Language: en-GB X-Provags-ID: V03:K0:Fa2GUun0YzdfTTjc4QCR/uxjxnBMdGHaN+CeUZZguUuTpefPrFN UjbQGapr24JKuC3a/GR1sVRQ+m8TLUim99ejhtOaKsVhJ/ASiMc6dra1EGGRepsUhEc0lQa XG9WEBPUzxFJmqhIgZpyOfOXipkVGM5p0ZJHvE8sek63H0p2Bo+TaRny8ChLNN/j7ZCX4fb wsE38P7FI9t+TR2LUE0Tw== X-UI-Out-Filterresults: notjunk:1; V01:K0:AAebgVFkyzs=:B+bOnwKKoWYeyfK533P8wg Hz5sJ4pMSXs7iQmkjUgP8Ia0DG0JehE9oL+MYspsO/i3i/Yg72Zu5M+fZZm3FpPaOHXFpBNpJ NxHi95jTgTWSwBoxw7vyRfulvWynEOu0X/inzVh928UtwWXyFiqQMNpzkmiNhzIq5YS9GB+gh srcqeVjmS1zHDbwMKRxfO9CJvtFL6q1wZTWAt0Lwc3HjWOiIG8OuIxiZstFomezChLax293MX O9uPy8AzZJQo6+OTbjeYATm0cO9jG6NmeUIw/XbzV5QQtDwT4FXhFfPEjn25NSB79Eyipktnq wrTU9V1t6OLSZIWmFd4tE1AiOxr4InwvqsCodUjunBP9pRKpgkqG1cTeP1Wa2dM3UVZcMAxuO FuUwJ27VU6+oj5MP2Ng2UZXxdTyPI2I6oGQNaJDQZEywQhW7RWQqolF5WCQpt4dAiJezq7+UY JY4frn68OJEqdcV8tTDpVemtjG/CLBttEjVf+cjFTTNj5OYb8HJOzJNFcKb41ykkIRMzlvomz mFeCPCgRUiALk6+x+fqFq51bJdsewtkV5EAKtQHioDUaEYmQ9yVMCazHaX+WjPBisQJC6PJJT sq3TkKgWkUUyYK9RZCxPeRzWLXJeT1GWlFPBkvhRv0AFKCh+Nx7Msc7GK3gsuT0ou4KVHQi9H ePSrzAlUNs0tLzxtAJw367jQRBUNlN88HobRz04voOePFgXXjEQt1JmhDQM/+dI+tHe9F0siQ KSKj6g4ZIjtwJFqodcfsV/Wa7YFWWV+FM1/dqMHRtkCeRkk2AIeY6qLurwLu7G/qhoLf2Lhse Mu9c/BYxCUcZ8IpXQjNTdlCm4kxpW8CqrCOihmBKsT4cpeOWGM= 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: Sat, 4 Nov 2017 13:26:46 +0100 The same label was used by goto statements after two condition checks. Thus use a single statement instead. Signed-off-by: Markus Elfring --- drivers/target/target_core_xcopy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index b06877c57765..46cac36014df 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c @@ -802,10 +802,8 @@ static void target_xcopy_do_work(struct work_struct *work) int rc = 0; unsigned short nolb, cur_nolb, max_nolb, copied_nolb = 0; - if (target_parse_xcopy_cmd(xop) != TCM_NO_SENSE) - goto err_free_xop; - - if (WARN_ON_ONCE(!xop->src_dev) || WARN_ON_ONCE(!xop->dst_dev)) + if (target_parse_xcopy_cmd(xop) != TCM_NO_SENSE || + WARN_ON_ONCE(!xop->src_dev) || WARN_ON_ONCE(!xop->dst_dev)) goto err_free_xop; src_dev = xop->src_dev;