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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <93a72e881cbdf060f6aefa16f0ac01f546eace4f.1406850006.git.josh@joshtriplett.org>
Date:	Thu, 31 Jul 2014 16:48:08 -0700
From:	Josh Triplett <josh@...htriplett.org>
To:	akpm@...ux-foundation.org,
	"J. Bruce Fields" <bfields@...ldses.org>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Christopher Li <sparse@...isli.org>,
	Ingo Molnar <mingo@...hat.com>,
	Jeff Layton <jlayton@...chiereds.net>,
	Michal Marek <mmarek@...e.cz>, Neil Brown <neilb@...e.de>,
	Steven Rostedt <rostedt@...dmis.org>,
	linux-api@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-raid@...r.kernel.org, linux-sparse@...r.kernel.org
Subject: [PATCH 5/5] include/linux/interrupt.h: Require designated
 initialization of structures

Fix the corresponding tasklet initialization macros to use designated
initializers, which simplifies those initializers using the default
initialization of fields to 0.

Signed-off-by: Josh Triplett <josh@...htriplett.org>
---
 include/linux/interrupt.h | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 698ad05..559ef98 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -217,7 +217,7 @@ struct irq_affinity_notify {
 	struct work_struct work;
 	void (*notify)(struct irq_affinity_notify *, const cpumask_t *mask);
 	void (*release)(struct kref *ref);
-};
+} __designated_init;
 
 #if defined(CONFIG_SMP)
 
@@ -419,7 +419,7 @@ extern const char * const softirq_to_name[NR_SOFTIRQS];
 struct softirq_action
 {
 	void	(*action)(struct softirq_action *);
-};
+} __designated_init;
 
 asmlinkage void do_softirq(void);
 asmlinkage void __do_softirq(void);
@@ -474,14 +474,21 @@ struct tasklet_struct
 	atomic_t count;
 	void (*func)(unsigned long);
 	unsigned long data;
-};
-
-#define DECLARE_TASKLET(name, func, data) \
-struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(0), func, data }
+} __designated_init;
 
-#define DECLARE_TASKLET_DISABLED(name, func, data) \
-struct tasklet_struct name = { NULL, 0, ATOMIC_INIT(1), func, data }
+#define DECLARE_TASKLET(name, tsfunc, tsdata) \
+struct tasklet_struct name = {		\
+	.count = ATOMIC_INIT(0),	\
+	.func = tsfunc,			\
+	.data = tsdata,			\
+}
 
+#define DECLARE_TASKLET_DISABLED(name, tsfunc, tsdata) \
+struct tasklet_struct name = {		\
+	.count = ATOMIC_INIT(1),	\
+	.func = tsfunc,			\
+	.data = tsdata,			\
+}
 
 enum
 {
@@ -576,7 +583,7 @@ struct tasklet_hrtimer {
 	struct hrtimer		timer;
 	struct tasklet_struct	tasklet;
 	enum hrtimer_restart	(*function)(struct hrtimer *);
-};
+} __designated_init;
 
 extern void
 tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer,
-- 
2.0.1

--
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