serial: samsung: Change MAX_CLK_NAME_LENGTH to 17
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): CGME20240605040759epcas1p36d200e262d9a98f9879cf7fd0ee94bba@epcas1p3.samsung.com
PATCH 1/1 serial: samsung: Change MAX_CLK_NAME_LENGTH to 17
clkname "clk_uart_baud" already 13 byte, so compiler warns drivers/tty/serial/samsung_tty.c:1392:17: note: ‘sprintf’ output between 15 and 17 bytes into a destination of size 15
--- drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/samsung_tty.c +1 -1
@@ -1339,7 +1339,7 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level,* */ -#define MAX_CLK_NAME_LENGTH 15 +#define MAX_CLK_NAME_LENGTH 17static inline u8 s3c24xx_serial_getsource (struct uart_port *port) {
Signature · 1 line
2.39.2
Krzysztof Kozlowski
maintainerQuoted 2 lines · Kwanghoon Son
clkname "
clk_uart_baud" already 13 byte, so compiler warnsdrivers/tty/serial/samsung_tty.c:1392:17: note: ‘sprintf’ output between 15 and 17 bytes into a destination of size 15
But that's not true. We do not write there more than 15, including terminating NULL byte, right?
Or you just sent whatever is there to silence warning?
Best regards,
Krzysztof
Quoted 2 lines · Krzysztof Kozlowski
But that's not true. We do not write there more than 15, including terminating NULL byte, right?
For now, right. only clk_uart_baud[0-3] acceptable.
I thought this meaningful in code side, clk_num u8 can over in future. Also don't want to see warnings.
But if It's false warning(device tree constrain), please ignore patch.
Thanks for review.
Kwang.
Quoted 5 lines
Or you just sent whatever is there to silence warning?
Best regards,
Krzysztof
Krzysztof Kozlowski
maintainerQuoted 7 lines · Kwanghoon Son
Quoted 2 lines · Krzysztof Kozlowski
But that's not true. We do not write there more than 15, including terminating NULL byte, right?
For now, right. only clk_uart_baud[0-3] acceptable.
I thought this meaningful in code side,
clk_numu8 can over in future.
But it can't now.
Quoted 3 lines
Also don't want to see warnings.
But if It's false warning(device tree constrain), please ignore patch.
To me the warning is a false positive.
Best regards,
Krzysztof
Alim Akhtar
reviewerQuoted 11 lines
-----Original Message-----
From: Kwanghoon Son <[email protected]>
Sent: Wednesday, June 5, 2024 9:37 AM
To: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; linux- [email protected]
Cc: Kwanghoon Son <[email protected]>
Subject: [PATCH] serial: samsung: ChangeMAX_CLK_NAME_LENGTHto 17
Quoted 3 lines
clkname "
clk_uart_baud" already 13 byte, so compiler warnsdrivers/tty/serial/samsung_tty.c:1392:17: note: ‘sprintf’ output between 15 and 17 bytes into a destination of size 15
There was a similar discussion around buffer size of clkname last year
https://www.spinics.net/lists/arm-kernel/msg1039769.html
and it was concluded that it’s a false warning AFAIR.
Quoted 21 lines
Signed-off-by Kwanghoon Son <[email protected]>--- drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/tty/serial/samsung_tty.c +1
-2@@ -1339,7 +1339,7 @@ static void s3c24xx_serial_pm(struct uart_port *port,unsigned int level, * */ -#define MAX_CLK_NAME_LENGTH 15 +#define MAX_CLK_NAME_LENGTH 17static inline u8 s3c24xx_serial_getsource (struct uart_port *port) { --2.39.2