All of lore.kernel.org
 help / color / mirror / Atom feed
* [jolsa-perf:bpf/tracing_multi_1 25/27] kernel/trace/ftrace.c:5595:22: warning: variable 'err' set but not used
@ 2023-01-19  4:45 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-01-19  4:45 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git bpf/tracing_multi_1
head:   747784185d106a06b429736196d8817cb2d12a6f
commit: 553555d3ff275b63f8edf8a7b20861d4a01c8918 [25/27] ftrace: Add add_direct_functions_hash function
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20230119/202301191214.ACiV9GxE-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git/commit/?id=553555d3ff275b63f8edf8a7b20861d4a01c8918
        git remote add jolsa-perf https://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
        git fetch --no-tags jolsa-perf bpf/tracing_multi_1
        git checkout 553555d3ff275b63f8edf8a7b20861d4a01c8918
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 O=build_dir ARCH=x86_64 olddefconfig
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   kernel/trace/ftrace.c:299:5: warning: no previous prototype for '__register_ftrace_function' [-Wmissing-prototypes]
     299 | int __register_ftrace_function(struct ftrace_ops *ops)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/trace/ftrace.c:342:5: warning: no previous prototype for '__unregister_ftrace_function' [-Wmissing-prototypes]
     342 | int __unregister_ftrace_function(struct ftrace_ops *ops)
         |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/trace/ftrace.c:4009:15: warning: no previous prototype for 'arch_ftrace_match_adjust' [-Wmissing-prototypes]
    4009 | char * __weak arch_ftrace_match_adjust(char *str, const char *search)
         |               ^~~~~~~~~~~~~~~~~~~~~~~~
   kernel/trace/ftrace.c: In function 'add_direct_functions_hash':
>> kernel/trace/ftrace.c:5595:22: warning: variable 'err' set but not used [-Wunused-but-set-variable]
    5595 |         int size, i, err;
         |                      ^~~


vim +/err +5595 kernel/trace/ftrace.c

  5590	
  5591	static int add_direct_functions_hash(struct ftrace_hash *hash, unsigned long addr,
  5592					     struct ftrace_hash **free_hash)
  5593	{
  5594		struct ftrace_func_entry *entry, *new;
> 5595		int size, i, err;
  5596	
  5597		/* Make sure requested entries are not already registered.. */
  5598		size = 1 << hash->size_bits;
  5599		for (i = 0; i < size; i++) {
  5600			hlist_for_each_entry(entry, &hash->buckets[i], hlist) {
  5601				if (ftrace_find_rec_direct(entry->ip))
  5602				return -EINVAL;
  5603			}
  5604		}
  5605	
  5606		/* ... and insert them to direct_functions hash. */
  5607		err = -ENOMEM;
  5608		for (i = 0; i < size; i++) {
  5609			hlist_for_each_entry(entry, &hash->buckets[i], hlist) {
  5610				new = ftrace_add_rec_direct(entry->ip, addr, free_hash);
  5611				if (!new)
  5612					return -ENOMEM;
  5613				entry->direct = addr;
  5614			}
  5615		}
  5616		return 0;
  5617	}
  5618	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-19  4:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19  4:45 [jolsa-perf:bpf/tracing_multi_1 25/27] kernel/trace/ftrace.c:5595:22: warning: variable 'err' set but not used kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.