Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2898447pxb; Tue, 24 Aug 2021 10:08:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz83tP2BGQ3RPX+liS0d0Jz0Hb7AGQq+PmnNwsOzEevdaIylrv9lL6cHFjwk6sQmilzU1Rj X-Received: by 2002:a6b:e616:: with SMTP id g22mr33026195ioh.67.1629824897430; Tue, 24 Aug 2021 10:08:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629824897; cv=none; d=google.com; s=arc-20160816; b=Fw2bAcnEgHMv/2Bp7cBiwHq8hvpTLJVWJRxW1L6un2RvXZumHsqewkz13VSTgl2XQ+ ZskVM8t3A/+YIeed1hdYw0P1TUbb131Mf89h1JXSjud3mhjJZdeP+7uPs+UM8NE3NKZk jhydaTgwD1Ur7IDCzPKaFCxV6piFr6z2Wyh4+O3giJDVhnBKkktDeBqWOVwgsOV2Uvq+ OcJHFiRq+zlbL0jj1jK7TQq4JsmStd/zhjCPpMmWUp1m1UF4CaTciF+6wK07no6P2b2E sv5UaNFGJDNCTP0c0mZ+jPiLTCPmzuxgzpa8sUy8dupu3mCiGZRnFSXg59+muVNaI3bB lDpQ== 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 :dkim-signature; bh=2mLNUvsUE6NwCz7L2NDUG/EBGP+uFwSUBIgf7jxscgQ=; b=wNdRVw5A48+Sb5gx2VpG9GmDtaJ+68Y6HGkg9hKdGos8sIe66EYtuehm7ONttM8rqs wG3wzFrahBwWIQIEE6iz9eeqhrOrIcyBUdl2m8WYn4HVSKsiXW6iCLlCWkib/McXDYSK z7+sLUsNk3pJTFAXTC3KcTIYA/MsrTlPttsJMUOT0kT8gvPUwwzlFr6zV+uYyp6LPtJh f/jt5LI8rBXhaNbiTSkgihRcVYm7iaq8wmaZDcjPMprZwOKEAPVr8nFhxi5B7anF1RHW 9agWKPskKm7DKHuYengMU0a5TGcNQNxmn4PYE+IBPxG8QIFLPXXOGYzef6bay7ZZCQKK I8hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=loPyS4VU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si18433735ilt.110.2021.08.24.10.08.05; Tue, 24 Aug 2021 10:08:17 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=loPyS4VU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234570AbhHXRID (ORCPT + 99 others); Tue, 24 Aug 2021 13:08:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:46490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239844AbhHXRFB (ORCPT ); Tue, 24 Aug 2021 13:05:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B2581619E5; Tue, 24 Aug 2021 16:59:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824375; bh=FktZTSF8BWKM69s9jXoBFOK3vesoPn+vrbrFUlZyrpc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=loPyS4VUnzv10kivF79urz2lm2w1XITyf3cD+63U9IzzngBPwYVm/scgtvQ3XiC9W xUmiy25lMJK+4e/Itd1xYY2jgsmpdC1wnQgmyCoeSUNCIfOdPbuv5p9lvSIgrghnR8 OjgH3qXsFU2H9bvFId/TbqkiCQ1wVpyCXzlg/evUUUnnriPUdzAagM5kVyU5bDHyj+ 0fUnUr19Mz7XCHLHbAURqcUANsSxCeCCeMtW99GSCVUvBx+yWjaYswcEZMv0tsmywm /M5EQJCO9+XnnghWOIGufBqJqRTpkVCpB6/rhWh82COmpDl1eDbOmjL/rQfUdwrG+7 i9IugLvfE7lKQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sreekanth Reddy , "Martin K . Petersen" , Sasha Levin Subject: [PATCH 5.10 25/98] scsi: core: Avoid printing an error if target_alloc() returns -ENXIO Date: Tue, 24 Aug 2021 12:57:55 -0400 Message-Id: <20210824165908.709932-26-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165908.709932-1-sashal@kernel.org> References: <20210824165908.709932-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.61-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.10.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.10.61-rc1 X-KernelTest-Deadline: 2021-08-26T16:58+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sreekanth Reddy [ Upstream commit 70edd2e6f652f67d854981fd67f9ad0f1deaea92 ] Avoid printing a 'target allocation failed' error if the driver target_alloc() callback function returns -ENXIO. This return value indicates that the corresponding H:C:T:L entry is empty. Removing this error reduces the scan time if the user issues SCAN_WILD_CARD scan operation through sysfs parameter on a host with a lot of empty H:C:T:L entries. Avoiding the printk on -ENXIO matches the behavior of the other callback functions during scanning. Link: https://lore.kernel.org/r/20210726115402.1936-1-sreekanth.reddy@broadcom.com Signed-off-by: Sreekanth Reddy Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- 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 9af50e6f94c4..8e474b145249 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -453,7 +453,8 @@ static struct scsi_target *scsi_alloc_target(struct device *parent, error = shost->hostt->target_alloc(starget); if(error) { - dev_printk(KERN_ERR, dev, "target allocation failed, error %d\n", error); + if (error != -ENXIO) + dev_err(dev, "target allocation failed, error %d\n", error); /* don't want scsi_target_reap to do the final * put because it will be under the host lock */ scsi_target_destroy(starget); -- 2.30.2