Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2892735pxb; Tue, 24 Aug 2021 10:01:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkyIlX98h580HUtC0aYr0tyvs5zSSImvOPeGqqx6YKjKqWR9TEEDMq4Zv7/O74eaUjjO7Q X-Received: by 2002:aa7:cc08:: with SMTP id q8mr44172595edt.225.1629824484863; Tue, 24 Aug 2021 10:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629824484; cv=none; d=google.com; s=arc-20160816; b=EiSenmOMffa3mYIqaaqGgZ1f1nhW71WH5z+PlpNov1V36F8ma+7RGuNdSug8P5lOS/ 2x8xng/FEhfRsASDl08Nxpg/sx0x2sl1bMBXOt1Gf9z0+YgXII/ou2UyoJJkD3PhYDv/ IvrEgxM01MmzGJ6VnNENSSaV4RHBOOvVQF4i+ytz7fyLhzd88HVUNEqKDxCiFN7m4hRu CB2rNzkuY61aI+OILal0n0418V6GWPjQb2Ub8kaUGuiCSr8RuNP7BkQL6xqR9Ac7wUzR oEej7BoEDEKSvGjNe24APwV3a0sTrtF4jmrw8wgpATzyOF0AdabyH9jJobMvMNqKhfLS bggA== 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=t6y9qiIQ5XmgRBKUYRdljtweoAz7yen06i6pjpbkRCU=; b=ewQyI5MiQ+0Yg0KWbt5ZR29pa34yRusB6g9BP5q1CLY3uxL50LxRxLU52bgLsFYDTJ JSPnqb77F/E6X58O+/dSiSxgGklY+w4n6Wy3vR6nWLq1BCJq8JUMA0t+0JuauAUBIaa5 mwQwfST8coyOSWctDLrPCeoAUJLshi8Rpa2X6d9rWfBtCDmBrADW4wysDvf+j6d6QWyf DXFCPoS4aKbo5A06EQJTB8JNcJULuXuSe1/EuObk9yg6AcblX1on8WrXT1gtJubJXUXv ORBc/GwpIIrJjh6KXXxJ2k7EokppPFnByCLYT9bTRqb5bNj8BIH37yQ4ZObOId64UckJ MaTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lxyH+t1F; 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 bo26si7797183edb.294.2021.08.24.10.01.00; Tue, 24 Aug 2021 10:01:24 -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=lxyH+t1F; 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 S234402AbhHXQ5g (ORCPT + 99 others); Tue, 24 Aug 2021 12:57:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:38858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233998AbhHXQ5H (ORCPT ); Tue, 24 Aug 2021 12:57:07 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 672CF61357; Tue, 24 Aug 2021 16:56:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824183; bh=a58CtOqhhxArCXSpeLkqc6U7Wh0GX9ftrQnFBMuCjmA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lxyH+t1Fn9+PwDeNw5rDr9aA90yeZreLKZlw+lbf/7nBlkuE/nDxmIqUJ2rBLrsTF DwYSbKa7ECID0EpPiHFfPOH1K282YKxlKtIqjqHcHOyNKasGLLKIG8No5USmWODHLL lhfPYIBhu38TYYJhfYIKg2YweGzu5r/0Lks3FAin8z1DT2HjW4eW7Vl8S/pfxKH0pK WpJgqOURxUI8fUqFuOFN0OxcDEaZGmEaZ0310qPgeAL8EKt1Hc7wuVNkiS4aGUpbHD QtMMBvqroa+1uOo1S6B8uaxwU9eAqc5DutBZn+70/cMGy+YCLOYycHcSylAYZAS7fs ixL0sZT7zQ2Hw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sreekanth Reddy , "Martin K . Petersen" , Sasha Levin Subject: [PATCH 5.13 014/127] scsi: core: Avoid printing an error if target_alloc() returns -ENXIO Date: Tue, 24 Aug 2021 12:54:14 -0400 Message-Id: <20210824165607.709387-15-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165607.709387-1-sashal@kernel.org> References: <20210824165607.709387-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.13.13-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.13.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.13.13-rc1 X-KernelTest-Deadline: 2021-08-26T16:55+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 12f54571b83e..f0367115632b 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -471,7 +471,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