From: Yaowei Bai <bywxiaobai@163.com>
To: rostedt@goodmis.org, mingo@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] kernel/trace_probe: is_good_name can be boolean
Date: Tue, 22 Sep 2015 21:43:13 +0800 [thread overview]
Message-ID: <1442929393-4753-2-git-send-email-bywxiaobai@163.com> (raw)
In-Reply-To: <1442929393-4753-1-git-send-email-bywxiaobai@163.com>
This patch makes is_good_name return bool to improve readability
due to this particular function only using either one or zero as its
return value.
No functional change.
Signed-off-by: Yaowei Bai <bywxiaobai@163.com>
---
kernel/trace/trace_probe.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/kernel/trace/trace_probe.h b/kernel/trace/trace_probe.h
index b98dee9..f6398db 100644
--- a/kernel/trace/trace_probe.h
+++ b/kernel/trace/trace_probe.h
@@ -302,15 +302,15 @@ static nokprobe_inline void call_fetch(struct fetch_param *fprm,
}
/* Check the name is good for event/group/fields */
-static inline int is_good_name(const char *name)
+static inline bool is_good_name(const char *name)
{
if (!isalpha(*name) && *name != '_')
- return 0;
+ return false;
while (*++name != '\0') {
if (!isalpha(*name) && !isdigit(*name) && *name != '_')
- return 0;
+ return false;
}
- return 1;
+ return true;
}
static inline struct event_file_link *
--
1.9.1
next prev parent reply other threads:[~2015-09-22 13:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-22 13:43 [PATCH 1/2] kernel/trace: call helper function to check global_trace Yaowei Bai
2015-09-22 13:43 ` Yaowei Bai [this message]
2015-09-22 13:59 ` [PATCH 2/2] kernel/trace_probe: is_good_name can be boolean Steven Rostedt
2015-09-22 13:58 ` [PATCH 1/2] kernel/trace: call helper function to check global_trace Steven Rostedt
2015-09-23 13:49 ` Yaowei Bai
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=1442929393-4753-2-git-send-email-bywxiaobai@163.com \
--to=bywxiaobai@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
/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
all inboxes | Powered by JetHome®