Re: [PATCH v2 2/4] tty: amiserial: replace get_zeroed_page() with kzalloc()
Mike Rapoport <[email protected]>
| Newsgroups | gmane.linux.serial,gmane.linux.kernel,gmane.linux.kernel.mm |
|---|---|
| Message-ID | <[email protected]> |
Hi Geert, On Thu, Jul 09, 2026 at 10:03:53AM +0200, Geert Uytterhoeven wrote: > Hi Mike, > > On Sun, 31 May 2026 at 09:04, Mike Rapoport (Microsoft) <[email protected]> wrote: > > rs_startup() allocates a transmit ring buffer that is used to buffer reads > > and writes from/to serial data register. > > > > This buffer can be allocated with kmalloc() as there's nothing special > > about it to go directly to the page allocator. > > > > kmalloc() provides a better API that does not require ugly casts and > > kfree() does not need to know the size of the freed object. > > > > Replace use of get_zeroed_page() with kzalloc() and free_page() with > > kfree(). > > > > Link: https://lore.kernel.org/all/[email protected] > > Signed-off-by: Mike Rapoport (Microsoft) <[email protected]> > > Thanks for your patch, which is now commit d26ed502d0c7c05c ("tty: > amiserial: replace get_zeroed_page() with kzalloc()") in tty/tty-next > > > --- a/drivers/tty/amiserial.c > > +++ b/drivers/tty/amiserial.c > > @@ -443,23 +443,23 @@ static int rs_startup(struct tty_struct *tty, struct serial_state *info) > > struct tty_port *port = &info->tport; > > unsigned long flags; > > int retval=0; > > - unsigned long page; > > + void *buffer; > > "char *", to match the type of info->xmit.buf? Does it really matter that much to respin? ;-) -- Sincerely yours, Mike.