From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752084AbbLMUEp (ORCPT ); Sun, 13 Dec 2015 15:04:45 -0500 Received: from mail5.windriver.com ([192.103.53.11]:39452 "EHLO mail5.wrs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751145AbbLMUEo (ORCPT ); Sun, 13 Dec 2015 15:04:44 -0500 From: Paul Gortmaker To: CC: Paul Gortmaker , Jens Axboe Subject: [PATCH 1/3] block: make genhd.c slightly more explicitly non-modular Date: Sun, 13 Dec 2015 15:04:02 -0500 Message-ID: <1450037044-27628-2-git-send-email-paul.gortmaker@windriver.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1450037044-27628-1-git-send-email-paul.gortmaker@windriver.com> References: <1450037044-27628-1-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Makefile currently controlling compilation of this code is: obj-$(CONFIG_BLOCK) := bio.o elevator.o blk-core.o blk-tag.o blk-sysfs.o \ [...] genhd.o scsi_ioctl.o partition-generic.o ioprio.o \ ...and the Kconfig is: menuconfig BLOCK bool "Enable the block layer" if EXPERT default y ...meaning that it currently is not being built as a module by anyone. While the code uses moduleparam and other modular infrastructure that prevents removal of module.h itself, we can at least ensure the way it is loaded sends a clear message that it is built-in or absent. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We do that because the file already has subsys_initcall() usage within, and I don't want to risk breaking ordering within the file itself. Cc: Jens Axboe Signed-off-by: Paul Gortmaker --- block/genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/genhd.c b/block/genhd.c index cd78712bab8e..333cd557c3a4 100644 --- a/block/genhd.c +++ b/block/genhd.c @@ -1214,7 +1214,7 @@ static int __init proc_genhd_init(void) proc_create("partitions", 0, NULL, &proc_partitions_operations); return 0; } -module_init(proc_genhd_init); +device_initcall(proc_genhd_init); #endif /* CONFIG_PROC_FS */ dev_t blk_lookup_devt(const char *name, int partno) -- 2.6.1