2023-11-21 09:24:21

by Jiri Slaby

[permalink] [raw]
Subject: [PATCH 10/17] tty: hso: don't initialize global serial_table

'serial_table' is global, so there is no need to initialize it to NULLs
at the module load. Drop this unneeded for loop.

Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/net/usb/hso.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 48450fe861ad..f088ea2ba6f3 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -3227,13 +3227,8 @@ static struct usb_driver hso_driver = {

static int __init hso_init(void)
{
- int i;
int result;

- /* Initialise the serial table semaphore and table */
- for (i = 0; i < HSO_SERIAL_TTY_MINORS; i++)
- serial_table[i] = NULL;
-
/* allocate our driver using the proper amount of supported minors */
tty_drv = tty_alloc_driver(HSO_SERIAL_TTY_MINORS, TTY_DRIVER_REAL_RAW |
TTY_DRIVER_DYNAMIC_DEV);
--
2.42.1


2023-11-21 22:30:21

by Jakub Kicinski

[permalink] [raw]
Subject: Re: [PATCH 10/17] tty: hso: don't initialize global serial_table

On Tue, 21 Nov 2023 10:22:51 +0100 Jiri Slaby (SUSE) wrote:
> 'serial_table' is global, so there is no need to initialize it to NULLs
> at the module load. Drop this unneeded for loop.
>
> Signed-off-by: Jiri Slaby (SUSE) <[email protected]>
> Cc: "David S. Miller" <[email protected]>
> Cc: Eric Dumazet <[email protected]>
> Cc: Jakub Kicinski <[email protected]>

Acked-by: Jakub Kicinski <[email protected]>