lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1383128301-20231-1-git-send-email-james.hogan@imgtec.com>
Date:	Wed, 30 Oct 2013 10:18:21 +0000
From:	James Hogan <james.hogan@...tec.com>
To:	Joe Perches <joe@...ches.com>,
	Andrew Morton <akpm@...ux-foundation.org>
CC:	<linux-kernel@...r.kernel.org>, <linux-next@...r.kernel.org>,
	James Hogan <james.hogan@...tec.com>,
	<linux-metag@...r.kernel.org>
Subject: [RFC PATCH -next] Fix printk_once build errors due to __read_mostly

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 <linux/cache.h>
which isn't included from <linux/printk.h>. 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 <linux/cache.h> from
<linux/printk.h> since I don't think printk_once() users should need to
include <linux/cache.h> for it to work.

Note that this actually adds a recursive include, since <linux/cache.h>
includes <linux/kernel.h>, which includes <linux/printk.h>. 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 <james.hogan@...tec.com>
Cc: Joe Perches <joe@...ches.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: linux-metag@...r.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 <linux/cache.h> 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 <stdarg.h>
+#include <linux/cache.h>
 #include <linux/init.h>
 #include <linux/kern_levels.h>
 #include <linux/linkage.h>
-- 
1.8.1.2


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ