From patchwork Thu Jul 31 23:48:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Triplett X-Patchwork-Id: 4659681 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C555DC0338 for ; Thu, 31 Jul 2014 23:48:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A46120120 for ; Thu, 31 Jul 2014 23:48:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2478320170 for ; Thu, 31 Jul 2014 23:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753805AbaGaXsX (ORCPT ); Thu, 31 Jul 2014 19:48:23 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:55834 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753723AbaGaXsR (ORCPT ); Thu, 31 Jul 2014 19:48:17 -0400 Received: from mfilter12-d.gandi.net (mfilter12-d.gandi.net [217.70.178.129]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id 6C838172055; Fri, 1 Aug 2014 01:48:15 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter12-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter12-d.gandi.net (mfilter12-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id fH7+mfksi49Z; Fri, 1 Aug 2014 01:48:14 +0200 (CEST) X-Originating-IP: 173.246.103.110 Received: from jtriplet-mobl1 (joshtriplett.org [173.246.103.110]) (Authenticated sender: josh@joshtriplett.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 0181B17207C; Fri, 1 Aug 2014 01:48:09 +0200 (CEST) Date: Thu, 31 Jul 2014 16:48:08 -0700 From: Josh Triplett To: akpm@linux-foundation.org, "J. Bruce Fields" , Alexander Viro , Christopher Li , Ingo Molnar , Jeff Layton , Michal Marek , Neil Brown , Steven Rostedt , linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-sparse@vger.kernel.org Subject: [PATCH 5/5] include/linux/interrupt.h: Require designated initialization of structures Message-ID: <93a72e881cbdf060f6aefa16f0ac01f546eace4f.1406850006.git.josh@joshtriplett.org> References: <3130b0553b15518e3bef6d14c80280beed0f5ff9.1406850006.git.josh@joshtriplett.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <3130b0553b15518e3bef6d14c80280beed0f5ff9.1406850006.git.josh@joshtriplett.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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,