From patchwork Tue Oct 25 10:18:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 10669 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp908009wru; Tue, 25 Oct 2022 02:52:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7FG4vk/biNDxaPBnQj7wBkGhoGsmwMw5+q4qTcvobppZELK/2vtVIrBmZs6gt95ZAhYD3C X-Received: by 2002:a17:90b:3b49:b0:213:2adb:6181 with SMTP id ot9-20020a17090b3b4900b002132adb6181mr6654692pjb.56.1666691574518; Tue, 25 Oct 2022 02:52:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666691574; cv=none; d=google.com; s=arc-20160816; b=EdLkohf7uzQvIxfVFhJ20tBH/rs1LRqUM2pO2mqBu8Fikrq51q6c74i5zMhk/WT9gR xEwmNgZ6IZUti80o3Raz1JpNXK6RgHZkBIu6tRILwaNXczKb1J1nFpHGZUAVwknwyy6u Qp59m2An0YUijEh/175VPt+BdASjMVJQQiR5YqrfpogjAzmJSOScmJzyHPPB8Uyd25ZU /o7efWqaMFjFC6qMf9/zdrzj/MsyVLkq5Hooa7Wuq2FMoH245HO6mNJiHH2E2ubAsOth e9YvShCkuN3hTdNtI0u06OtLwdSMOQWQ3pODt4eA8IhkZMXrS07lkMQ2RGyqSSBtcxuJ /7RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=PInqdFtMU5cmtL++aU+ecH2x1/c4gS/PFYDED3CYr6M=; b=JNDOcb+EuRUfqfzZZ84Xm3N3p7r48X6alMM4/RNTDOxp2t34URGZJPvdDQXyDN+TbI Vi+k+JB7wuNd2yrjOr3WyzA9LEFsxLoHJsfP367MLFuV9Sug2SjR27rBpaBnSh2c8IbP vjODFumh9Z5iBdk5AD5MZoBsodI+rETzrFgbMhteFQ0MAbwJh+Sww+bc55nL/O1eazr6 b4rB5mrWlGmuqWVxPkitYO15aZ9pQ15GFtTn23XZVvp9llXxxUn33xxtxDthFFCivSN6 NNx+PrPzY/0qS5TsnBpjFA4GLG0m1XmqFd4nFIiTcsIu6/elbDiDEosZWjLewq+cZvvT CvYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020a170902c40400b0017c59fa6b65si3104426plk.597.2022.10.25.02.52.38; Tue, 25 Oct 2022 02:52:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231953AbiJYJvn (ORCPT + 99 others); Tue, 25 Oct 2022 05:51:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbiJYJu0 (ORCPT ); Tue, 25 Oct 2022 05:50:26 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10B8115DB25; Tue, 25 Oct 2022 02:48:47 -0700 (PDT) Received: from frapeml100008.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MxRrB56Ppz67WVb; Tue, 25 Oct 2022 17:45:14 +0800 (CST) Received: from lhrpeml500003.china.huawei.com (7.191.162.67) by frapeml100008.china.huawei.com (7.182.85.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 11:48:44 +0200 Received: from localhost.localdomain (10.69.192.58) by lhrpeml500003.china.huawei.com (7.191.162.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 10:48:40 +0100 From: John Garry To: , , , , , , , , , CC: , , , , , John Garry Subject: [PATCH RFC v3 12/22] scsi: core: Use SCSI_SCAN_RESCAN in __scsi_add_device() Date: Tue, 25 Oct 2022 18:18:06 +0800 Message-ID: <1666693096-180008-13-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1666693096-180008-1-git-send-email-john.garry@huawei.com> References: <1666693096-180008-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To lhrpeml500003.china.huawei.com (7.191.162.67) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747652784205642879?= X-GMAIL-MSGID: =?utf-8?q?1747652784205642879?= Instead of using hardcoded '1' as the __scsi_add_device() -> scsi_probe_and_add_lun() rescan arg, use proper macro SCSI_SCAN_RESCAN. Signed-off-by: John Garry Reviewed-by: Damien Le Moal --- drivers/scsi/scsi_scan.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index ad0a5902d1a0..b795c138f2c1 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -1580,7 +1580,8 @@ struct scsi_device *__scsi_add_device(struct Scsi_Host *shost, uint channel, scsi_complete_async_scans(); if (scsi_host_scan_allowed(shost) && scsi_autopm_get_host(shost) == 0) { - scsi_probe_and_add_lun(starget, lun, NULL, &sdev, 1, hostdata); + scsi_probe_and_add_lun(starget, lun, NULL, &sdev, + SCSI_SCAN_RESCAN, hostdata); scsi_autopm_put_host(shost); } mutex_unlock(&shost->scan_mutex);