2020-01-22 17:06:36

by Madhuparna Bhowmik

[permalink] [raw]
Subject: [PATCH] module.h: Annotate mod_kallsyms with __rcu

From: Madhuparna Bhowmik <[email protected]>

This patch fixes the following sparse errors:

kernel/module.c:3623:9: error: incompatible types in comparison expression
kernel/module.c:4060:41: error: incompatible types in comparison expression
kernel/module.c:4203:28: error: incompatible types in comparison expression
kernel/module.c:4225:41: error: incompatible types in comparison expression

Signed-off-by: Madhuparna Bhowmik <[email protected]>
---
include/linux/module.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index bd165ba68617..dfdc8863e26a 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -429,7 +429,7 @@ struct module {

#ifdef CONFIG_KALLSYMS
/* Protected by RCU and/or module_mutex: use rcu_dereference() */
- struct mod_kallsyms *kallsyms;
+ struct mod_kallsyms __rcu *kallsyms;
struct mod_kallsyms core_kallsyms;

/* Section attributes */
--
2.17.1


2020-01-23 17:24:43

by Jessica Yu

[permalink] [raw]
Subject: Re: [PATCH] module.h: Annotate mod_kallsyms with __rcu

+++ [email protected] [22/01/20 22:34 +0530]:
>From: Madhuparna Bhowmik <[email protected]>
>
>This patch fixes the following sparse errors:
>
>kernel/module.c:3623:9: error: incompatible types in comparison expression
>kernel/module.c:4060:41: error: incompatible types in comparison expression
>kernel/module.c:4203:28: error: incompatible types in comparison expression
>kernel/module.c:4225:41: error: incompatible types in comparison expression
>
>Signed-off-by: Madhuparna Bhowmik <[email protected]>

Hi Madhuparna,

Thanks, I can confirm this patch fixes the sparse warnings. I've
applied it to modules-next.

Jessica

>---
> include/linux/module.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/include/linux/module.h b/include/linux/module.h
>index bd165ba68617..dfdc8863e26a 100644
>--- a/include/linux/module.h
>+++ b/include/linux/module.h
>@@ -429,7 +429,7 @@ struct module {
>
> #ifdef CONFIG_KALLSYMS
> /* Protected by RCU and/or module_mutex: use rcu_dereference() */
>- struct mod_kallsyms *kallsyms;
>+ struct mod_kallsyms __rcu *kallsyms;
> struct mod_kallsyms core_kallsyms;
>
> /* Section attributes */
>--
>2.17.1
>

2020-01-24 04:37:33

by Madhuparna Bhowmik

[permalink] [raw]
Subject: Re: [PATCH] module.h: Annotate mod_kallsyms with __rcu

On Thu, Jan 23, 2020 at 06:22:58PM +0100, Jessica Yu wrote:
> +++ [email protected] [22/01/20 22:34 +0530]:
> > From: Madhuparna Bhowmik <[email protected]>
> >
> > This patch fixes the following sparse errors:
> >
> > kernel/module.c:3623:9: error: incompatible types in comparison expression
> > kernel/module.c:4060:41: error: incompatible types in comparison expression
> > kernel/module.c:4203:28: error: incompatible types in comparison expression
> > kernel/module.c:4225:41: error: incompatible types in comparison expression
> >
> > Signed-off-by: Madhuparna Bhowmik <[email protected]>
>
> Hi Madhuparna,
>
> Thanks, I can confirm this patch fixes the sparse warnings. I've
> applied it to modules-next.
>
Thank you Jessica.

Regards,
Madhuparna

> Jessica
>
> > ---
> > include/linux/module.h | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/module.h b/include/linux/module.h
> > index bd165ba68617..dfdc8863e26a 100644
> > --- a/include/linux/module.h
> > +++ b/include/linux/module.h
> > @@ -429,7 +429,7 @@ struct module {
> >
> > #ifdef CONFIG_KALLSYMS
> > /* Protected by RCU and/or module_mutex: use rcu_dereference() */
> > - struct mod_kallsyms *kallsyms;
> > + struct mod_kallsyms __rcu *kallsyms;
> > struct mod_kallsyms core_kallsyms;
> >
> > /* Section attributes */
> > --
> > 2.17.1
> >