From patchwork Sat Oct 20 16:45:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland Dreier X-Patchwork-Id: 10650565 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A9DD313A9 for ; Sat, 20 Oct 2018 16:45:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9990F2861E for ; Sat, 20 Oct 2018 16:45:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BC9A2864B; Sat, 20 Oct 2018 16:45:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 39D9A2861E for ; Sat, 20 Oct 2018 16:45:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727605AbeJUA4Z (ORCPT ); Sat, 20 Oct 2018 20:56:25 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46266 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727543AbeJUA4Z (ORCPT ); Sat, 20 Oct 2018 20:56:25 -0400 Received: by mail-pf1-f195.google.com with SMTP id r64-v6so17879219pfb.13 for ; Sat, 20 Oct 2018 09:45:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=purestorage.com; s=google; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SbI8oDJA49SSJ3tpaoLtgquZxZpFFqX3+aA41ktuzD0=; b=jWIlIt/Jf5x6leVAFOBLnw8K6/VtI7Iz4VB5B7kYO1cJeZQFeUQhr4AxEBMyfDC0Qq SKTPUf/gpxocodLapFSxzzN+Q56xaGMU6W6Y8LmfVqHnFQh9hrNxV7MIFDvRD4fpPUrl yRIJsTqJ1LrOv2fsq8xT6HIAsV3a8K4B2lQog= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=SbI8oDJA49SSJ3tpaoLtgquZxZpFFqX3+aA41ktuzD0=; b=C3vOlWqVeDZmsUlwl5MjsTTmVqfzbhpmzbliu4VP5ENWBs0K1j8oOLDKe3XvScH3Q5 Wk/WwAkoIiGo1wHv3H0VT+VYoMCyIUDKImQPlc+lDR60Ak5cA6RGEd09uOW2mqDk5ymR pj+3ld9/N0BPOo9DRB6UMI9IARhQUVBtV1OlZBHOTzKn3Z69zlZqcDtfMBcVVSMgGcEB k6PB7mg+ewfGAVuDnh3kEF90hWBiflr3czsH6ojXVfYc5ATv628UbMMwpfQYA6FwPdBs S3MDWuJWCoVAJjV4ehBzdPasUrpJjRVh35Uk+TQkPxIjD5sRA5uRxdbSDuQ3J7gOGrxF i+Xg== X-Gm-Message-State: ABuFfoi8eKMyS2TIRh8O1JWA2XyBjN4ptDk4sSeWGWFe3szWXhL+4eOE hSGdbbIyIgBUjHQsStytzCyIJA== X-Google-Smtp-Source: ACcGV62NhluPGE0eOUrUKmn8B5TcRifra6fvx6izv5m2qigQz2TJhA3zf1qCAQwcPMaaUuuo9wHCJg== X-Received: by 2002:a63:6246:: with SMTP id w67-v6mr6295389pgb.53.1540053921998; Sat, 20 Oct 2018 09:45:21 -0700 (PDT) Received: from roland-x1-yoga.digitalvampire.org ([2601:647:4600:7ac7:fd39:320b:21cd:f739]) by smtp.gmail.com with ESMTPSA id q25-v6sm43337885pfk.154.2018.10.20.09.45.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Oct 2018 09:45:20 -0700 (PDT) From: Roland Dreier To: "Martin K . Petersen" , "Nicholas A . Bellinger" Cc: Christoph Hellwig , target-devel@vger.kernel.org Subject: [PATCH 2/2] target: Don't request modules that aren't even built Date: Sat, 20 Oct 2018 09:45:16 -0700 Message-Id: <20181020164516.8719-1-roland@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roland Dreier If, for example, I don't enable CONFIG_TCM_PSCSI, then every time I load the target subsystem, I get an annoying Unable to load target_core_pscsi kernel log message. Instead let's only request_module() on things if that code is enabled. Signed-off-by: Roland Dreier Reviewed-by: Christoph Hellwig --- drivers/target/target_core_transport.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index 86c0156e6c88..eee222db0a14 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c @@ -205,19 +205,19 @@ void transport_subsystem_check_init(void) if (sub_api_initialized) return; - ret = request_module("target_core_iblock"); + ret = IS_ENABLED(CONFIG_TCM_IBLOCK) && request_module("target_core_iblock"); if (ret != 0) pr_err("Unable to load target_core_iblock\n"); - ret = request_module("target_core_file"); + ret = IS_ENABLED(CONFIG_TCM_FILEIO) && request_module("target_core_file"); if (ret != 0) pr_err("Unable to load target_core_file\n"); - ret = request_module("target_core_pscsi"); + ret = IS_ENABLED(CONFIG_TCM_PSCSI) && request_module("target_core_pscsi"); if (ret != 0) pr_err("Unable to load target_core_pscsi\n"); - ret = request_module("target_core_user"); + ret = IS_ENABLED(CONFIG_TCM_USER2) && request_module("target_core_user"); if (ret != 0) pr_err("Unable to load target_core_user\n");