linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [linux-next:master 6674/7300] drivers/perf/riscv_pmu_sbi.c:1015:35: error: initialization of 'int (*)(struct ctl_table *, int,  void *, size_t *, loff_t *)' {aka 'int (*)(struct ctl_table *, int,  void *, long unsigned int *, long long int *)'} from incompatible pointer type 'int (*)(...
@ 2023-12-13  7:47 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-13  7:47 UTC (permalink / raw)
  To: Alexandre Ghiti
  Cc: oe-kbuild-all, Linux Memory Management List, Palmer Dabbelt

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   48e8992e33abf054bcc0bb2e77b2d43bb899212e
commit: 0bd6bc435f7db3e22acb410b721e97a97463c51c [6674/7300] drivers: perf: Fix build error by adding const to ctl_table argument of handler
config: riscv-defconfig (https://download.01.org/0day-ci/archive/20231213/202312131509.n6cZrTLi-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231213/202312131509.n6cZrTLi-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/202312131509.n6cZrTLi-lkp@intel.com/

Note: the linux-next/master HEAD 48e8992e33abf054bcc0bb2e77b2d43bb899212e builds fine.
      It may have been fixed somewhere.

All errors (new ones prefixed by >>):

   drivers/perf/riscv_pmu_sbi.c: In function 'riscv_pmu_proc_user_access_handler':
   drivers/perf/riscv_pmu_sbi.c:994:40: warning: passing argument 1 of 'proc_dointvec_minmax' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     994 |         int ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
         |                                        ^~~~~
   In file included from include/linux/key.h:17,
                    from include/linux/cred.h:13,
                    from include/linux/sched/signal.h:10,
                    from include/linux/rcuwait.h:6,
                    from include/linux/percpu-rwsem.h:7,
                    from include/linux/fs.h:33,
                    from include/linux/perf_event.h:49,
                    from include/linux/perf/riscv_pmu.h:12,
                    from drivers/perf/riscv_pmu_sbi.c:14:
   include/linux/sysctl.h:72:26: note: expected 'struct ctl_table *' but argument is of type 'const struct ctl_table *'
      72 | int proc_dointvec_minmax(struct ctl_table *, int, void *, size_t *, loff_t *);
         |                          ^~~~~~~~~~~~~~~~~~
   drivers/perf/riscv_pmu_sbi.c: At top level:
>> drivers/perf/riscv_pmu_sbi.c:1015:35: error: initialization of 'int (*)(struct ctl_table *, int,  void *, size_t *, loff_t *)' {aka 'int (*)(struct ctl_table *, int,  void *, long unsigned int *, long long int *)'} from incompatible pointer type 'int (*)(const struct ctl_table *, int,  void *, size_t *, loff_t *)' {aka 'int (*)(const struct ctl_table *, int,  void *, long unsigned int *, long long int *)'} [-Werror=incompatible-pointer-types]
    1015 |                 .proc_handler   = riscv_pmu_proc_user_access_handler,
         |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/perf/riscv_pmu_sbi.c:1015:35: note: (near initialization for 'sbi_pmu_sysctl_table[0].proc_handler')
   cc1: some warnings being treated as errors


vim +1015 drivers/perf/riscv_pmu_sbi.c

cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1008  
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1009  static struct ctl_table sbi_pmu_sysctl_table[] = {
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1010  	{
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1011  		.procname       = "perf_user_access",
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1012  		.data		= &sysctl_perf_user_access,
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1013  		.maxlen		= sizeof(unsigned int),
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1014  		.mode           = 0644,
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 @1015  		.proc_handler	= riscv_pmu_proc_user_access_handler,
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1016  		.extra1		= SYSCTL_ZERO,
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1017  		.extra2		= SYSCTL_TWO,
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1018  	},
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1019  	{ }
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1020  };
cc4c07c89aada1 Alexandre Ghiti 2023-08-02  1021  

:::::: The code at line 1015 was first introduced by commit
:::::: cc4c07c89aada16229084eeb93895c95b7eabaa3 drivers: perf: Implement perf event mmap support in the SBI backend

:::::: TO: Alexandre Ghiti <alexghiti@rivosinc.com>
:::::: CC: Palmer Dabbelt <palmer@rivosinc.com>

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


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

only message in thread, other threads:[~2023-12-13  7:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-13  7:47 [linux-next:master 6674/7300] drivers/perf/riscv_pmu_sbi.c:1015:35: error: initialization of 'int (*)(struct ctl_table *, int, void *, size_t *, loff_t *)' {aka 'int (*)(struct ctl_table *, int, void *, long unsigned int *, long long int *)'} from incompatible pointer type 'int (*)( kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox