From patchwork Sat Jun 19 07:28:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lipeng (Y)" X-Patchwork-Id: 12332763 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0341C49361 for ; Sat, 19 Jun 2021 07:31:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C7B2B61168 for ; Sat, 19 Jun 2021 07:31:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234114AbhFSHeG (ORCPT ); Sat, 19 Jun 2021 03:34:06 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:5045 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230217AbhFSHeE (ORCPT ); Sat, 19 Jun 2021 03:34:04 -0400 Received: from dggeme755-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G6S5z2ngbzXhSq; Sat, 19 Jun 2021 15:26:47 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by dggeme755-chm.china.huawei.com (10.3.19.101) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Sat, 19 Jun 2021 15:31:52 +0800 From: Peng Li To: , , , , CC: , , Subject: [PATCH net-next 2/3] net: c101: replace comparison to NULL with "!card" Date: Sat, 19 Jun 2021 15:28:37 +0800 Message-ID: <1624087718-26595-3-git-send-email-lipeng321@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1624087718-26595-1-git-send-email-lipeng321@huawei.com> References: <1624087718-26595-1-git-send-email-lipeng321@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggeme755-chm.china.huawei.com (10.3.19.101) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org According to the chackpatch.pl, comparison to NULL could be written "!card". Signed-off-by: Peng Li --- drivers/net/wan/c101.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wan/c101.c b/drivers/net/wan/c101.c index 94b852f..f33192e 100644 --- a/drivers/net/wan/c101.c +++ b/drivers/net/wan/c101.c @@ -307,7 +307,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) } card = kzalloc(sizeof(card_t), GFP_KERNEL); - if (card == NULL) + if (!card) return -ENOBUFS; card->dev = alloc_hdlcdev(card); @@ -381,7 +381,7 @@ static int __init c101_run(unsigned long irq, unsigned long winbase) static int __init c101_init(void) { - if (hw == NULL) { + if (!hw) { #ifdef MODULE pr_info("no card initialized\n"); #endif