From: Steven Rostedt <rostedt@goodmis.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Tom Rix <trix@redhat.com>,
mhiramat@kernel.org, linux-kernel@vger.kernel.org,
linux-trace-kernel@vger.kernel.org
Subject: Re: [PATCH] samples: ftrace: make some global variables static
Date: Tue, 31 Jan 2023 10:39:35 -0500 [thread overview]
Message-ID: <20230131103935.4966c46e@gandalf.local.home> (raw)
In-Reply-To: <Y9jo1SJpsBRTb2M5@FVFF77S0Q05N>
On Tue, 31 Jan 2023 10:09:25 +0000
Mark Rutland <mark.rutland@arm.com> wrote:
> On Mon, Jan 30, 2023 at 11:37:08AM -0800, Tom Rix wrote:
> > smatch reports this representative issue
> > samples/ftrace/ftrace-ops.c:15:14: warning: symbol 'nr_function_calls' was not declared. Should it be static?
> >
> > The nr_functions_calls and several other global variables are only
> > used in ftrace-ops.c, so they should be static.
>
> This makes sense to me.
>
> > Remove the instances of initializing static int to 0.
>
> I appreciate that static variables get implicitly zero initialized, but
> dropping the initialization is inconsistent with the other control variables,
> and IMO it's quite confusing, so I'd prefer to keep that for clarity. I note
> you've also dropped the initialization of a bool to false, whereas the above
> just mentions int.
>
> I'd prefer to keep the initialization, but I'll defre to Steve if he thinks
> differently. :)
Yeah, I'm fine with dropping the initialization of even bool (I don't
initialize bool to false either). Everything in the BSS section is always
initialized to zero, and in C, false is the same as zero.
>
> > Signed-off-by: Tom Rix <trix@redhat.com>
>
> With the above taken into account:
>
> Acked-by: Mark Rutland <mark.rutland@arm.com>
Thanks,
-- Steve
prev parent reply other threads:[~2023-01-31 15:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 19:37 [PATCH] samples: ftrace: make some global variables static Tom Rix
2023-01-31 10:09 ` Mark Rutland
2023-01-31 13:17 ` Tom Rix
2023-01-31 15:39 ` Steven Rostedt [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230131103935.4966c46e@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
--cc=trix@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).