Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a4bd78ed authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

mn10300: READ_ONCE() now implies smp_read_barrier_depends()



Given that READ_ONCE() now implies smp_read_barrier_depends(),
there is no need for the open-coded smp_read_barrier_depends() in
mn10300_serial_receive_interrupt() and mn10300_serial_poll_get_char().
This commit therefore removes them, but replaces them with comments
calling out that carrying dependencies through non-pointers is quite
dangerous.  Compilers simply know too much about integers.

Signed-off-by: default avatarPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: <linux-am33-list@redhat.com>
parent 40555946
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -550,7 +550,7 @@ static void mn10300_serial_receive_interrupt(struct mn10300_serial_port *port)
		return;
	}

	smp_read_barrier_depends();
	/* READ_ONCE() enforces dependency, but dangerous through integer!!! */
	ch = port->rx_buffer[ix++];
	st = port->rx_buffer[ix++];
	smp_mb();
@@ -1728,7 +1728,10 @@ static int mn10300_serial_poll_get_char(struct uart_port *_port)
			if (CIRC_CNT(port->rx_inp, ix, MNSC_BUFFER_SIZE) == 0)
				return NO_POLL_CHAR;

			smp_read_barrier_depends();
			/*
			 * READ_ONCE() enforces dependency, but dangerous
			 * through integer!!!
			 */
			ch = port->rx_buffer[ix++];
			st = port->rx_buffer[ix++];
			smp_mb();