Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3160421pxk; Mon, 21 Sep 2020 06:48:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpwVJDFD1nTholPMLytO3XWGbYDFpm8i/6YfYVIMkXbjsYGPgiTJdImmTOP0ZLHTExt2R9 X-Received: by 2002:a17:906:1192:: with SMTP id n18mr52373030eja.515.1600696120038; Mon, 21 Sep 2020 06:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600696120; cv=none; d=google.com; s=arc-20160816; b=mP7QtJJ0ksOLEWR9jqCRuVvD8sORQKKj9qUpGkeYK25iYGKtmQPDKv3wNzlqwmw4Za ZOUN/Vy5v63uZb9vz7Ilc7JXJ2aG/dipqmk9F9yHkg48MaM1FmUjYRusp7qXpIwMVFpp j9nD0+bSwVcBRFEoXHnkSFRt3DYS7ytDmnJqhOMH8DiaVl1BTAk2QDkpSMRnXLCdYccd skX2yftYT3ogPukzGSmhsbSnIDYtyE1f4rU5ftZRmL6+3ffAZDN6HtXbCT5PbdFl2pig 4oDDZ2vNq0osqJztWqj/KXNfgn+m5Xjp7nB7IE7X6kcF7eEpBxFohyreVcOc+ZRPSulE 6+Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=/xqMAaoUhl3OdPbD62OM1VFifuP01NfQ5q/fN/1ijz8=; b=D/xnqGO/kjkp1l9wOFZGfuga7XJEn1OoTHp4RrhrLsveUN5TIuuVQ8P8593B9RVeWA teb6J2CJxsGsbawWC8e7OJOd9AoZ+0wEuC/kIooZ6c24uCwYK416NqW4VfZe2991HYUx JSyGH0AuDLQCWYYL42xgYtiZZzp+UaqZMXtDeJEWYZ5Unl13HBZCf4tZyJGciqq9kH24 EjO1q6ADCeFTJRx2yuLodWfFttj9QW/9fRUdIUFE8A28g+LaOXWUyxy0+E8W53DCywmY lpVkH0UBE1R9sGai6cGRKlTZh0XWfb86FIf9D2xrfWppUWA9hus+1fudS5oXdWQVVA1v Ea5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y17si8509049edt.218.2020.09.21.06.48.16; Mon, 21 Sep 2020 06:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727589AbgIUNqo (ORCPT + 99 others); Mon, 21 Sep 2020 09:46:44 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13813 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727560AbgIUNqm (ORCPT ); Mon, 21 Sep 2020 09:46:42 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 79D1372461913A9B08DF; Mon, 21 Sep 2020 21:46:38 +0800 (CST) Received: from [10.174.179.92] (10.174.179.92) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Mon, 21 Sep 2020 21:46:32 +0800 Subject: Re: [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions To: Liu Shixin , John Garry , "James E.J. Bottomley" , "Martin K. Petersen" CC: , References: <20200921134558.3478922-1-liushixin2@huawei.com> From: Jason Yan Message-ID: <95502ce3-27aa-0298-21c6-b5ea9d05b478@huawei.com> Date: Mon, 21 Sep 2020 21:46:31 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <20200921134558.3478922-1-liushixin2@huawei.com> Content-Type: text/plain; charset="gbk"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.92] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ?? 2020/9/21 21:45, Liu Shixin ะด??: > Simplify the return expression. > > Signed-off-by: Liu Shixin > --- > drivers/scsi/libsas/sas_ata.c | 8 +------- > drivers/scsi/libsas/sas_discover.c | 8 +------- > 2 files changed, 2 insertions(+), 14 deletions(-) > > diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c > index a4887985aad6..024e5a550759 100644 > --- a/drivers/scsi/libsas/sas_ata.c > +++ b/drivers/scsi/libsas/sas_ata.c > @@ -726,19 +726,13 @@ void sas_resume_sata(struct asd_sas_port *port) > */ > int sas_discover_sata(struct domain_device *dev) > { > - int res; > - > if (dev->dev_type == SAS_SATA_PM) > return -ENODEV; > > dev->sata_dev.class = sas_get_ata_command_set(dev); > sas_fill_in_rphy(dev, dev->rphy); > > - res = sas_notify_lldd_dev_found(dev); > - if (res) > - return res; > - > - return 0; > + return sas_notify_lldd_dev_found(dev); > } > > static void async_sas_ata_eh(void *data, async_cookie_t cookie) > diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c > index d0f9e90e3279..161c9b387da7 100644 > --- a/drivers/scsi/libsas/sas_discover.c > +++ b/drivers/scsi/libsas/sas_discover.c > @@ -278,13 +278,7 @@ static void sas_resume_devices(struct work_struct *work) > */ > int sas_discover_end_dev(struct domain_device *dev) > { > - int res; > - > - res = sas_notify_lldd_dev_found(dev); > - if (res) > - return res; > - > - return 0; > + return sas_notify_lldd_dev_found(dev); > } > > /* ---------- Device registration and unregistration ---------- */ > Please add a version descriptor and describe the change against the first version next time . Otherwise this looks good to me. Reviewed-by: Jason Yan Thanks, Jason