* [PATCH] serial: 8250-of: Fix style issues in 8250_of.c
@ 2025-11-17 3:41 jempty.liang
2025-11-26 12:53 ` Andy Shevchenko
0 siblings, 1 reply; 2+ messages in thread
From: jempty.liang @ 2025-11-17 3:41 UTC (permalink / raw)
To: gregkh, jirislaby; +Cc: linux-kernel, linux-serial, jempty.liang
This patch resolves the warning "sizeof *port should be sizeof(*port)"
detected by checkpatch.pl.
Signed-off-by: jempty.liang <imntjempty@163.com>
---
drivers/tty/serial/8250/8250_of.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index d178b6c54ea1..9799356b65f7 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -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);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] serial: 8250-of: Fix style issues in 8250_of.c
2025-11-17 3:41 [PATCH] serial: 8250-of: Fix style issues in 8250_of.c jempty.liang
@ 2025-11-26 12:53 ` Andy Shevchenko
0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2025-11-26 12:53 UTC (permalink / raw)
To: jempty.liang; +Cc: gregkh, jirislaby, linux-kernel, linux-serial
On Mon, Nov 17, 2025 at 03:41:17AM +0000, jempty.liang wrote:
> 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).
> - memset(port, 0, sizeof *port);
> + memset(port, 0, sizeof(*port));
From C perspective the original one is okay.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-26 12:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17 3:41 [PATCH] serial: 8250-of: Fix style issues in 8250_of.c jempty.liang
2025-11-26 12:53 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox