lkml.org 
[lkml]   [2021]   [Nov]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [RESEND PATCH V3 2/2] riscv: add RISC-V Svpbmt extension supports
Hi Christoph,

Great thanks for your review.

On Tue, Nov 2, 2021 at 2:04 PM Christoph Hellwig <hch@lst.de> wrote:
>
> On Mon, Oct 25, 2021 at 10:49:11PM +0800, Wei Fu wrote:
> > > > + >> _PAGE_PFN_SHIFT);
> > >
> > > > static inline unsigned long _pmd_pfn(pmd_t pmd)
> > > > {
> > > > - return pmd_val(pmd) >> _PAGE_PFN_SHIFT;
> > > > + return (pmd_val(pmd) & _PAGE_CHG_MASK) >> _PAGE_PFN_SHIFT;
> > > > }
> > >
> > > The "(pud_val(pud) & _PAGE_CHG_MASK) >> _PAGE_PFN_SHIFT" expression begs
> > > for readable and well-documented helper.
> >
> > How about these:
> > #define _chg_of_pmd(pmd) (pmd_val(pmd) & _PAGE_CHG_MASK)
> > #define _chg_of_pud(pud) (pud_val(pud) & _PAGE_CHG_MASK)
>
> I'd use inline functions instead of macros if possible, but otherwise
> yes.

Great thanks for your suggestion, I will change this to inline :-)


>
> > How about :
> >
> > extern unsigned long _svpbmt_mask
> > extern unsigned long _svpbmt_mt_pma
> > extern unsigned long _svpbmt_mt_nc
> > extern unsigned long _svpbmt_mt_io
> >
> > #define _PAGE_MT_MASK _svpbmt_mask
> > #define _PAGE_MT_PMA _svpbmt_mt_pma
> > #define _PAGE_MT_NC _svpbmt_mt_nc
> > #define _PAGE_MT_IO _svpbmt_mt_io
>
> Looks much better.
Thanks , will do this way

>

\
 
 \ /
  Last update: 2021-11-07 07:56    [W:0.051 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site