Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp935988pxf; Wed, 7 Apr 2021 15:30:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9E4xzIsnnMpQ3NW1woY7sqixK6dDuzE+ZeyPLtb+PFlA+YgDg3Cpz+0vrogR62zeK/nYv X-Received: by 2002:a05:6402:105a:: with SMTP id e26mr7260368edu.164.1617834606247; Wed, 07 Apr 2021 15:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617834606; cv=none; d=google.com; s=arc-20160816; b=K/4Pzlon26t9MZ4qpw7BKcegMCMf5CpzrPr8wQERA0JWaFtxOmT8cbSjM3CDuVRQDJ a1m/2gxDW5+ssRmBmyoDzQQQEtRhJ3FAOcxdWRD0r/L88Qo5ZECd1QPxZ4lOza21uoYP yp5XTTUNCl4GwdVRkCI85CaqfzsgDTT6F36nOdalDWaqBMhR0N9G2qgoME4DeocL+Kq3 PBOT8iOV25QM2+TOrs77+GfZpV2W2m0tj/ulp1YTG4msKar/+twoNKsb7gtPJM9EoGc6 qfSL69dA3eGj8dv4WAWlImEZP7ZJu7/mf6HWl20cOgVWO6ZNiRkK88AKDTRz0Rcxv9FU 6ptQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=TkXDVf6bgWu81uCcatzNOikPiUaDi0mBJ2gitFtjnug=; b=MNoqqgQPJn/4YgxAEZHO7ZXt7RHHGwxXXBY7/OY9Vin5es6UZoFI1Tw63lpBguVJQM CWWyHQrygZRkIu71JD+rVT7iV/uJmBaU3dLicZ26GGwmOeCZFk7Ijeeh45SeRA8bP+yU 9JIyngXKhMXXfo+C1S3wC4AE1xG8vL4pXJR2eAIfLHdM4LXH/9IueJ141N9b91qw0Xto JjAA/5CxpkfxIj82lv52+49np/VXaH6JUdmNk/tcNBwUchbsYrhX7kv178STrO1qnRnw Cr3AHCLm0aBXzl7wZ0Kl3crXqkKfbvUZ6PFyUV8s10NPEh4qTh+Rr5s6MIJ4lC/guPCq xRdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si18701091edb.10.2021.04.07.15.29.43; Wed, 07 Apr 2021 15:30:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349361AbhDGHJ6 (ORCPT + 99 others); Wed, 7 Apr 2021 03:09:58 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15151 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346161AbhDGHJw (ORCPT ); Wed, 7 Apr 2021 03:09:52 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FFb6g66QJzpVx4; Wed, 7 Apr 2021 15:06:51 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.498.0; Wed, 7 Apr 2021 15:09:28 +0800 From: Xiaofei Tan To: , CC: , , Xiaofei Tan Subject: [PATCH v3 09/10] tty: tty_ldisc: Do not use assignment in if condition Date: Wed, 7 Apr 2021 15:06:49 +0800 Message-ID: <1617779210-51576-10-git-send-email-tanxiaofei@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1617779210-51576-1-git-send-email-tanxiaofei@huawei.com> References: <1617779210-51576-1-git-send-email-tanxiaofei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not use assignment in if condition following the advice of checkpatch.pl. Signed-off-by: Xiaofei Tan --- drivers/tty/tty_ldisc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index 874d238..56e67f7 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c @@ -508,7 +508,8 @@ static int tty_ldisc_failto(struct tty_struct *tty, int ld) return PTR_ERR(disc); tty->ldisc = disc; tty_set_termios_ldisc(tty, ld); - if ((r = tty_ldisc_open(tty, disc)) < 0) + r = tty_ldisc_open(tty, disc); + if (r < 0) tty_ldisc_put(disc); return r; } -- 2.8.1