[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANiq72miwcM8Jt1pFeCKs=rstbSB70wyPGPSiC7Mgf3f=Z44Lg@mail.gmail.com>
Date: Tue, 28 May 2019 21:03:41 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Souptick Joarder <jrdr.linux@...il.com>
Cc: Robin van der Gracht <robin@...tonic.nl>,
linux-kernel <linux-kernel@...r.kernel.org>,
Matthew Wilcox <willy@...radead.org>
Subject: Re: [PATCH 2/2] auxdisplay/ht16k33.c: Convert to use vm_map_pages_zero()
On Fri, May 24, 2019 at 8:07 AM Souptick Joarder <jrdr.linux@...il.com> wrote:
>
> > > Taking a quick look now, by the way, why does vm_map_pages_zero() (and
> > > __vm_map_pages() etc.) get a pointer to an array instead of a pointer
> > > to the first element?
>
> For this particular driver, one page is getting mapped into vma. But
> there are other
> places where a entire page array ( with more than one pages) mapped into
> vma. That's the reason to pass pointer to an array and do rest of the operations
> inside __vm_map_pages().
Ah, "pointer to array of source kernel pages" made me think the actual
`struct page`s were the ones consecutive in memory, not the pointers.
Maybe "array of page pointers" is more clear.
> > Also, in __vm_map_pages(), semantically w.r.t. to the comment,
> > shouldn't the first check test for equality too? (i.e. for vm_pgoff ==
> > num)? (even if such case fails in the second test anyway).
>
> Sorry, didn't get it. Do you mean there should be a separate check for
> *vm_pgoff == num* ?
No, that the first check should be widened. I will send a patch.
Cheers,
Miguel
Powered by blists - more mailing lists