diff mbox series

MIPS: tlbex: undefine pr_define macro when appropriate

Message ID 20230401061025.3556622-1-lienze@kylinos.cn (mailing list archive)
State Rejected
Headers show
Series MIPS: tlbex: undefine pr_define macro when appropriate | expand

Commit Message

Enze Li April 1, 2023, 6:10 a.m. UTC
The pr_define macro is used only within the output_pgtable_bits_defines
function, and it hasn't been used anywhere else so far.  Therefore, it
should be undefined when appropriate.

Signed-off-by: Enze Li <lienze@kylinos.cn>
---
 arch/mips/mm/tlbex.c | 2 ++
 1 file changed, 2 insertions(+)


base-commit: 7b50567bdcad8925ca1e075feb7171c12015afd1

Comments

Thomas Bogendoerfer April 1, 2023, 7:17 a.m. UTC | #1
On Sat, Apr 01, 2023 at 02:10:25PM +0800, Enze Li wrote:
> The pr_define macro is used only within the output_pgtable_bits_defines
> function, and it hasn't been used anywhere else so far.  Therefore, it
> should be undefined when appropriate.
> 
> Signed-off-by: Enze Li <lienze@kylinos.cn>
> ---
>  arch/mips/mm/tlbex.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
> index 80e05ee98d62..510a7e316eb6 100644
> --- a/arch/mips/mm/tlbex.c
> +++ b/arch/mips/mm/tlbex.c
> @@ -255,6 +255,8 @@ static void output_pgtable_bits_defines(void)
>  	pr_define("_PAGE_DIRTY_SHIFT %d\n", _PAGE_DIRTY_SHIFT);
>  	pr_define("_PFN_SHIFT %d\n", _PFN_SHIFT);
>  	pr_debug("\n");
> +
> +#undef pr_define

I'm probably missing something... what problem are you fixing here ?

Thomas.
Enze Li April 1, 2023, 9:14 a.m. UTC | #2
On Sat, 2023-04-01 at 09:17 +0200, Thomas Bogendoerfer wrote:
> On Sat, Apr 01, 2023 at 02:10:25PM +0800, Enze Li wrote:
> > The pr_define macro is used only within the
> > output_pgtable_bits_defines
> > function, and it hasn't been used anywhere else so far.  Therefore,
> > it
> > should be undefined when appropriate.
> > 
> > Signed-off-by: Enze Li <lienze@kylinos.cn>
> > ---
> >  arch/mips/mm/tlbex.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
> > index 80e05ee98d62..510a7e316eb6 100644
> > --- a/arch/mips/mm/tlbex.c
> > +++ b/arch/mips/mm/tlbex.c
> > @@ -255,6 +255,8 @@ static void output_pgtable_bits_defines(void)
> >         pr_define("_PAGE_DIRTY_SHIFT %d\n", _PAGE_DIRTY_SHIFT);
> >         pr_define("_PFN_SHIFT %d\n", _PFN_SHIFT);
> >         pr_debug("\n");
> > +
> > +#undef pr_define
> 
> I'm probably missing something... what problem are you fixing here ?
> 
> Thomas.
> 

Hi Thomas,

Thanks for your review.  
Thomas Bogendoerfer April 5, 2023, 8:33 a.m. UTC | #3
On Sat, Apr 01, 2023 at 05:14:28PM +0800, Enze Li wrote:
> On Sat, 2023-04-01 at 09:17 +0200, Thomas Bogendoerfer wrote:
> > On Sat, Apr 01, 2023 at 02:10:25PM +0800, Enze Li wrote:
> > > The pr_define macro is used only within the
> > > output_pgtable_bits_defines
> > > function, and it hasn't been used anywhere else so far.  Therefore,
> > > it
> > > should be undefined when appropriate.
> > > 
> > > Signed-off-by: Enze Li <lienze@kylinos.cn>
> > > ---
> > >  arch/mips/mm/tlbex.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
> > > index 80e05ee98d62..510a7e316eb6 100644
> > > --- a/arch/mips/mm/tlbex.c
> > > +++ b/arch/mips/mm/tlbex.c
> > > @@ -255,6 +255,8 @@ static void output_pgtable_bits_defines(void)
> > >         pr_define("_PAGE_DIRTY_SHIFT %d\n", _PAGE_DIRTY_SHIFT);
> > >         pr_define("_PFN_SHIFT %d\n", _PFN_SHIFT);
> > >         pr_debug("\n");
> > > +
> > > +#undef pr_define
> > 
> > I'm probably missing something... what problem are you fixing here ?
> > 
> > Thomas.
> > 
> 
> Hi Thomas,
> 
> Thanks for your review.  
diff mbox series

Patch

diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 80e05ee98d62..510a7e316eb6 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -255,6 +255,8 @@  static void output_pgtable_bits_defines(void)
 	pr_define("_PAGE_DIRTY_SHIFT %d\n", _PAGE_DIRTY_SHIFT);
 	pr_define("_PFN_SHIFT %d\n", _PFN_SHIFT);
 	pr_debug("\n");
+
+#undef pr_define
 }
 
 static inline void dump_handler(const char *symbol, const void *start, const void *end)