Skip to contentSkip to conversation

Remove useless memory barrier.

PATCH New Ralf Baechle 1 participant 1 message Dec 8, 2006 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Remove useless memory barrier.

I don't see why there is a memory barrier in copy_from_read_buf() at all. Even if it was useful spin_unlock_irqrestore implies a barrier.

drivers/char/n_tty.c +0 -1
index 603b9ad..8df7ff3 100644
@@ -1151,7 +1151,6 @@ static int copy_from_read_buf(struct tty
 	n = min(*nr, n);
 	spin_unlock_irqrestore(&tty->read_lock, flags);
 	if (n) {
-		mb();
 		retval = copy_to_user(*b, &tty->read_buf[tty->read_tail], n);
 		n -= retval;
 		spin_lock_irqsave(&tty->read_lock, flags);