[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 (*)(...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx/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@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312131509.n6cZrTLi-lkp@xxxxxxxxx/

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@xxxxxxxxxxxx>
:::::: CC: Palmer Dabbelt <palmer@xxxxxxxxxxxx>

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux