Commit 6a24a244cd3a02d5b290293c32fcf2c6e92b4235

Authored by Steven Rostedt
1 parent 73d3fd96e7

ftrace: clean up coding style

Ingo Molnar pointed out some coding style issues with the recent ftrace
updates. This patch cleans them up.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>

Showing 2 changed files with 13 additions and 12 deletions Side-by-side Diff

kernel/trace/ftrace.c
... ... @@ -460,8 +460,8 @@
460 460 static int
461 461 __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
462 462 {
463   - unsigned long ip, fl;
464 463 unsigned long ftrace_addr;
  464 + unsigned long ip, fl;
465 465  
466 466 ftrace_addr = (unsigned long)FTRACE_ADDR;
467 467  
468 468  
... ... @@ -530,9 +530,9 @@
530 530  
531 531 static void ftrace_replace_code(int enable)
532 532 {
533   - int failed;
534 533 struct dyn_ftrace *rec;
535 534 struct ftrace_page *pg;
  535 + int failed;
536 536  
537 537 do_for_each_ftrace_rec(pg, rec) {
538 538 /*
539 539  
540 540  
541 541  
... ... @@ -1208,14 +1208,15 @@
1208 1208  
1209 1209 static void ftrace_match_records(char *buff, int len, int enable)
1210 1210 {
1211   - char *search;
  1211 + unsigned int search_len;
1212 1212 struct ftrace_page *pg;
1213 1213 struct dyn_ftrace *rec;
  1214 + unsigned long flag;
  1215 + char *search;
1214 1216 int type;
1215   - unsigned long flag = enable ? FTRACE_FL_FILTER : FTRACE_FL_NOTRACE;
1216   - unsigned search_len;
1217 1217 int not;
1218 1218  
  1219 + flag = enable ? FTRACE_FL_FILTER : FTRACE_FL_NOTRACE;
1219 1220 type = ftrace_setup_glob(buff, len, &search, &not);
1220 1221  
1221 1222 search_len = strlen(search);
1222 1223  
1223 1224  
... ... @@ -1263,14 +1264,16 @@
1263 1264  
1264 1265 static void ftrace_match_module_records(char *buff, char *mod, int enable)
1265 1266 {
1266   - char *search = buff;
  1267 + unsigned search_len = 0;
1267 1268 struct ftrace_page *pg;
1268 1269 struct dyn_ftrace *rec;
1269 1270 int type = MATCH_FULL;
1270   - unsigned long flag = enable ? FTRACE_FL_FILTER : FTRACE_FL_NOTRACE;
1271   - unsigned search_len = 0;
  1271 + char *search = buff;
  1272 + unsigned long flag;
1272 1273 int not = 0;
1273 1274  
  1275 + flag = enable ? FTRACE_FL_FILTER : FTRACE_FL_NOTRACE;
  1276 +
1274 1277 /* blank or '*' mean the same */
1275 1278 if (strcmp(buff, "*") == 0)
1276 1279 buff[0] = 0;
1277 1280  
... ... @@ -1442,8 +1445,8 @@
1442 1445 struct ftrace_func_hook *entry;
1443 1446 struct ftrace_page *pg;
1444 1447 struct dyn_ftrace *rec;
1445   - unsigned long key;
1446 1448 int type, len, not;
  1449 + unsigned long key;
1447 1450 int count = 0;
1448 1451 char *search;
1449 1452  
1450 1453  
... ... @@ -1623,8 +1626,8 @@
1623 1626  
1624 1627 static int ftrace_process_regex(char *buff, int len, int enable)
1625 1628 {
1626   - struct ftrace_func_command *p;
1627 1629 char *func, *command, *next = buff;
  1630 + struct ftrace_func_command *p;
1628 1631 int ret = -EINVAL;
1629 1632  
1630 1633 func = strsep(&next, ":");
... ... @@ -2392,7 +2395,6 @@
2392 2395 "'set_ftrace_pid' entry\n");
2393 2396 return 0;
2394 2397 }
2395   -
2396 2398 fs_initcall(ftrace_init_debugfs);
2397 2399  
2398 2400 /**
kernel/trace/trace_functions.c
... ... @@ -397,6 +397,5 @@
397 397 init_func_cmd_traceon();
398 398 return register_tracer(&function_trace);
399 399 }
400   -
401 400 device_initcall(init_function_trace);