The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@kernel.org>
To: Mike Rapoport <rppt@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH 3/4] tty: serial: men_z135_uart: replace __get_free_page() with kmalloc()
Date: Fri, 29 May 2026 10:52:49 +0200	[thread overview]
Message-ID: <98ebf7d1-244f-4fbc-afc4-3e8940df5422@kernel.org> (raw)
In-Reply-To: <ahlRqd3e94ojSfWE@kernel.org>

On 29. 05. 26, 10:43, Mike Rapoport wrote:
> On Fri, May 29, 2026 at 09:47:33AM +0200, Jiri Slaby wrote:
>> On 28. 05. 26, 12:24, Mike Rapoport (Microsoft) wrote:
>>> men_z135_probe() allocates a receive staging buffer filled by the
>>> CPU via memcpy_fromio() from the device MMIO region.
>>>
>>> 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_free_page() with kmalloc() and free_page() with
>>> kfree().
>>>
>>> Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com
>>> Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
>>> ---
>>>    drivers/tty/serial/men_z135_uart.c | 7 ++++---
>>>    1 file changed, 4 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/men_z135_uart.c b/drivers/tty/serial/men_z135_uart.c
>>> index 6fad57fee912..9c32b01edc9e 100644
>>> --- a/drivers/tty/serial/men_z135_uart.c
>>> +++ b/drivers/tty/serial/men_z135_uart.c
>>> @@ -17,6 +17,7 @@
>>>    #include <linux/bitops.h>
>>>    #include <linux/mcb.h>
>>> +#include <linux/slab.h>
>>>    #define MEN_Z135_MAX_PORTS		12
>>
>> This one is misplaced.
> 
> Do you mean an empty line is missing? Or there's particular order of
> includes here?

You added it after an empty line -- along to #defines. You should had 
added it along #includes instead -- before the empty line.

>> thanks,
>> -- 
>> js
>> suse labs
> 


-- 
js
suse labs

  reply	other threads:[~2026-05-29  8:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28 10:24 [PATCH 0/4] tty: replace __get_free_pages() with kmalloc() Mike Rapoport (Microsoft)
2026-05-28 10:24 ` [PATCH 1/4] serial: pch: replace __get_free_page() " Mike Rapoport (Microsoft)
2026-05-28 10:24 ` [PATCH 2/4] tty: amiserial: replace get_zeroed_page() with kzalloc() Mike Rapoport (Microsoft)
2026-05-28 10:24 ` [PATCH 3/4] tty: serial: men_z135_uart: replace __get_free_page() with kmalloc() Mike Rapoport (Microsoft)
2026-05-29  7:47   ` Jiri Slaby
2026-05-29  8:43     ` Mike Rapoport
2026-05-29  8:52       ` Jiri Slaby [this message]
2026-07-07 15:22         ` Greg Kroah-Hartman
2026-05-28 10:24 ` [PATCH 4/4] vc_screen: replace __get_free_pages() " Mike Rapoport (Microsoft)
2026-05-29  7:47   ` Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98ebf7d1-244f-4fbc-afc4-3e8940df5422@kernel.org \
    --to=jirislaby@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=rppt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox