All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [arnd-playground:more-default-warnings 23/47] kernel/trace/trace_osnoise.c:1999:8: warning: 'main' is usually a function
Date: Sat, 11 Nov 2023 12:56:11 +0800	[thread overview]
Message-ID: <202311111234.FEYPmd8T-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git more-default-warnings
head:   b86302da264f77971112b4be0b16eeb591026cbc
commit: 00e0c1d8a43a259e001163ce28c5d5813643eab2 [23/47] [SUBMITTED 20230811] extrawarn: do not disable -Wmain at W=1 level
config: x86_64-randconfig-076-20231111 (https://download.01.org/0day-ci/archive/20231111/202311111234.FEYPmd8T-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231111/202311111234.FEYPmd8T-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202311111234.FEYPmd8T-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/trace/trace_osnoise.c: In function 'start_kthread':
>> kernel/trace/trace_osnoise.c:1999:8: warning: 'main' is usually a function [-Wmain]
     void *main = osnoise_main;
           ^~~~


vim +/main +1999 kernel/trace/trace_osnoise.c

c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  1992  
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  1993  /*
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  1994   * start_kthread - Start a workload tread
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  1995   */
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  1996  static int start_kthread(unsigned int cpu)
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  1997  {
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  1998  	struct task_struct *kthread;
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22 @1999  	void *main = osnoise_main;
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  2000  	char comm[24];
bce29ac9ce0bb0 Daniel Bristot de Oliveira 2021-06-22  2001  
ccb6754495ef25 Daniel Bristot de Oliveira 2021-10-31  2002  	if (timerlat_enabled()) {
a955d7eac1779b Daniel Bristot de Oliveira 2021-06-22  2003  		snprintf(comm, 24, "timerlat/%d", cpu);
a955d7eac1779b Daniel Bristot de Oliveira 2021-06-22  2004  		main = timerlat_main;
a955d7eac1779b Daniel Bristot de Oliveira 2021-06-22  2005  	} else {
30838fcd81078d Daniel Bristot de Oliveira 2022-11-17  2006  		/* if no workload, just return */
30838fcd81078d Daniel Bristot de Oliveira 2022-11-17  2007  		if (!test_bit(OSN_WORKLOAD, &osnoise_options)) {
30838fcd81078d Daniel Bristot de Oliveira 2022-11-17  2008  			per_cpu(per_cpu_osnoise_var, cpu).sampling = true;
30838fcd81078d Daniel Bristot de Oliveira 2022-11-17  2009  			barrier();
30838fcd81078d Daniel Bristot de Oliveira 2022-11-17  2010  			return 0;
30838fcd81078d Daniel Bristot de Oliveira 2022-11-17  2011  		}
bce29ac9ce0bb0 Daniel Bristot de Oliveira 2021-06-22  2012  		snprintf(comm, 24, "osnoise/%d", cpu);
a955d7eac1779b Daniel Bristot de Oliveira 2021-06-22  2013  	}
ccb6754495ef25 Daniel Bristot de Oliveira 2021-10-31  2014  
11e4e3523da98c Cai Huoqing                2022-01-14  2015  	kthread = kthread_run_on_cpu(main, NULL, cpu, comm);
bce29ac9ce0bb0 Daniel Bristot de Oliveira 2021-06-22  2016  
bce29ac9ce0bb0 Daniel Bristot de Oliveira 2021-06-22  2017  	if (IS_ERR(kthread)) {
bce29ac9ce0bb0 Daniel Bristot de Oliveira 2021-06-22  2018  		pr_err(BANNER "could not start sampling thread\n");
bce29ac9ce0bb0 Daniel Bristot de Oliveira 2021-06-22  2019  		stop_per_cpu_kthreads();
bce29ac9ce0bb0 Daniel Bristot de Oliveira 2021-06-22  2020  		return -ENOMEM;
bce29ac9ce0bb0 Daniel Bristot de Oliveira 2021-06-22  2021  	}
bce29ac9ce0bb0 Daniel Bristot de Oliveira 2021-06-22  2022  
bce29ac9ce0bb0 Daniel Bristot de Oliveira 2021-06-22  2023  	per_cpu(per_cpu_osnoise_var, cpu).kthread = kthread;
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  2024  
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  2025  	return 0;
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  2026  }
c8895e271f7994 Daniel Bristot de Oliveira 2021-06-22  2027  

:::::: The code at line 1999 was first introduced by commit
:::::: c8895e271f7994a3ecb13b8a280e39aa53879545 trace/osnoise: Support hotplug operations

:::::: TO: Daniel Bristot de Oliveira <bristot@redhat.com>
:::::: CC: Steven Rostedt (VMware) <rostedt@goodmis.org>

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

                 reply	other threads:[~2023-11-11  4:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202311111234.FEYPmd8T-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@arndb.de \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 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.