[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200129124352.GP14879@hirez.programming.kicks-ass.net>
Date: Wed, 29 Jan 2020 13:43:52 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Will Deacon <will@...nel.org>
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-m68k@...ts.linux-m68k.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/5] m68k,mm: Extend table allocator for multiple sizes
On Wed, Jan 29, 2020 at 12:17:53PM +0000, Will Deacon wrote:
> On Wed, Jan 29, 2020 at 11:39:45AM +0100, Peter Zijlstra wrote:
> > +extern void *get_pointer_table(int type);
>
> Could be prettier/obfuscated with an enum type?
Definitely, but then we get to bike-shed on names :-)
enum m68k_table_type {
TABLE_BIG = 0,
TABLE_SMALL,
};
Is not exactly _that_ much better, and while TABLE_PTE works,
TABLE_PGD_PMD is a bit crap.
> > --- a/arch/m68k/mm/memory.c
> > +++ b/arch/m68k/mm/memory.c
> > -pmd_t *get_pointer_table (void)
> > +void *get_pointer_table (int type)
> > {
> > - ptable_desc *dp = ptable_list.next;
> > - unsigned char mask = PD_MARKBITS (dp);
> > - unsigned char tmp;
> > - unsigned int off;
> > + ptable_desc *dp = ptable_list[type].next;
> > + unsigned int mask, tmp, off;
>
> nit, but if you do:
>
> unsigned int mask = list_empty(&ptable_list[type]) ? 0 : PD_MARKBITS(dp);
>
> then you can leave the existing mask logic as-is.
Indeed!
Powered by blists - more mailing lists