From patchwork Thu Jul 31 23:47:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Triplett X-Patchwork-Id: 4659701 Return-Path: X-Original-To: patchwork-linux-kbuild@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 8738AC0338 for ; Thu, 31 Jul 2014 23:48:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B375320149 for ; Thu, 31 Jul 2014 23:48:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C2B3820120 for ; Thu, 31 Jul 2014 23:48:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753173AbaGaXsL (ORCPT ); Thu, 31 Jul 2014 19:48:11 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:35875 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753432AbaGaXsI (ORCPT ); Thu, 31 Jul 2014 19:48:08 -0400 Received: from mfilter13-d.gandi.net (mfilter13-d.gandi.net [217.70.178.141]) by relay4-d.mail.gandi.net (Postfix) with ESMTP id C7813172074; Fri, 1 Aug 2014 01:48:06 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter13-d.gandi.net Received: from relay4-d.mail.gandi.net ([217.70.183.196]) by mfilter13-d.gandi.net (mfilter13-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id R2+IfTVCCMtq; Fri, 1 Aug 2014 01:48:05 +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 2F447172055; Fri, 1 Aug 2014 01:48:00 +0200 (CEST) Date: Thu, 31 Jul 2014 16:47:59 -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 4/5] ftrace: Require designated initialization of structures Message-ID: 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-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@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 Mark various ftrace structures with __designated_init. Fix some ftrace macros to use designated initializers for those structures. Signed-off-by: Josh Triplett --- include/linux/ftrace.h | 4 ++-- include/linux/ftrace_event.h | 4 ++-- include/linux/syscalls.h | 8 ++------ include/trace/ftrace.h | 8 ++------ kernel/trace/trace_export.c | 4 +--- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 404a686..cb2d023 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -260,7 +260,7 @@ struct ftrace_func_command { int (*func)(struct ftrace_hash *hash, char *func, char *cmd, char *params, int enable); -}; +} __designated_init; #ifdef CONFIG_DYNAMIC_FTRACE @@ -283,7 +283,7 @@ struct ftrace_probe_ops { unsigned long ip, struct ftrace_probe_ops *ops, void *data); -}; +} __designated_init; extern int register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops, diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index cff3106..25af313 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h @@ -198,7 +198,7 @@ struct ftrace_event_class { struct list_head *(*get_fields)(struct ftrace_event_call *); struct list_head fields; int (*raw_init)(struct ftrace_event_call *); -}; +} __designated_init; extern int ftrace_event_reg(struct ftrace_event_call *event, enum trace_reg type, void *data); @@ -293,7 +293,7 @@ struct ftrace_event_call { int (*perf_perm)(struct ftrace_event_call *, struct perf_event *); #endif -}; +} __designated_init; static inline const char * ftrace_event_name(struct ftrace_event_call *call) diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index b0881a0..3002648 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -120,9 +120,7 @@ extern struct trace_event_functions exit_syscall_print_funcs; static struct ftrace_event_call __used \ event_enter_##sname = { \ .class = &event_class_syscall_enter, \ - { \ - .name = "sys_enter"#sname, \ - }, \ + .name = "sys_enter"#sname, \ .event.funcs = &enter_syscall_print_funcs, \ .data = (void *)&__syscall_meta_##sname,\ .flags = TRACE_EVENT_FL_CAP_ANY, \ @@ -136,9 +134,7 @@ extern struct trace_event_functions exit_syscall_print_funcs; static struct ftrace_event_call __used \ event_exit_##sname = { \ .class = &event_class_syscall_exit, \ - { \ - .name = "sys_exit"#sname, \ - }, \ + .name = "sys_exit"#sname, \ .event.funcs = &exit_syscall_print_funcs, \ .data = (void *)&__syscall_meta_##sname,\ .flags = TRACE_EVENT_FL_CAP_ANY, \ diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 26b4f2e..095aaca 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h @@ -699,9 +699,7 @@ static struct ftrace_event_class __used __refdata event_class_##call = { \ \ static struct ftrace_event_call __used event_##call = { \ .class = &event_class_##template, \ - { \ - .tp = &__tracepoint_##call, \ - }, \ + .tp = &__tracepoint_##call, \ .event.funcs = &ftrace_event_type_funcs_##template, \ .print_fmt = print_fmt_##template, \ .flags = TRACE_EVENT_FL_TRACEPOINT, \ @@ -716,9 +714,7 @@ static const char print_fmt_##call[] = print; \ \ static struct ftrace_event_call __used event_##call = { \ .class = &event_class_##template, \ - { \ - .tp = &__tracepoint_##call, \ - }, \ + .tp = &__tracepoint_##call, \ .event.funcs = &ftrace_event_type_funcs_##call, \ .print_fmt = print_fmt_##call, \ .flags = TRACE_EVENT_FL_TRACEPOINT, \ diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index d4ddde2..40f472f 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c @@ -174,9 +174,7 @@ struct ftrace_event_class __refdata event_class_ftrace_##call = { \ \ struct ftrace_event_call __used event_##call = { \ .class = &event_class_ftrace_##call, \ - { \ - .name = #call, \ - }, \ + .name = #call, \ .event.type = etype, \ .print_fmt = print, \ .flags = TRACE_EVENT_FL_IGNORE_ENABLE | TRACE_EVENT_FL_USE_CALL_FILTER, \