diff mbox series

[-next] drivers: perf: Fix build error by adding const to ctl_table argument of handler

Message ID 20231207083512.51792-1-alexghiti@rivosinc.com (mailing list archive)
State New
Headers show
Series [-next] drivers: perf: Fix build error by adding const to ctl_table argument of handler | expand

Commit Message

Alexandre Ghiti Dec. 7, 2023, 8:35 a.m. UTC
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(-)

Comments

Björn Töpel Dec. 12, 2023, 3:11 p.m. UTC | #1
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>
Conor Dooley Dec. 12, 2023, 3:21 p.m. UTC | #2
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.
Palmer Dabbelt Dec. 12, 2023, 9:04 p.m. UTC | #3
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>
Luis Chamberlain Dec. 13, 2023, 6:28 a.m. UTC | #4
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
diff mbox series

Patch

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)
 {