The variable is only ever used inside the file where it's
defined, therefore it can have static storage. This also
resolves a violation of MISRA C:2012 Rule 8.4 due to the absence
of a declaration prior to the definition.
Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Fixes: 3ba523ff957c ("CPUIDLE: enable MSI capable HPET for timer broadcast")
---
xen/arch/x86/hpet.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index a2df1c7df401..79c07f6a9e09 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -49,7 +49,7 @@ static struct hpet_event_channel *__read_mostly hpet_events;
/* msi hpet channels used for broadcast */
static unsigned int __read_mostly num_hpets_used;
-DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
+static DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel);
unsigned long __initdata hpet_address;
int8_t __initdata opt_hpet_legacy_replacement = -1;
--
2.34.1
On Fri, 11 Aug 2023, Nicola Vetrini wrote: > The variable is only ever used inside the file where it's > defined, therefore it can have static storage. This also > resolves a violation of MISRA C:2012 Rule 8.4 due to the absence > of a declaration prior to the definition. > > Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com> > Fixes: 3ba523ff957c ("CPUIDLE: enable MSI capable HPET for timer broadcast") Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> > --- > xen/arch/x86/hpet.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c > index a2df1c7df401..79c07f6a9e09 100644 > --- a/xen/arch/x86/hpet.c > +++ b/xen/arch/x86/hpet.c > @@ -49,7 +49,7 @@ static struct hpet_event_channel *__read_mostly hpet_events; > /* msi hpet channels used for broadcast */ > static unsigned int __read_mostly num_hpets_used; > > -DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel); > +static DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel); > > unsigned long __initdata hpet_address; > int8_t __initdata opt_hpet_legacy_replacement = -1; > -- > 2.34.1 >
On 12.08.2023 00:54, Stefano Stabellini wrote: > On Fri, 11 Aug 2023, Nicola Vetrini wrote: >> The variable is only ever used inside the file where it's >> defined, therefore it can have static storage. This also >> resolves a violation of MISRA C:2012 Rule 8.4 due to the absence >> of a declaration prior to the definition. >> >> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com> >> Fixes: 3ba523ff957c ("CPUIDLE: enable MSI capable HPET for timer broadcast") > > Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> Acked-by: Jan Beulich <jbeulich@suse.com>
Adding x86 maintainers On Fri, 11 Aug 2023, Stefano Stabellini wrote: > On Fri, 11 Aug 2023, Nicola Vetrini wrote: > > The variable is only ever used inside the file where it's > > defined, therefore it can have static storage. This also > > resolves a violation of MISRA C:2012 Rule 8.4 due to the absence > > of a declaration prior to the definition. > > > > Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com> > > Fixes: 3ba523ff957c ("CPUIDLE: enable MSI capable HPET for timer broadcast") > > Reviewed-by: Stefano Stabellini <sstabellini@kernel.org> > > > > --- > > xen/arch/x86/hpet.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c > > index a2df1c7df401..79c07f6a9e09 100644 > > --- a/xen/arch/x86/hpet.c > > +++ b/xen/arch/x86/hpet.c > > @@ -49,7 +49,7 @@ static struct hpet_event_channel *__read_mostly hpet_events; > > /* msi hpet channels used for broadcast */ > > static unsigned int __read_mostly num_hpets_used; > > > > -DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel); > > +static DEFINE_PER_CPU(struct hpet_event_channel *, cpu_bc_channel); > > > > unsigned long __initdata hpet_address; > > int8_t __initdata opt_hpet_legacy_replacement = -1; > > -- > > 2.34.1 > > >
© 2016 - 2024 Red Hat, Inc.