Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2921137pxb; Tue, 24 Aug 2021 10:38:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9d/jezwFv04+kMfwxGfLjY/IkES1+sOe/Zn31yc0BV3pMc9/FB6KsxHGoW/jij2jQlWYR X-Received: by 2002:a05:6638:419e:: with SMTP id az30mr36315665jab.14.1629826709341; Tue, 24 Aug 2021 10:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629826709; cv=none; d=google.com; s=arc-20160816; b=0LD4c2XXfh7BBImhUHHiCAohIDJHZbaJ7jBgBrsBdxg4VBk5M+0Dg3P2JihU+0Uk92 0nUxmH45N0hNcC5ARy95WBVoxF/20ADuvZ1HS9HMgQyNH/n6eNgnxk/NOYTDeW/It26t 7ptkgUZfS8IRcSYoVMiIpTuhZDaUXu9E4FwyKuOrs+3VtsAfMdYfK/D5SA+NcZlFZ9KG leX9OImiW5cL0wAAYPYwOILSNXUKhgoArIVSXcGNup8Jok0IPG0EOAoBVGZ5i3pmZLZa jqkJ6kCPUHvJRuDR6Ksj+k3DiuSf4IoQjTazbh3Gdo3H02jRu+iHSzCokvDj+UrihpXI syCQ== 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=dGA2R9EgWp8PJAEoMlQ7x+I8uUfKGTUUJvO0XBX4fBU=; b=sIkC3NL0YVYWPLXG9pGTCdiqWcp/jTbodx5mxEQeE6zDWGGe3tFkl4M7zmmcFeoujM dRuyWJ46mp8OHiFNvmtabw6K3fdLcX4wjqZK/xa8kiLpLP/2At9Y1NmdasQyIyMldIQj 4/IR7Ej7m+2+qAOnIlTCAKl9GKzZf3pASTcvyUe+XZ+Zk0dz171Xq/6H4IZ6n6YfK0sF e26w+WeYpwojWCyxWUqz5BEXsg4vw8mqSwZQhDUX2OAEfwax1oxtGgvmxkvpzqgmS1zT NjJUTuqZFyK2KAGh0HUu42UeALOLyjSyeYSYmimIIJhMo21wX3c5ahssC7CI/0r5Ngjr DS0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ngJAeiKU; 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 c18si19487044iod.38.2021.08.24.10.38.17; Tue, 24 Aug 2021 10:38:29 -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=ngJAeiKU; 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 S241937AbhHXRiQ (ORCPT + 99 others); Tue, 24 Aug 2021 13:38:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:39358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242175AbhHXRem (ORCPT ); Tue, 24 Aug 2021 13:34:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5F3A061BB4; Tue, 24 Aug 2021 17:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824804; bh=kln+TdL2yLTp4Awig9Sffb7Fm7JG6GfX55GX2Gh1dxg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ngJAeiKUAIUk+6SykTg1z2AQrYbOkB2V1z6oLGlsVwKNTVI8gZfGAIuBIkajQ1RhY KtmgZLjAtKCluDPD9rFw9cQLWT8aCWwMaQ0HPHfV9NO0c2eIFF0JXsXmh8+OYUEnnx 0mNco6zJgDV/cUusPB9wzSGmRREZv34QgTxw1HGnQjlGwMceb6NGRIW0nCEK+ep1Ti zwbMTwQEVwPqFlSbGqPRMe3jeNaaBlHt97U+n+OxsSc0bRoD10xbHdXXkTE64qFYve xW6hi/YMuj/ZfvoTV1SslXHsKRpWqhUOEiYfmdp0IFKJujiqlTrTVYHTKFwjYk8RBA aH2r+i3SpXg/g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sreekanth Reddy , "Martin K . Petersen" , Sasha Levin Subject: [PATCH 4.9 28/43] scsi: core: Avoid printing an error if target_alloc() returns -ENXIO Date: Tue, 24 Aug 2021 13:05:59 -0400 Message-Id: <20210824170614.710813-29-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824170614.710813-1-sashal@kernel.org> References: <20210824170614.710813-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.281-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.9.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.9.281-rc1 X-KernelTest-Deadline: 2021-08-26T17:06+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 397deb69c659..e51819e3a508 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -460,7 +460,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