From patchwork Thu Jan 11 10:31:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 124182 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp377137edr; Thu, 11 Jan 2018 02:32:42 -0800 (PST) X-Google-Smtp-Source: ACJfBotqMwLwFtYsBvRQG4wcAaXTHSNDIFKvluqsfGZ2Zsb7dkyb3H0RLRzd6xa0S81ik9BChdjP X-Received: by 10.101.96.200 with SMTP id r8mr17698142pgv.341.1515666762488; Thu, 11 Jan 2018 02:32:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515666762; cv=none; d=google.com; s=arc-20160816; b=JRN8gABrvTS7oge34KMAvcF0BdWslp/8huLAYv8BOfwcVdGpAr/zsAoz5tOpP59QQw OgaRz8kOv0t0BtwzH6ALr6n5ZWwXmZW35YqezFthyK3/Jjy9ioUY/uqaQyv9YLbRj9M2 zgPH5TdOml5jDGppLE14erNH0BZ678+DDX+5KHbFpwf9kxdkJ2pUVcZfaacmKhD5ReVd OXioFqz0jTCrj6GAoD0hlDDaXey/vbRr7lekWW4d/Ma1Asxcs8RgA8Co+evcvxvIYNRy Xz2YDYHBRT8eK33KS3laBvNqSglmxVdlcdDzpKliWRbRFXKVQsjqA9uq3+5Sec591bEG Fqrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=hjkuQd1k6EMsDEWSXbBwhgPIKbV6QnUaEa/UWT1/YVs=; b=qgJWiiVs2e36T/OLwtKhbmQnYQvfUu8USFxWj1S4QXqC/RfV8qaahHIm0RDFoiWEGz j758ValBtlHUEFo+Y6dj1O4GRQKvlAb3T0U9BJ3aqeZw2q/adjYMFomeugWnpD9GmLQk Yb1c6DEJ4kH2CHlxgKzF7T5QFLGQMCbLl9c+4oBxUPXIb3Jf6lVzeaq6EbPUbYbEwjO7 ROz+6ZnBC5tL2c6ipuWoDYQf9gVJ3T+AZvgMh9YRpBhK0056S8+OgZC8roDZ2zi5h9Cf 4JuEzidWwINCjXl2+FOFwbVlLK7PQDIDeaODWtfqxAkXYmoS05StJcsjOi8iB+ED2aHg 1vKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j67si13290198pfj.127.2018.01.11.02.32.41; Thu, 11 Jan 2018 02:32:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933315AbeAKKck (ORCPT + 28 others); Thu, 11 Jan 2018 05:32:40 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:61990 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754153AbeAKKci (ORCPT ); Thu, 11 Jan 2018 05:32:38 -0500 Received: from wuerfel.lan ([95.208.111.237]) by mrelayeu.kundenserver.de (mreue007 [212.227.15.129]) with ESMTPA (Nemesis) id 0MSlc0-1ePiGp1Z3c-00Rd7I; Thu, 11 Jan 2018 11:32:31 +0100 From: Arnd Bergmann To: Jens Axboe Cc: Arnd Bergmann , Hannes Reinecke , Shaohua Li , linux-kernel@vger.kernel.org Subject: [PATCH] null_blk: remove explicit 'select FAULT_INJECTION' Date: Thu, 11 Jan 2018 11:31:25 +0100 Message-Id: <20180111103227.1297305-1-arnd@arndb.de> X-M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Cge4W7nVyP5PgL3rXjbjnEg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Selecting FAULT_INJECTION causes a Kconfig warning when CONFIG_DEBUG_KERNEL is not set: warning: (BLK_DEV_NULL_BLK && DRM_I915_SELFTEST) selects FAULT_INJECTION which has unmet direct dependencies (DEBUG_KERNEL) The other drivers that use FAULT_INJECTION tend to have a separate Kconfig symbol for turning on that feature, so let's do the same thing here. This may add a bit more complexity than we like, but it avoids the warning and is more consistent with the rest of the kernel. Fixes: 93b570464cce ("null_blk: add option for managing IO timeouts") Signed-off-by: Arnd Bergmann --- drivers/block/Kconfig | 5 ++++- drivers/block/null_blk.c | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) -- 2.9.0 diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index 622d9a2c8dae..b795d0ca74eb 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig @@ -19,7 +19,10 @@ if BLK_DEV config BLK_DEV_NULL_BLK tristate "Null test block driver" select CONFIGFS_FS - select FAULT_INJECTION + +config BLK_DEV_NULL_BLK_FAULT_INJECTION + bool "Support fault injection for Nll test block driver" + depends on BLK_DEV_NULL_BLK && FAULT_INJECTION config BLK_DEV_FD tristate "Normal floppy disk support" diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index 2e6f3b2cb902..6655893a3a7a 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c @@ -27,7 +27,9 @@ #define TICKS_PER_SEC 50ULL #define TIMER_INTERVAL (NSEC_PER_SEC / TICKS_PER_SEC) +#ifdef CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION static DECLARE_FAULT_ATTR(null_timeout_attr); +#endif static inline u64 mb_per_tick(int mbps) { @@ -165,8 +167,10 @@ static int g_home_node = NUMA_NO_NODE; module_param_named(home_node, g_home_node, int, S_IRUGO); MODULE_PARM_DESC(home_node, "Home node for the device"); +#ifdef CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION static char g_timeout_str[80]; module_param_string(timeout, g_timeout_str, sizeof(g_timeout_str), S_IRUGO); +#endif static int g_queue_mode = NULL_Q_MQ; @@ -1372,8 +1376,10 @@ static int null_rq_prep_fn(struct request_queue *q, struct request *req) static bool should_timeout_request(struct request *rq) { +#ifdef CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION if (g_timeout_str[0]) return should_fail(&null_timeout_attr, 1); +#endif return false; } @@ -1655,6 +1661,7 @@ static void null_validate_conf(struct nullb_device *dev) static bool null_setup_fault(void) { +#ifdef CONFIG_BLK_DEV_NULL_BLK_FAULT_INJECTION if (!g_timeout_str[0]) return true; @@ -1662,6 +1669,7 @@ static bool null_setup_fault(void) return false; null_timeout_attr.verbose = 0; +#endif return true; }