aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2019-05-20 09:26:24 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-05-25 23:04:42 -0400
commit7375dca1647fa978310f2d706ddbff537f72110b (patch)
tree6007c74b658d6efa8e689820aa7a24f065b95a66 /kernel/trace/ftrace.c
parent0c97bf863efce63d6ab7971dad811601e6171d2f (diff)
ftrace: Make enable and update parameters bool when applicable
The code modification functions have "enable" and "update" variables that are sometimes "int" but used as "bool". Remove the ambiguity and make them "bool" when they are only used for true or false values. Link: http://lkml.kernel.org/r/e1429923d9eda92a3cf5ee9e33c7eacce539781d.1558115654.git.naveen.n.rao@linux.vnet.ibm.com Reported-by: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index a12aff849c04..4f2c26bebe2a 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1768,7 +1768,7 @@ static bool __ftrace_hash_rec_update(struct ftrace_ops *ops,
1768 count++; 1768 count++;
1769 1769
1770 /* Must match FTRACE_UPDATE_CALLS in ftrace_modify_all_code() */ 1770 /* Must match FTRACE_UPDATE_CALLS in ftrace_modify_all_code() */
1771 update |= ftrace_test_record(rec, 1) != FTRACE_UPDATE_IGNORE; 1771 update |= ftrace_test_record(rec, true) != FTRACE_UPDATE_IGNORE;
1772 1772
1773 /* Shortcut, if we handled all records, we are done. */ 1773 /* Shortcut, if we handled all records, we are done. */
1774 if (!all && count == hash->count) 1774 if (!all && count == hash->count)
@@ -2047,7 +2047,7 @@ void ftrace_bug(int failed, struct dyn_ftrace *rec)
2047 } 2047 }
2048} 2048}
2049 2049
2050static int ftrace_check_record(struct dyn_ftrace *rec, int enable, int update) 2050static int ftrace_check_record(struct dyn_ftrace *rec, bool enable, bool update)
2051{ 2051{
2052 unsigned long flag = 0UL; 2052 unsigned long flag = 0UL;
2053 2053
@@ -2146,28 +2146,28 @@ static int ftrace_check_record(struct dyn_ftrace *rec, int enable, int update)
2146/** 2146/**
2147 * ftrace_update_record, set a record that now is tracing or not 2147 * ftrace_update_record, set a record that now is tracing or not
2148 * @rec: the record to update 2148 * @rec: the record to update
2149 * @enable: set to 1 if the record is tracing, zero to force disable 2149 * @enable: set to true if the record is tracing, false to force disable
2150 * 2150 *
2151 * The records that represent all functions that can be traced need 2151 * The records that represent all functions that can be traced need
2152 * to be updated when tracing has been enabled. 2152 * to be updated when tracing has been enabled.
2153 */ 2153 */
2154int ftrace_update_record(struct dyn_ftrace *rec, int enable) 2154int ftrace_update_record(struct dyn_ftrace *rec, bool enable)
2155{ 2155{
2156 return ftrace_check_record(rec, enable, 1); 2156 return ftrace_check_record(rec, enable, true);
2157} 2157}
2158 2158
2159/** 2159/**
2160 * ftrace_test_record, check if the record has been enabled or not 2160 * ftrace_test_record, check if the record has been enabled or not
2161 * @rec: the record to test 2161 * @rec: the record to test
2162 * @enable: set to 1 to check if enabled, 0 if it is disabled 2162 * @enable: set to true to check if enabled, false if it is disabled
2163 * 2163 *
2164 * The arch code may need to test if a record is already set to 2164 * The arch code may need to test if a record is already set to
2165 * tracing to determine how to modify the function code that it 2165 * tracing to determine how to modify the function code that it
2166 * represents. 2166 * represents.
2167 */ 2167 */
2168int ftrace_test_record(struct dyn_ftrace *rec, int enable) 2168int ftrace_test_record(struct dyn_ftrace *rec, bool enable)
2169{ 2169{
2170 return ftrace_check_record(rec, enable, 0); 2170 return ftrace_check_record(rec, enable, false);
2171} 2171}
2172 2172
2173static struct ftrace_ops * 2173static struct ftrace_ops *
@@ -2356,7 +2356,7 @@ unsigned long ftrace_get_addr_curr(struct dyn_ftrace *rec)
2356} 2356}
2357 2357
2358static int 2358static int
2359__ftrace_replace_code(struct dyn_ftrace *rec, int enable) 2359__ftrace_replace_code(struct dyn_ftrace *rec, bool enable)
2360{ 2360{
2361 unsigned long ftrace_old_addr; 2361 unsigned long ftrace_old_addr;
2362 unsigned long ftrace_addr; 2362 unsigned long ftrace_addr;
@@ -2395,7 +2395,7 @@ void __weak ftrace_replace_code(int mod_flags)
2395{ 2395{
2396 struct dyn_ftrace *rec; 2396 struct dyn_ftrace *rec;
2397 struct ftrace_page *pg; 2397 struct ftrace_page *pg;
2398 int enable = mod_flags & FTRACE_MODIFY_ENABLE_FL; 2398 bool enable = mod_flags & FTRACE_MODIFY_ENABLE_FL;
2399 int schedulable = mod_flags & FTRACE_MODIFY_MAY_SLEEP_FL; 2399 int schedulable = mod_flags & FTRACE_MODIFY_MAY_SLEEP_FL;
2400 int failed; 2400 int failed;
2401 2401