[PATCH v5 07/12] parisc: constify mmap_upper_limit() parameter for improved const-correctness

Max Kellermann posted 12 patches 3 months, 1 week ago
There is a newer version of this series
[PATCH v5 07/12] parisc: constify mmap_upper_limit() parameter for improved const-correctness
Posted by Max Kellermann 3 months, 1 week ago
This piece is necessary to make the `rlim_stack` parameter to
mmap_base() const.

Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
---
 arch/parisc/include/asm/processor.h | 2 +-
 arch/parisc/kernel/sys_parisc.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
index 4c14bde39aac..dd0b5e199559 100644
--- a/arch/parisc/include/asm/processor.h
+++ b/arch/parisc/include/asm/processor.h
@@ -48,7 +48,7 @@
 #ifndef __ASSEMBLER__
 
 struct rlimit;
-unsigned long mmap_upper_limit(struct rlimit *rlim_stack);
+unsigned long mmap_upper_limit(const struct rlimit *rlim_stack);
 unsigned long calc_max_stack_size(unsigned long stack_max);
 
 /*
diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
index f852fe274abe..c2bbaef7e6b7 100644
--- a/arch/parisc/kernel/sys_parisc.c
+++ b/arch/parisc/kernel/sys_parisc.c
@@ -77,7 +77,7 @@ unsigned long calc_max_stack_size(unsigned long stack_max)
  * indicating that "current" should be used instead of a passed-in
  * value from the exec bprm as done with arch_pick_mmap_layout().
  */
-unsigned long mmap_upper_limit(struct rlimit *rlim_stack)
+unsigned long mmap_upper_limit(const struct rlimit *const rlim_stack)
 {
 	unsigned long stack_base;
 
-- 
2.47.2
Re: [PATCH v5 07/12] parisc: constify mmap_upper_limit() parameter for improved const-correctness
Posted by David Hildenbrand 3 months, 1 week ago
On 01.09.25 14:30, Max Kellermann wrote:
> This piece is necessary to make the `rlim_stack` parameter to
> mmap_base() const.
> 
> Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
> Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
> ---
>   arch/parisc/include/asm/processor.h | 2 +-
>   arch/parisc/kernel/sys_parisc.c     | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
> index 4c14bde39aac..dd0b5e199559 100644
> --- a/arch/parisc/include/asm/processor.h
> +++ b/arch/parisc/include/asm/processor.h
> @@ -48,7 +48,7 @@
>   #ifndef __ASSEMBLER__
>   
>   struct rlimit;
> -unsigned long mmap_upper_limit(struct rlimit *rlim_stack);
> +unsigned long mmap_upper_limit(const struct rlimit *rlim_stack);
>   unsigned long calc_max_stack_size(unsigned long stack_max);

*const like in the other case?

-- 
Cheers

David / dhildenb
Re: [PATCH v5 07/12] parisc: constify mmap_upper_limit() parameter for improved const-correctness
Posted by Lorenzo Stoakes 3 months, 1 week ago
On Mon, Sep 01, 2025 at 03:55:00PM +0200, David Hildenbrand wrote:
> On 01.09.25 14:30, Max Kellermann wrote:
> > This piece is necessary to make the `rlim_stack` parameter to
> > mmap_base() const.
> >
> > Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
> > Reviewed-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
> > ---
> >   arch/parisc/include/asm/processor.h | 2 +-
> >   arch/parisc/kernel/sys_parisc.c     | 2 +-
> >   2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/parisc/include/asm/processor.h b/arch/parisc/include/asm/processor.h
> > index 4c14bde39aac..dd0b5e199559 100644
> > --- a/arch/parisc/include/asm/processor.h
> > +++ b/arch/parisc/include/asm/processor.h
> > @@ -48,7 +48,7 @@
> >   #ifndef __ASSEMBLER__
> >   struct rlimit;
> > -unsigned long mmap_upper_limit(struct rlimit *rlim_stack);
> > +unsigned long mmap_upper_limit(const struct rlimit *rlim_stack);
> >   unsigned long calc_max_stack_size(unsigned long stack_max);
>
> *const like in the other case?

Ditto :>)

>
> --
> Cheers
>
> David / dhildenb
>