diff mbox series

[5/7] tty: serial: samsung: constify s3c24xx_serial_drv_data members

Message ID 20220304080348.218581-5-krzysztof.kozlowski@canonical.com (mailing list archive)
State Superseded
Headers show
Series [1/7] tty: serial: samsung: embed s3c24xx_uart_info in parent structure | expand

Commit Message

Krzysztof Kozlowski March 4, 2022, 8:03 a.m. UTC
The driver data (struct s3c24xx_serial_drv_data) is never modified, so
also its members can be make const.  Except code style this has no
impact because the structure itself is always a const.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
---
 drivers/tty/serial/samsung_tty.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jiri Slaby March 7, 2022, 6:38 a.m. UTC | #1
On 04. 03. 22, 9:03, Krzysztof Kozlowski wrote:
> The driver data (struct s3c24xx_serial_drv_data) is never modified, so
> also its members can be make const.  Except code style this has no

s/make/made/ if you do a v2.

> impact because the structure itself is always a const.
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>

> ---
>   drivers/tty/serial/samsung_tty.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> index 279c413f2300..eecefff5c4a4 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -85,9 +85,9 @@ struct s3c24xx_uart_info {
>   };
>   
>   struct s3c24xx_serial_drv_data {
> -	struct s3c24xx_uart_info	info;
> -	struct s3c2410_uartcfg		def_cfg;
> -	unsigned int			fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
> +	const struct s3c24xx_uart_info	info;
> +	const struct s3c2410_uartcfg	def_cfg;
> +	const unsigned int		fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>   };
>   
>   struct s3c24xx_uart_dma {
Krzysztof Kozlowski March 7, 2022, 7:49 a.m. UTC | #2
On 07/03/2022 07:38, Jiri Slaby wrote:
> On 04. 03. 22, 9:03, Krzysztof Kozlowski wrote:
>> The driver data (struct s3c24xx_serial_drv_data) is never modified, so
>> also its members can be make const.  Except code style this has no
> 
> s/make/made/ if you do a v2.

Sure, I'll send a v2.

> 
>> impact because the structure itself is always a const.
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> 
> Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
> 
>> ---
>>   drivers/tty/serial/samsung_tty.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
>> index 279c413f2300..eecefff5c4a4 100644
>> --- a/drivers/tty/serial/samsung_tty.c
>> +++ b/drivers/tty/serial/samsung_tty.c
>> @@ -85,9 +85,9 @@ struct s3c24xx_uart_info {
>>   };
>>   
>>   struct s3c24xx_serial_drv_data {
>> -	struct s3c24xx_uart_info	info;
>> -	struct s3c2410_uartcfg		def_cfg;
>> -	unsigned int			fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>> +	const struct s3c24xx_uart_info	info;
>> +	const struct s3c2410_uartcfg	def_cfg;
>> +	const unsigned int		fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
>>   };
>>   
>>   struct s3c24xx_uart_dma {
> 
> 


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index 279c413f2300..eecefff5c4a4 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -85,9 +85,9 @@  struct s3c24xx_uart_info {
 };
 
 struct s3c24xx_serial_drv_data {
-	struct s3c24xx_uart_info	info;
-	struct s3c2410_uartcfg		def_cfg;
-	unsigned int			fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
+	const struct s3c24xx_uart_info	info;
+	const struct s3c2410_uartcfg	def_cfg;
+	const unsigned int		fifosize[CONFIG_SERIAL_SAMSUNG_UARTS];
 };
 
 struct s3c24xx_uart_dma {