Skip to contentSkip to conversation

serial: 8250_ni: use kzalloc_obj() for allocation

PATCH In review Pete Connor 3 participants 3 messages Feb 17 – Mar 12

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: 8250_ni: use kzalloc_obj() for allocation

Replace kzalloc() with the preferred kzalloc_obj() helper to address a checkpatch warning.

---
 drivers/tty/serial/8250/8250_ni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_ni.c +1 -1
index cb5b42b3609c..3f3dac694e20 100644
@@ -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;
 
Signature · 1 line
2.47.3
#1 lore raw
Quoted 13 lines

Replace kzalloc() with the preferred kzalloc_obj() helper to address a checkpatch warning.

---
 drivers/tty/serial/8250/8250_ni.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_ni.c +0 -0
index cb5b42b3609c..3f3dac694e20 100644

drivers/tty/serial/8250/8250_ni.c static int ni16550_probe(struct platform_device *pdev) · line 288

Quoted 5 lines
drivers/tty/serial/8250/8250_ni.c +1 -1
@@ -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.

drivers/tty/serial/8250/8250_ni.c static int ni16550_probe(struct platform_device *pdev) · line 290

Quoted 2 lines
drivers/tty/serial/8250/8250_ni.c +0 -0
 	if (!uart)
 		return -ENOMEM;

Regards,
Chaitanya