Skip to content

Commit

Permalink
tty: serial: constify psc_ops structs
Browse files Browse the repository at this point in the history
Constifies psc_ops structures in tty's serial
port driver since they are not modified after
their initialization.

Detected and found using Coccinelle.

Suggested-by: Julia Lawall <[email protected]>
Signed-off-by: Aya Mahfouz <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Aya Mahfouz authored and gregkh committed Feb 7, 2016
1 parent 5a43140 commit cc74bd1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/tty/serial/mpc52xx_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ static irqreturn_t mpc52xx_psc_handle_irq(struct uart_port *port)
return mpc5xxx_uart_process_int(port);
}

static struct psc_ops mpc52xx_psc_ops = {
static const struct psc_ops mpc52xx_psc_ops = {
.fifo_init = mpc52xx_psc_fifo_init,
.raw_rx_rdy = mpc52xx_psc_raw_rx_rdy,
.raw_tx_rdy = mpc52xx_psc_raw_tx_rdy,
Expand Down Expand Up @@ -376,7 +376,7 @@ static struct psc_ops mpc52xx_psc_ops = {
.get_mr1 = mpc52xx_psc_get_mr1,
};

static struct psc_ops mpc5200b_psc_ops = {
static const struct psc_ops mpc5200b_psc_ops = {
.fifo_init = mpc52xx_psc_fifo_init,
.raw_rx_rdy = mpc52xx_psc_raw_rx_rdy,
.raw_tx_rdy = mpc52xx_psc_raw_tx_rdy,
Expand Down Expand Up @@ -969,7 +969,7 @@ static u8 mpc5125_psc_get_mr1(struct uart_port *port)
return in_8(&PSC_5125(port)->mr1);
}

static struct psc_ops mpc5125_psc_ops = {
static const struct psc_ops mpc5125_psc_ops = {
.fifo_init = mpc5125_psc_fifo_init,
.raw_rx_rdy = mpc5125_psc_raw_rx_rdy,
.raw_tx_rdy = mpc5125_psc_raw_tx_rdy,
Expand Down Expand Up @@ -1004,7 +1004,7 @@ static struct psc_ops mpc5125_psc_ops = {
.get_mr1 = mpc5125_psc_get_mr1,
};

static struct psc_ops mpc512x_psc_ops = {
static const struct psc_ops mpc512x_psc_ops = {
.fifo_init = mpc512x_psc_fifo_init,
.raw_rx_rdy = mpc512x_psc_raw_rx_rdy,
.raw_tx_rdy = mpc512x_psc_raw_tx_rdy,
Expand Down

0 comments on commit cc74bd1

Please sign in to comment.