lkml.org 
[lkml]   [2019]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] b/arch/x86/mm/pti.c - make local symbols static
On Tue, 12 Mar 2019, Dave Hansen wrote:

> > Make both variables static.
>
> "pti_set_kernel_image_nonglobal(void)" is an awfully funny looking
> variable. ;)
>
> > Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
> >
> > ---
> > diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c
> > index 4fee5c3003ed..139b28a01ce4 100644
> > --- a/arch/x86/mm/pti.c
> > +++ b/arch/x86/mm/pti.c
> > @@ -77,7 +77,7 @@ static void __init pti_print_if_secure(const char *reason)
> > pr_info("%s\n", reason);
> > }
> >
> > -enum pti_mode {
> > +static enum pti_mode {
>
> I'm struggling to figure out why we would want to do this. If there's a
> really good reason, I think we probably need to do it en masse:

Because its:

enum pti_mode {
....
} pti_mode;

So that's both enum and variable declaration.

> $ grep -r '^enum.{' arch/x86/ | wc -l
> 48

In the other cases it's a enum declaration without declaring a variable at
the same time. Making them static would be obviously bogus.

Thanks,

tglx



\
 
 \ /
  Last update: 2019-03-21 15:33    [W:0.065 / U:8.412 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site