serial: 8250-of: Fix style issues in 8250_of.c
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.
Signed-off-by jempty.liang <[email protected]>
--- drivers/tty/serial/8250/8250_of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/8250/8250_of.c +1 -1
@@ -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
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