diff mbox series

[05/16] include: sbi: Make hartmask pointer as const in sbi_hartmask_test_hart()

Message ID 20200925112914.725846-6-anup.patel@wdc.com
State Superseded
Headers show
Series OpenSBI domain support | expand

Commit Message

Anup Patel Sept. 25, 2020, 11:29 a.m. UTC
The sbi_hartmask_test_hart() does not modify hartmask so the
hartmask pointer parameter should be declared const.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
---
 include/sbi/sbi_hartmask.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Atish Patra Oct. 2, 2020, 3:25 a.m. UTC | #1
On Fri, Sep 25, 2020 at 4:30 AM Anup Patel <anup.patel@wdc.com> wrote:
>
> The sbi_hartmask_test_hart() does not modify hartmask so the
> hartmask pointer parameter should be declared const.
>
> Signed-off-by: Anup Patel <anup.patel@wdc.com>
> ---
>  include/sbi/sbi_hartmask.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/sbi/sbi_hartmask.h b/include/sbi/sbi_hartmask.h
> index 77e42cb..f1cef0c 100644
> --- a/include/sbi/sbi_hartmask.h
> +++ b/include/sbi/sbi_hartmask.h
> @@ -67,7 +67,7 @@ static inline void sbi_hartmask_clear_hart(u32 h, struct sbi_hartmask *m)
>   * @param h HART id to test
>   * @param m the hartmask pointer
>   */
> -static inline int sbi_hartmask_test_hart(u32 h, struct sbi_hartmask *m)
> +static inline int sbi_hartmask_test_hart(u32 h, const struct sbi_hartmask *m)
>  {
>         if (h < SBI_HARTMASK_MAX_BITS)
>                 return __test_bit(h, m->bits);
> --
> 2.25.1
>
>
> --
> opensbi mailing list
> opensbi@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi


Reviewed-by: Atish Patra <atish.patra@wdc.com>
Sean Anderson Oct. 2, 2020, 4:07 p.m. UTC | #2
On 9/25/20 7:29 AM, Anup Patel wrote:
> [PATCH 05/16] include: sbi: Make hartmask pointer as const in sbi_hartmask_test_hart()

Nit: "Mark ... as const"? Alternatively, "Make ... const"?

--Sean
Anup Patel Oct. 3, 2020, 2:50 p.m. UTC | #3
> -----Original Message-----
> From: Sean Anderson <seanga2@gmail.com>
> Sent: 02 October 2020 21:37
> To: Anup Patel <Anup.Patel@wdc.com>; Atish Patra
> <Atish.Patra@wdc.com>; Alistair Francis <Alistair.Francis@wdc.com>
> Cc: Anup Patel <anup@brainfault.org>; opensbi@lists.infradead.org
> Subject: Re: [PATCH 05/16] include: sbi: Make hartmask pointer as const in
> sbi_hartmask_test_hart()
> 
> On 9/25/20 7:29 AM, Anup Patel wrote:
> > [PATCH 05/16] include: sbi: Make hartmask pointer as const in
> sbi_hartmask_test_hart()
> 
> Nit: "Mark ... as const"? Alternatively, "Make ... const"?

Okay, I will update patch subject to "Mark hartmask pointer as const ..."

Regards,
Anup
diff mbox series

Patch

diff --git a/include/sbi/sbi_hartmask.h b/include/sbi/sbi_hartmask.h
index 77e42cb..f1cef0c 100644
--- a/include/sbi/sbi_hartmask.h
+++ b/include/sbi/sbi_hartmask.h
@@ -67,7 +67,7 @@  static inline void sbi_hartmask_clear_hart(u32 h, struct sbi_hartmask *m)
  * @param h HART id to test
  * @param m the hartmask pointer
  */
-static inline int sbi_hartmask_test_hart(u32 h, struct sbi_hartmask *m)
+static inline int sbi_hartmask_test_hart(u32 h, const struct sbi_hartmask *m)
 {
 	if (h < SBI_HARTMASK_MAX_BITS)
 		return __test_bit(h, m->bits);