Skip to contentSkip to conversation

serial: 8250-of: Fix style issues in 8250_of.c

PATCH In review jempty.liang 2 participants 2 messages Nov 17, 2025 – Nov 26, 2025 TTY layer and serial drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 serial: 8250-of: Fix style issues in 8250_of.c

This patch resolves the warning "sizeof *port should be sizeof(*port)" detected by checkpatch.pl.

---
 drivers/tty/serial/8250/8250_of.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_of.c +1 -1
index d178b6c54ea1..9799356b65f7 100644
@@ -95,7 +95,7 @@ static int of_platform_serial_setup(struct platform_device *ofdev,
 	u32 spd;
 	int ret;
 
-	memset(port, 0, sizeof *port);
+	memset(port, 0, sizeof(*port));
 
 	pm_runtime_enable(&ofdev->dev);
 	pm_runtime_get_sync(&ofdev->dev);
Signature · 1 line
2.25.1
#1 lore raw
Quoted 2 lines · jempty.liang

This patch resolves the warning "sizeof *port should be sizeof(*port)" detected by checkpatch.pl.

If you are going to submit more patches like this or related to sizeof, it would be worth to mention that while sizeof is an operator, the coding style recommends to use parentheses (but I haven't double checked this, feel free to find it in the Coding Style documentation).

drivers/tty/serial/8250/8250_of.c static int of_platform_serial_setup(struct platform_device *ofdev, · line 98

Quoted 2 lines
drivers/tty/serial/8250/8250_of.c +1 -1
-	memset(port, 0, sizeof *port);
+	memset(port, 0, sizeof(*port));

From C perspective the original one is okay.

Signature · 2 lines
With Best Regards,
Andy Shevchenko