Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3490771pxj; Mon, 24 May 2021 07:56:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9MQ1p6/dGchUmpTJ4CQK9kFTiWq6majOJPsPZ+ll4bX7a+/IPDxumCqtK3QpoITgwnMs7 X-Received: by 2002:a02:3505:: with SMTP id k5mr25936400jaa.123.1621868206832; Mon, 24 May 2021 07:56:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621868206; cv=none; d=google.com; s=arc-20160816; b=W0FKANGM70y3NqWDbxInhkhZ7VGvxtm0q1K8ivdVYqC5vUBSfd84E42aaM29gchSnn d5XVPVrPvtmKG+YyrL+mYAM4M2j/83CxL2e0Rdogh1LGobzlwxlYTs68w4MXttPCOHUg lKARmYzvipp2m9pFKC8awM3tGj0oxMGpHn7zQdmPLH3MAqHbqqW2XgzKjvAX8xlWm/Qf r9HgMcZfxAbsgZf38Rq9FEPslvtEIm0hnawPu4fbYaUR4NFgoYvgUjbywdDKPnDhtiG7 WsqM8Mef33BPkPl4YClLOzObngFrPsYCUmJfH6kK4MzUJRJeKjqiINLlsdNFPcx6GX+2 aI7Q== 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=2EBjELDpmMI0Zz4XaO0hjTI2HU51Yow4hFuhJNMMQFw=; b=yIMHdbUYVchmS1RYZyrKNFRtCqke7hYMwYDm70h0L9KGrsjDp/T7OjhDp70TgTMgAE bjGn0Lbhwsec0BnM4hkf4VX/UJXmhM6/Tvn6YAaUj/x5ISlBLuA1TuA6ip/GYq+1Z0q7 HHZtQ1XSqRHQenMUzYOrCpTlQcygxBW7VaOPgyqhUuXvXclk3L1QPmimW8x5TvyTySEU UugvkSJ6PGKumhQYNSkS9QAU8mlo2cmoJoYtYY+M6PbNeZCI34xrxl24ZmPztJfWOC0+ /i8/C/D7Yn+PNDBAtuJ5vJe94nZ0esvJJmzrZKA6a2PcbUVT9jZF0O8wLvvLJamejPW3 YKkQ== 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 w17si14265618ilm.86.2021.05.24.07.56.34; Mon, 24 May 2021 07:56:46 -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 S233395AbhEXO5H (ORCPT + 99 others); Mon, 24 May 2021 10:57:07 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:3653 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233977AbhEXOvy (ORCPT ); Mon, 24 May 2021 10:51:54 -0400 Received: from dggems703-chm.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Fpg5Z6SWszNynv; Mon, 24 May 2021 22:46:42 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggems703-chm.china.huawei.com (10.3.19.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 24 May 2021 22:50:18 +0800 Received: from localhost.localdomain (10.67.165.24) by dggemi759-chm.china.huawei.com (10.1.198.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 24 May 2021 22:50:18 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 07/10] net: wan: move out assignment in if condition Date: Mon, 24 May 2021 22:47:14 +0800 Message-ID: <1621867637-2680-8-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1621867637-2680-1-git-send-email-huangguangbin2@huawei.com> References: <1621867637-2680-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggemi759-chm.china.huawei.com (10.1.198.145) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Li Should not use assignment in if condition. Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/wanxl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 7965c648f3eb..a5f0aae30e0c 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -404,7 +404,9 @@ static int wanxl_open(struct net_device *dev) netdev_err(dev, "port already open\n"); return -EIO; } - if ((i = hdlc_open(dev)) != 0) + + i = hdlc_open(dev); + if (i) return i; port->tx_in = port->tx_out = 0; @@ -730,7 +732,8 @@ static int wanxl_pci_init_one(struct pci_dev *pdev, timeout = jiffies + 5 * HZ; do { - if ((stat = readl(card->plx + PLX_MAILBOX_5)) != 0) + stat = readl(card->plx + PLX_MAILBOX_5); + if (stat) break; schedule(); } while (time_after(timeout, jiffies)); -- 2.8.1