All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tty:hvcs: Move Assignment for hvcsd->port.count
@ 2018-04-02 14:53 Bryant G. Ly
  0 siblings, 0 replies; only message in thread
From: Bryant G. Ly @ 2018-04-02 14:53 UTC (permalink / raw)
  To: mpe; +Cc: linuxppc-dev, Bryant G. Ly

Move the assignment out of hvcsd->port.count from within the
if () block so this patch fixes it. It is bad practice to have
assignments within an if () block.

Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
---
 drivers/tty/hvc/hvcs.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
index 1db1d97..333dc76 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -1202,7 +1202,8 @@ static void hvcs_close(struct tty_struct *tty, struct file *filp)
 	hvcsd = tty->driver_data;
 
 	spin_lock_irqsave(&hvcsd->lock, flags);
-	if (--hvcsd->port.count == 0) {
+	--hvcsd->port.count;
+	if (hvcsd->port.count == 0) {
 
 		vio_disable_interrupts(hvcsd->vdev);
 
-- 
2.7.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2018-04-02 14:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-02 14:53 [PATCH] tty:hvcs: Move Assignment for hvcsd->port.count Bryant G. Ly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.