[PATCH] serial: 8250_ni: use kzalloc_obj() for allocation

Pete Connor posted 1 patch 1 month, 2 weeks ago
drivers/tty/serial/8250/8250_ni.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] serial: 8250_ni: use kzalloc_obj() for allocation
Posted by Pete Connor 1 month, 2 weeks ago
  Replace kzalloc() with the preferred kzalloc_obj() helper
  to address a checkpatch warning.

  Signed-off-by: Pete Connor <pete.connor@pythcoiner.dev>
---
 drivers/tty/serial/8250/8250_ni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_ni.c b/drivers/tty/serial/8250/8250_ni.c
index cb5b42b3609c..3f3dac694e20 100644
--- a/drivers/tty/serial/8250/8250_ni.c
+++ b/drivers/tty/serial/8250/8250_ni.c
@@ -285,7 +285,7 @@ static int ni16550_probe(struct platform_device *pdev)
 	bool rs232_property;
 	int ret;
 
-	uart = kzalloc(sizeof(*uart), GFP_KERNEL);
+	uart = kzalloc_obj(*uart, GFP_KERNEL);
 	if (!uart)
 		return -ENOMEM;
 
-- 
2.47.3
Re: [PATCH] serial: 8250_ni: use kzalloc_obj() for allocation
Posted by Greg Kroah-Hartman 3 weeks ago
On Mon, Feb 16, 2026 at 10:19:13PM -0500, Pete Connor wrote:
>   Replace kzalloc() with the preferred kzalloc_obj() helper
>   to address a checkpatch warning.
> 
>   Signed-off-by: Pete Connor <pete.connor@pythcoiner.dev>

Something went wrong with your indentation here :(
Re: [PATCH] serial: 8250_ni: use kzalloc_obj() for allocation
Posted by Chaitanya Vadrevu 1 month, 2 weeks ago
> Replace kzalloc() with the preferred kzalloc_obj() helper
> to address a checkpatch warning.
> 
> Signed-off-by: Pete Connor <pete.connor@pythcoiner.dev>
> ---
>  drivers/tty/serial/8250/8250_ni.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_ni.c b/drivers/tty/serial/8250/8250_ni.c
> index cb5b42b3609c..3f3dac694e20 100644
> --- a/drivers/tty/serial/8250/8250_ni.c
> +++ b/drivers/tty/serial/8250/8250_ni.c
> @@ -285,7 +285,7 @@ static int ni16550_probe(struct platform_device *pdev)
>  	bool rs232_property;
>  	int ret;
>  
> -	uart = kzalloc(sizeof(*uart), GFP_KERNEL);
> +	uart = kzalloc_obj(*uart, GFP_KERNEL);

tty-next doesn't yet have the commit that defines kzalloc_obj so this
fails to build. Will have to wait until tty-next has kzalloc_obj.

>  	if (!uart)
>  		return -ENOMEM;

Regards,
Chaitanya