* [linux-next:master 5063/5273] drivers/perf/riscv_pmu_sbi.c:1008:19: error: incompatible function pointer types initializing 'proc_handler *' (aka 'int (*)(const struct ctl_table *, int, void *, unsigned long *, long long *)') with an expression of type 'int (struct ctl_table *, int, v...
@ 2023-12-06 14:11 kernel test robot
2023-12-07 8:35 ` [PATCH -next] drivers: perf: Fix build error by adding const to ctl_table argument of handler Alexandre Ghiti
0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2023-12-06 14:11 UTC (permalink / raw)
To: Thomas Weißschuh
Cc: llvm, oe-kbuild-all, Linux Memory Management List, Luis Chamberlain
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 577a4ee0b96fb043c9cf4a533c550ff587e526cf
commit: c8be9e66ca1eb71c694537e20d00533db48650a9 [5063/5273] sysctl: treewide: constify the ctl_table argument of handlers
config: riscv-randconfig-001-20231206 (https://download.01.org/0day-ci/archive/20231206/202312062242.RFPPozG9-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231206/202312062242.RFPPozG9-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/202312062242.RFPPozG9-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/perf/riscv_pmu_sbi.c:1008:19: error: incompatible function pointer types initializing 'proc_handler *' (aka 'int (*)(const struct ctl_table *, int, void *, unsigned long *, long long *)') with an expression of type 'int (struct ctl_table *, int, void *, size_t *, loff_t *)' (aka 'int (struct ctl_table *, int, void *, unsigned long *, long long *)') [-Wincompatible-function-pointer-types]
1008 | .proc_handler = riscv_pmu_proc_user_access_handler,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
vim +1008 drivers/perf/riscv_pmu_sbi.c
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1001
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1002 static struct ctl_table sbi_pmu_sysctl_table[] = {
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1003 {
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1004 .procname = "perf_user_access",
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1005 .data = &sysctl_perf_user_access,
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1006 .maxlen = sizeof(unsigned int),
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1007 .mode = 0644,
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 @1008 .proc_handler = riscv_pmu_proc_user_access_handler,
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1009 .extra1 = SYSCTL_ZERO,
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1010 .extra2 = SYSCTL_TWO,
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1011 },
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1012 { }
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1013 };
cc4c07c89aada1 Alexandre Ghiti 2023-08-02 1014
:::::: The code at line 1008 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] 6+ messages in thread
* [PATCH -next] drivers: perf: Fix build error by adding const to ctl_table argument of handler
2023-12-06 14:11 [linux-next:master 5063/5273] drivers/perf/riscv_pmu_sbi.c:1008:19: error: incompatible function pointer types initializing 'proc_handler *' (aka 'int (*)(const struct ctl_table *, int, void *, unsigned long *, long long *)') with an expression of type 'int (struct ctl_table *, int, v kernel test robot
@ 2023-12-07 8:35 ` Alexandre Ghiti
2023-12-12 15:11 ` Björn Töpel
2023-12-12 21:04 ` Palmer Dabbelt
0 siblings, 2 replies; 6+ messages in thread
From: Alexandre Ghiti @ 2023-12-07 8:35 UTC (permalink / raw)
To: lkp, linux-mm, linux, llvm, mcgrof, oe-kbuild-all; +Cc: Alexandre Ghiti
The ctl_table argument of the proc_handler field was constified treewide
but somehow missed the occurrence in the riscv pmu sbi driver, so add the
const to fix the build error.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202312062242.RFPPozG9-lkp@intel.com/
Fixes: c8be9e66ca1e ("sysctl: treewide: constify the ctl_table argument of handlers")
Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
---
drivers/perf/riscv_pmu_sbi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
index 16acd4dcdb96..97e345f7d25d 100644
--- a/drivers/perf/riscv_pmu_sbi.c
+++ b/drivers/perf/riscv_pmu_sbi.c
@@ -986,7 +986,7 @@ static void riscv_pmu_update_counter_access(void *info)
csr_write(CSR_SCOUNTEREN, 0x2);
}
-static int riscv_pmu_proc_user_access_handler(struct ctl_table *table,
+static int riscv_pmu_proc_user_access_handler(const struct ctl_table *table,
int write, void *buffer,
size_t *lenp, loff_t *ppos)
{
--
2.39.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] drivers: perf: Fix build error by adding const to ctl_table argument of handler
2023-12-07 8:35 ` [PATCH -next] drivers: perf: Fix build error by adding const to ctl_table argument of handler Alexandre Ghiti
@ 2023-12-12 15:11 ` Björn Töpel
2023-12-12 15:21 ` Conor Dooley
2023-12-12 21:04 ` Palmer Dabbelt
1 sibling, 1 reply; 6+ messages in thread
From: Björn Töpel @ 2023-12-12 15:11 UTC (permalink / raw)
To: Alexandre Ghiti, lkp, linux-mm, linux, llvm, mcgrof,
oe-kbuild-all, linux-riscv
Cc: Alexandre Ghiti
Alexandre Ghiti <alexghiti@rivosinc.com> writes:
> The ctl_table argument of the proc_handler field was constified treewide
> but somehow missed the occurrence in the riscv pmu sbi driver, so add the
> const to fix the build error.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202312062242.RFPPozG9-lkp@intel.com/
> Fixes: c8be9e66ca1e ("sysctl: treewide: constify the ctl_table argument of handlers")
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
> drivers/perf/riscv_pmu_sbi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
> index 16acd4dcdb96..97e345f7d25d 100644
> --- a/drivers/perf/riscv_pmu_sbi.c
> +++ b/drivers/perf/riscv_pmu_sbi.c
> @@ -986,7 +986,7 @@ static void riscv_pmu_update_counter_access(void *info)
> csr_write(CSR_SCOUNTEREN, 0x2);
> }
>
> -static int riscv_pmu_proc_user_access_handler(struct ctl_table *table,
> +static int riscv_pmu_proc_user_access_handler(const struct ctl_table *table,
> int write, void *buffer,
> size_t *lenp, loff_t *ppos)
Adding linux-riscv.
Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] drivers: perf: Fix build error by adding const to ctl_table argument of handler
2023-12-12 15:11 ` Björn Töpel
@ 2023-12-12 15:21 ` Conor Dooley
0 siblings, 0 replies; 6+ messages in thread
From: Conor Dooley @ 2023-12-12 15:21 UTC (permalink / raw)
To: Björn Töpel
Cc: Alexandre Ghiti, lkp, linux-mm, linux, llvm, mcgrof,
oe-kbuild-all, linux-riscv
[-- Attachment #1: Type: text/plain, Size: 1711 bytes --]
On Tue, Dec 12, 2023 at 04:11:55PM +0100, Björn Töpel wrote:
> Alexandre Ghiti <alexghiti@rivosinc.com> writes:
>
> > The ctl_table argument of the proc_handler field was constified treewide
> > but somehow missed the occurrence in the riscv pmu sbi driver, so add the
> > const to fix the build error.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202312062242.RFPPozG9-lkp@intel.com/
> > Fixes: c8be9e66ca1e ("sysctl: treewide: constify the ctl_table argument of handlers")
> > Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> > ---
> > drivers/perf/riscv_pmu_sbi.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
> > index 16acd4dcdb96..97e345f7d25d 100644
> > --- a/drivers/perf/riscv_pmu_sbi.c
> > +++ b/drivers/perf/riscv_pmu_sbi.c
> > @@ -986,7 +986,7 @@ static void riscv_pmu_update_counter_access(void *info)
> > csr_write(CSR_SCOUNTEREN, 0x2);
> > }
> >
> > -static int riscv_pmu_proc_user_access_handler(struct ctl_table *table,
> > +static int riscv_pmu_proc_user_access_handler(const struct ctl_table *table,
> > int write, void *buffer,
> > size_t *lenp, loff_t *ppos)
>
> Adding linux-riscv.
>
> Reviewed-by: Björn Töpel <bjorn@rivosinc.com>
There's already a patch for this:
https://lore.kernel.org/linux-riscv/20231206084642.802053-1-m.szyprowski@samsung.com/
The maintainer of the tree with the broken patch (Luis) has not deigned to
pick it up yet unfortunately. It can't go into Palmer's tree cos it will
break the build if applied there.
Cheers,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] drivers: perf: Fix build error by adding const to ctl_table argument of handler
2023-12-07 8:35 ` [PATCH -next] drivers: perf: Fix build error by adding const to ctl_table argument of handler Alexandre Ghiti
2023-12-12 15:11 ` Björn Töpel
@ 2023-12-12 21:04 ` Palmer Dabbelt
2023-12-13 6:28 ` Luis Chamberlain
1 sibling, 1 reply; 6+ messages in thread
From: Palmer Dabbelt @ 2023-12-12 21:04 UTC (permalink / raw)
To: alexghiti; +Cc: lkp, linux-mm, linux, llvm, mcgrof, oe-kbuild-all, alexghiti
On Thu, 07 Dec 2023 00:35:12 PST (-0800), alexghiti@rivosinc.com wrote:
> The ctl_table argument of the proc_handler field was constified treewide
> but somehow missed the occurrence in the riscv pmu sbi driver, so add the
> const to fix the build error.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202312062242.RFPPozG9-lkp@intel.com/
> Fixes: c8be9e66ca1e ("sysctl: treewide: constify the ctl_table argument of handlers")
> Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> ---
> drivers/perf/riscv_pmu_sbi.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
> index 16acd4dcdb96..97e345f7d25d 100644
> --- a/drivers/perf/riscv_pmu_sbi.c
> +++ b/drivers/perf/riscv_pmu_sbi.c
> @@ -986,7 +986,7 @@ static void riscv_pmu_update_counter_access(void *info)
> csr_write(CSR_SCOUNTEREN, 0x2);
> }
>
> -static int riscv_pmu_proc_user_access_handler(struct ctl_table *table,
> +static int riscv_pmu_proc_user_access_handler(const struct ctl_table *table,
> int write, void *buffer,
> size_t *lenp, loff_t *ppos)
> {
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH -next] drivers: perf: Fix build error by adding const to ctl_table argument of handler
2023-12-12 21:04 ` Palmer Dabbelt
@ 2023-12-13 6:28 ` Luis Chamberlain
0 siblings, 0 replies; 6+ messages in thread
From: Luis Chamberlain @ 2023-12-13 6:28 UTC (permalink / raw)
To: Palmer Dabbelt, Thomas Weißschuh
Cc: alexghiti, lkp, linux-mm, linux, llvm, oe-kbuild-all
On Tue, Dec 12, 2023 at 01:04:41PM -0800, Palmer Dabbelt wrote:
> On Thu, 07 Dec 2023 00:35:12 PST (-0800), alexghiti@rivosinc.com wrote:
> > The ctl_table argument of the proc_handler field was constified treewide
> > but somehow missed the occurrence in the riscv pmu sbi driver, so add the
> > const to fix the build error.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202312062242.RFPPozG9-lkp@intel.com/
> > Fixes: c8be9e66ca1e ("sysctl: treewide: constify the ctl_table argument of handlers")
> > Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
> > ---
> > drivers/perf/riscv_pmu_sbi.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/perf/riscv_pmu_sbi.c b/drivers/perf/riscv_pmu_sbi.c
> > index 16acd4dcdb96..97e345f7d25d 100644
> > --- a/drivers/perf/riscv_pmu_sbi.c
> > +++ b/drivers/perf/riscv_pmu_sbi.c
> > @@ -986,7 +986,7 @@ static void riscv_pmu_update_counter_access(void *info)
> > csr_write(CSR_SCOUNTEREN, 0x2);
> > }
> >
> > -static int riscv_pmu_proc_user_access_handler(struct ctl_table *table,
> > +static int riscv_pmu_proc_user_access_handler(const struct ctl_table *table,
> > int write, void *buffer,
> > size_t *lenp, loff_t *ppos)
> > {
>
> Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
Same here, Thomas please fold into your series as you are working on a
new series.
Luis
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-12-13 6:28 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-06 14:11 [linux-next:master 5063/5273] drivers/perf/riscv_pmu_sbi.c:1008:19: error: incompatible function pointer types initializing 'proc_handler *' (aka 'int (*)(const struct ctl_table *, int, void *, unsigned long *, long long *)') with an expression of type 'int (struct ctl_table *, int, v kernel test robot
2023-12-07 8:35 ` [PATCH -next] drivers: perf: Fix build error by adding const to ctl_table argument of handler Alexandre Ghiti
2023-12-12 15:11 ` Björn Töpel
2023-12-12 15:21 ` Conor Dooley
2023-12-12 21:04 ` Palmer Dabbelt
2023-12-13 6:28 ` Luis Chamberlain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox