Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3145542pxk; Mon, 21 Sep 2020 06:27:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVMHaUFyI/tM/i1ozgfw82l9GGUWGDCaCmzxysARS9kYUNyeBjsYKpuN32eywDwFmVsJDv X-Received: by 2002:a05:6402:176e:: with SMTP id da14mr53124081edb.349.1600694831259; Mon, 21 Sep 2020 06:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600694831; cv=none; d=google.com; s=arc-20160816; b=iAX1GoYZYCouG0jKt/LOnEJn5KZi9AtVfeWSwsJSDvl9zaLyE6sWojr23fYM2kkHJ0 aCDszdiwEyHCgJib/QnU8PLymYsIHlrTZ8fA43IRc/RVhZAJr+/64OWAdM2a3My+c0d+ EVb0lf3OtxGSzFKOYzhnLh8N1qd2vxNPEgqFu+Y0MnZmjWGysMZ89L4Wjrl8M/mHRsnX mYI0p8GFbO1FAAnj6+Pjy/mGi+e8EJDCVuaqinIjvzpIu2FtQmSbR762BzfCUWvsBehV /YZ3+92uMyFa1vQmpeR7Xkr8cMI3p/dvPEPH0UZmLjpNgZuFKipvvUjnb5t1T2QW39fK Ua6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=QEhUMO9R4w+coSC4Fk/GWLq9tzqm8ASQw8SfhBerSvE=; b=Dl4NBkNGPBfCeExqzlf7+y+4uDA7ScdJxvoquOGR06gRubwcl6Pcvs5LH485h5eOWN xMFBHqt2z4Exi/IDXif1aAirvOHoIQ1Rk8cymm+2IC50u24XS0Q0GifgtDDtcd4H0DDw +e0vut16FaQeQnDP8B6WJSqh+MZf2j2blFumuCpGNw7qTxX64zVXuuamOjW+hohzgx4d BwYalt9mBbvJxhnYs1/XkRnopLqq4SU8RUmYpfaoyfEvEG0lnmHx6Hj2fhcwzNtR3lNy ao5f/zObgVrA6RACDsim5nQfXIiCvbj+Hb4fifE2W0Zp9mpKu4Ky0BbJjDOrnnoXaFtL AgCQ== 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 x11si8095512edr.460.2020.09.21.06.26.46; Mon, 21 Sep 2020 06:27:11 -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 S1726830AbgIUNXq (ORCPT + 99 others); Mon, 21 Sep 2020 09:23:46 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:14203 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726419AbgIUNXq (ORCPT ); Mon, 21 Sep 2020 09:23:46 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id BC8B7799B73625242F36; Mon, 21 Sep 2020 21:23:42 +0800 (CST) Received: from huawei.com (10.175.113.32) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.487.0; Mon, 21 Sep 2020 21:23:34 +0800 From: Liu Shixin To: John Garry , "James E.J. Bottomley" , "Martin K. Petersen" CC: , , Liu Shixin Subject: [PATCH -next] scsi: libsas: simplify the return expression of sas_discover_* functions Date: Mon, 21 Sep 2020 21:45:58 +0800 Message-ID: <20200921134558.3478922-1-liushixin2@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.32] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ---------- */ -- 2.25.1