Skip to content

Commit e8429b0

Browse files
monamagarwal123-dotcomgregkh
authored andcommitted
drivers/staging: Use RCU_INIT_POINTER(x, NULL) in fwserial/fwserial.c
This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL) The rcu_assign_pointer() ensures that the initialization of a structure is carried out before storing a pointer to that structure. And in the case of the NULL pointer, there is no structure to initialize. So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL) Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent cb79074 commit e8429b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/staging/fwserial/fwserial.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1807,7 +1807,7 @@ static void fwserial_release_port(struct fwtty_port *port, bool reset)
18071807
port->max_payload = link_speed_to_max_payload(SCODE_100);
18081808
dma_fifo_change_tx_limit(&port->tx_fifo, port->max_payload);
18091809

1810-
rcu_assign_pointer(port->peer, NULL);
1810+
RCU_INIT_POINTER(port->peer, NULL);
18111811
spin_unlock_bh(&port->lock);
18121812

18131813
if (port->port.console && port->fwcon_ops->notify != NULL)
@@ -2240,7 +2240,7 @@ static int fwserial_create(struct fw_unit *unit)
22402240
port->max_payload = link_speed_to_max_payload(SCODE_100);
22412241
dma_fifo_init(&port->tx_fifo);
22422242

2243-
rcu_assign_pointer(port->peer, NULL);
2243+
RCU_INIT_POINTER(port->peer, NULL);
22442244
serial->ports[i] = port;
22452245

22462246
/* get unique bus addr region for port's status & recv fifo */

0 commit comments

Comments
 (0)