From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Hogan Subject: [RFC PATCH -next] Fix printk_once build errors due to __read_mostly Date: Wed, 30 Oct 2013 10:18:21 +0000 Message-ID: <1383128301-20231-1-git-send-email-james.hogan@imgtec.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from multi.imgtec.com ([194.200.65.239]:11972 "EHLO multi.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752753Ab3J3KS7 (ORCPT ); Wed, 30 Oct 2013 06:18:59 -0400 Sender: linux-next-owner@vger.kernel.org List-ID: To: Joe Perches , Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-next@vger.kernel.org, James Hogan , linux-metag@vger.kernel.org Commit 3e39c1ab04ba (printk: mark printk_once test variable __read_mostly) added __read_mostly to the __print_once bool in the printk_once() macro, but __read_mostly is defined in which isn't included from . This results in build errors like this: arch/metag/mm/l2cache.c: In function 'meta_l2c_setup': arch/metag/mm/l2cache.c:56: error: '__read_mostly' undeclared This is fixed by adding an include of from since I don't think printk_once() users should need to include for it to work. Note that this actually adds a recursive include, since includes , which includes . The actual dependencies are all in macros so it doesn't actually seem to result in any build failures, but it's clearly less than ideal. Signed-off-by: James Hogan Cc: Joe Perches Cc: Andrew Morton Cc: linux-metag@vger.kernel.org --- This build failure was caught in today's linux-next. I'm not too keen on this due to the recursive include. Is it better to just workaround the problem by including from the .c file that fails to build, or should the original patch be removed instead? include/linux/printk.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/printk.h b/include/linux/printk.h index abd42dd..b13d00e 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -2,6 +2,7 @@ #define __KERNEL_PRINTK__ #include +#include #include #include #include -- 1.8.1.2