[PATCH] Bluetooth: hci_ldisc: Remove redundant 0 value initialization

Liao Yuanhong posted 1 patch 1 month, 2 weeks ago
drivers/bluetooth/hci_ldisc.c | 1 -
1 file changed, 1 deletion(-)
[PATCH] Bluetooth: hci_ldisc: Remove redundant 0 value initialization
Posted by Liao Yuanhong 1 month, 2 weeks ago
The hci_uart struct is already zeroed by kzalloc(). It's redundant to
initialize hu->padding to 0.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
 drivers/bluetooth/hci_ldisc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index d0adae3267b4..e7a55c2e63f1 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -508,7 +508,6 @@ static int hci_uart_tty_open(struct tty_struct *tty)
 
 	/* disable alignment support by default */
 	hu->alignment = 1;
-	hu->padding = 0;
 
 	/* Use serial port speed as oper_speed */
 	hu->oper_speed = tty->termios.c_ospeed;
-- 
2.34.1
Re: [PATCH] Bluetooth: hci_ldisc: Remove redundant 0 value initialization
Posted by Markus Elfring 1 month, 2 weeks ago
> The hci_uart struct is already zeroed by kzalloc(). It's redundant to
> initialize hu->padding to 0.

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17-rc2#n94

Regards,
Markus
Re: [PATCH] Bluetooth: hci_ldisc: Remove redundant 0 value initialization
Posted by Paul Menzel 1 month, 2 weeks ago
Dear Liao,


Thank you for the patch.

Am 18.08.25 um 14:36 schrieb Liao Yuanhong:
> The hci_uart struct is already zeroed by kzalloc(). It's redundant to
> initialize hu->padding to 0.
> 
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
> ---
>   drivers/bluetooth/hci_ldisc.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
> index d0adae3267b4..e7a55c2e63f1 100644
> --- a/drivers/bluetooth/hci_ldisc.c
> +++ b/drivers/bluetooth/hci_ldisc.c
> @@ -508,7 +508,6 @@ static int hci_uart_tty_open(struct tty_struct *tty)
>   
>   	/* disable alignment support by default */
>   	hu->alignment = 1;
> -	hu->padding = 0;
>   
>   	/* Use serial port speed as oper_speed */
>   	hu->oper_speed = tty->termios.c_ospeed;

Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>


Kind regards,

Paul