Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3280563pxj; Mon, 14 Jun 2021 19:50:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4a9idiFD0m7sBQctVVfUXI1Ye0EuQaAd664MPCvFBEtIIxNAch9+9oNQQ0ISVmmaA5oTv X-Received: by 2002:a17:906:f744:: with SMTP id jp4mr18249372ejb.210.1623725419578; Mon, 14 Jun 2021 19:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623725419; cv=none; d=google.com; s=arc-20160816; b=r5y0NknGCGgNlWTJooBk5g31ykqUcUCztibhiL0LWyshBFmyoh9QplDqF7aBAQxZY1 0hC4bEHVlUjmafWXN0R2HEiKCmzdEcRjhHgsRhlF++BEqoLyuI4F+5sxTRf4CnaztTWh 5oDnKlvkQsqz9qkt0m3C9svArGiExZ88CfmkFGVW9LZTvGalnY2npPCis4pRfRbPZsbs MJpTCJp3SAJmivp6w0OX/9ZYrFw8xWJyRUdymFJneTaCKq7Yhw3DoOv5bUUq909mlKLM PGDY2hjzCiIosKsF1tsA8MP/Xum/beNPfTOJbSbfHzpA2Qw2ZAPPjir2HqGTCSbT6kYq dntA== 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=8zIDq/Y4ZWPqYqrvyXjF6xVL7VD0o/xlzza8TjYs1x8=; b=DNKd7gjuLoVtl0/4UdTxgtGiAkgt07Zju9U40S2JDloP2XoG8G2LqriaBVeiCjPV6u zNzFbu4zmtAF6xOTAveiAXh5NScPDi7jQZIrIYefNlkVxayeQb65xiPDT9yLuWl+hRuq amSrWjb8XwaqbWeZkgYa6UY8dfoYFiZpx/TpnQbHVN005isncgDNekZ8Fb/thzkjtt5q 7KIWNHnkWi1+fuRRLxWbn7YTquYCu/IvMAN4DBCYdJcks/jOOZnKsEb4Jibyp417bo0C hqE25U7k/yOa9uyJajFWSDT9lGKCFi4pR27cB744EdASuE8K9DdithTMfXhfiHmU913M 836A== 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 hs15si188062ejc.266.2021.06.14.19.49.57; Mon, 14 Jun 2021 19:50:19 -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 S230225AbhFOCtr (ORCPT + 99 others); Mon, 14 Jun 2021 22:49:47 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:10063 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230411AbhFOCtH (ORCPT ); Mon, 14 Jun 2021 22:49:07 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G3t1h43HxzZf14; Tue, 15 Jun 2021 10:44:08 +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, 15 Jun 2021 10:46:57 +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, 15 Jun 2021 10:46:57 +0800 From: Guangbin Huang To: , , , , CC: , , , Subject: [PATCH V2 net-next 04/10] net: z85230: replace comparison to NULL with "!skb" Date: Tue, 15 Jun 2021 10:43:39 +0800 Message-ID: <1623725025-50976-5-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1623725025-50976-1-git-send-email-huangguangbin2@huawei.com> References: <1623725025-50976-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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 94ed9a2..0162239 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