Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1863396pxj; Sun, 13 Jun 2021 00:43:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvqZfR8VwNEjS11p50EVGU6m5xZUyY2Ke9UbsyZHQ1rFOwK9fVUW2/7whyvZDvRrn8xCPc X-Received: by 2002:a17:906:c293:: with SMTP id r19mr10703865ejz.252.1623570208870; Sun, 13 Jun 2021 00:43:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623570208; cv=none; d=google.com; s=arc-20160816; b=GWVU0Mzrd9jSleZxloMu97gn1eadTl/uMHZzXo/ubONXv0EokNhPwu6pNeNjGMxxzJ MqAQhTBD0jhwD1mg1Eij6OH0PKfJrIuhJj7CysPL+ps70jNV4pNTjAhz9M4KogNeJX6K NcnrKSWWOsfzvrSSXSsKBJpNp+HjVfRyWfs+ZXrb1R77XeSgkHQneNnSngPMgEC4+2cB m55qnCz9gTqqsbvsbRwqvq9FAXfXBjFISMvV3ZQlsdpXH1FOyEvO0uglmz0U4XMgniYd r9gYJt2eUoAow3QE0qWY6RGQLeE1v9IyhP81Btl7fLMZXHbWY4iHGunKzKlZ0IfELE9j m08w== 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=d5JrRzt3ru12OPmAKlWXCN4rtHbKqcWCYxchmAlC+rY=; b=x9escyDJ6cqXuvSBmVEgNctzRV6SXCU7No0uNq5kX4twu4wHkK15aL+mgqKZVY+ccR pi/Vr9m7mgj009NMLIr1vfG0IfTABasV6/iVQD2WoSNtZGfVNdnCB0uAmCTDqR05KuM5 VVZax2PkyxX7Q9rlfio2SaK5Lzup6kgu2GEpZSsAsp/S215t5ClCDlvpN4NLfptpJksH +5uWCnthdkRAN/E0HqV2Qeu7GuFQkS+jMASR0rQ9o81AO+p7aMtKKBj9x1Ofx44dfR/I VLwWNBVKdwq+v7I2dRVvbQyGA7FvN9AMnyZAUyCr2a5Py2JYHhVTeFmW8Zaqgn8TtmWm YoXQ== 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 v13si8944609edt.90.2021.06.13.00.43.06; Sun, 13 Jun 2021 00:43:28 -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 S231270AbhFMHnk (ORCPT + 99 others); Sun, 13 Jun 2021 03:43:40 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:4056 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229777AbhFMHnh (ORCPT ); Sun, 13 Jun 2021 03:43:37 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G2mc5632tzWr8k; Sun, 13 Jun 2021 15:36:37 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Sun, 13 Jun 2021 15:41:35 +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; Sun, 13 Jun 2021 15:41:34 +0800 From: Guangbin Huang To: , , , , CC: , , , Subject: [PATCH net-next 05/11] net: z85230: replace comparison to NULL with "!skb" Date: Sun, 13 Jun 2021 15:38:17 +0800 Message-ID: <1623569903-47930-6-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1623569903-47930-1-git-send-email-huangguangbin2@huawei.com> References: <1623569903-47930-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) 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 According to the chackpatch.pl, comparison to NULL could be written "!skb". Signed-off-by: Peng Li Signed-off-by: Guangbin Huang --- drivers/net/wan/z85230.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c index f815bb5..ced746d 100644 --- a/drivers/net/wan/z85230.c +++ b/drivers/net/wan/z85230.c @@ -851,12 +851,12 @@ int z8530_sync_dma_open(struct net_device *dev, struct z8530_channel *c) return -EMSGSIZE; c->rx_buf[0]=(void *)get_zeroed_page(GFP_KERNEL|GFP_DMA); - if(c->rx_buf[0]==NULL) + if (!c->rx_buf[0]) return -ENOBUFS; c->rx_buf[1]=c->rx_buf[0]+PAGE_SIZE/2; c->tx_dma_buf[0]=(void *)get_zeroed_page(GFP_KERNEL|GFP_DMA); - if(c->tx_dma_buf[0]==NULL) + if (!c->tx_dma_buf[0]) { free_page((unsigned long)c->rx_buf[0]); c->rx_buf[0]=NULL; @@ -1039,7 +1039,7 @@ int z8530_sync_txdma_open(struct net_device *dev, struct z8530_channel *c) return -EMSGSIZE; c->tx_dma_buf[0]=(void *)get_zeroed_page(GFP_KERNEL|GFP_DMA); - if(c->tx_dma_buf[0]==NULL) + if (!c->tx_dma_buf[0]) return -ENOBUFS; c->tx_dma_buf[1] = c->tx_dma_buf[0] + PAGE_SIZE/2; @@ -1397,7 +1397,7 @@ static void z8530_tx_begin(struct z8530_channel *c) c->tx_next_skb=NULL; c->tx_ptr=c->tx_next_ptr; - if(c->tx_skb==NULL) + if (!c->tx_skb) { /* Idle on */ if(c->dma_tx) @@ -1486,7 +1486,7 @@ static void z8530_tx_done(struct z8530_channel *c) struct sk_buff *skb; /* Actually this can happen.*/ - if (c->tx_skb == NULL) + if (!c->tx_skb) return; skb = c->tx_skb; @@ -1589,7 +1589,7 @@ static void z8530_rx_done(struct z8530_channel *c) */ skb = dev_alloc_skb(ct); - if (skb == NULL) { + if (!skb) { c->netdevice->stats.rx_dropped++; netdev_warn(c->netdevice, "Memory squeeze\n"); } else { @@ -1630,7 +1630,7 @@ static void z8530_rx_done(struct z8530_channel *c) RT_UNLOCK; c->skb2 = dev_alloc_skb(c->mtu); - if (c->skb2 == NULL) + if (!c->skb2) netdev_warn(c->netdevice, "memory squeeze\n"); else skb_put(c->skb2, c->mtu); -- 2.8.1