Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3486377pxj; Tue, 1 Jun 2021 06:29:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy20AzfS9JFRSNvXs3TAXv9xeNTlzsAC0tziH48n8dXI5AJpXtXKhB5V2MosGPcR7HMp5F1 X-Received: by 2002:a92:ad07:: with SMTP id w7mr21279867ilh.98.1622554167557; Tue, 01 Jun 2021 06:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622554167; cv=none; d=google.com; s=arc-20160816; b=ejrNXoRLf/dWrp65CBPou62WgN33GAKLm0S3h+bte0DQ/55QDvljVCuhEYdfkgtHvS V03azsjEJyhd1NGIfsW+nVAcL49A/rl7iK+CrAf0JVdNSL0+qI6w0UUDGG7C0nmuEcUK 0G9w0gHkXJr1L5qApCLl3tgIkjzzGSW+7MbA6mI/C2gK5dWW6II7UR8MT6PrkbA1jAq6 n9Um7vbmNZfwCav6HoJ99mQGXnN54KB+3LmU+oW+bcVO3fji2ioNuMwqhT5/4rL1oD/V Keap5JmJDRR9XGVZ2/UMPqOK2/7yYgS7oaPe3d94c4V4hQaLjXSbOXIdJVxPYqhObnoE daWA== 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=KhFbouQazx6RERbac8g0gJyHz5GozDf8VcaS9FWaNMk=; b=ETVCMVLYC48Scz+SyxwPfEvKOXlWCbgpgYadipIFb2jOl4y4Arcbfn2moSCHnqFJR7 49qOQdlumYIQhp/fBDVbOvnEEMJvG+Yi+weA2Rh3ytWlhVUte+Rjg8iGFRmhgMttXnZH T94jKjkYLPh/m0Q4mJITNNgIMLbVOba/KwapL/O2HfH9AVrGq56PR6qBoxSbUH1/WGeN hvyH9zt1mzHaMr3dpoNhljnzSxgGOvouT4hnrxtH0/cCUThtQ65a93LbgP6E30kKopNY PaO0XZnTbvRVahP/P1yIehYWN+6JEXYI7Qay8HFLzZ70SAcBRfGS5wiBDkb+FFct6mwi GUJA== 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 m125si13003962iof.57.2021.06.01.06.29.14; Tue, 01 Jun 2021 06:29:27 -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 S234266AbhFAN2a (ORCPT + 99 others); Tue, 1 Jun 2021 09:28:30 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:3368 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233998AbhFAN2K (ORCPT ); Tue, 1 Jun 2021 09:28:10 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4FvXrz3LHDz67Y8; Tue, 1 Jun 2021 21:22:43 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Tue, 1 Jun 2021 21:26:26 +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; Tue, 1 Jun 2021 21:26:26 +0800 From: Guangbin Huang To: , , , , CC: , , , , Subject: [PATCH net-next 6/7] net: hdlc: move out assignment in if condition Date: Tue, 1 Jun 2021 21:23:21 +0800 Message-ID: <1622553802-19903-7-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1622553802-19903-1-git-send-email-huangguangbin2@huawei.com> References: <1622553802-19903-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) 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/hdlc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wan/hdlc.c b/drivers/net/wan/hdlc.c index fefc732..f48d70e 100644 --- a/drivers/net/wan/hdlc.c +++ b/drivers/net/wan/hdlc.c @@ -212,7 +212,8 @@ int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) /* Not handled by currently attached protocol (if any) */ while (proto) { - if ((result = proto->ioctl(dev, ifr)) != -EINVAL) + result = proto->ioctl(dev, ifr); + if (result != -EINVAL) return result; proto = proto->next; } @@ -363,7 +364,8 @@ static int __init hdlc_module_init(void) int result; pr_info("%s\n", version); - if ((result = register_netdevice_notifier(&hdlc_notifier)) != 0) + result = register_netdevice_notifier(&hdlc_notifier); + if (result) return result; dev_add_pack(&hdlc_packet_type); return 0; -- 2.8.1