From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40FFbr442BzF25M for ; Tue, 3 Apr 2018 00:53:57 +1000 (AEST) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w32EoTK8060373 for ; Mon, 2 Apr 2018 10:53:55 -0400 Received: from e14.ny.us.ibm.com (e14.ny.us.ibm.com [129.33.205.204]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h3ne9kn17-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 02 Apr 2018 10:53:54 -0400 Received: from localhost by e14.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 2 Apr 2018 10:53:53 -0400 From: "Bryant G. Ly" To: mpe@ellerman.id.au Cc: linuxppc-dev@lists.ozlabs.org, "Bryant G. Ly" Subject: [PATCH] tty:hvcs: Move Assignment for hvcsd->port.count Date: Mon, 2 Apr 2018 09:53:49 -0500 Message-Id: <1522680829-22336-1-git-send-email-bryantly@linux.vnet.ibm.com> List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- 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