Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2677651pxj; Mon, 14 Jun 2021 04:45:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPdEpEpBrbvQnuJnCbKcSGaeCAOJ45UGv92TQjAY+oLViAKYCivA3ECwO4nvgCihJmc/zA X-Received: by 2002:a05:6402:1771:: with SMTP id da17mr16281558edb.31.1623671117136; Mon, 14 Jun 2021 04:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623671117; cv=none; d=google.com; s=arc-20160816; b=lDnx1ZDq0rX5jtN39kHA4GXvrn387Z/k4ayaZ8RtRHV5OOJ6AZ0WGohUuQ+9RvPa2g jw61iHAiqzW+wQ7ZQgK7hq7fo1isY7S4morWPB4XJ1WhWnBeTXOmwl0ZSFsvSSVpQqNM tc76rEAyA7fRGu2iJ3wPSK6ronqRU0VIgFWRpCnWwMFDOuu9TVJyUttwPHYoZhA+1jE2 zlPmOij2DyUqtxZ02GbbTA8KAajOzj7DwcmGrBDuplGNsplZlBZubJre4v4Mb0/0gTRg Jw7I8U1uYY6HaKj8AvhppSVQWikppIku3h2TeYCo5DU0nD+lLq7Bn+kXdfQEPb3pzKTg lFuA== 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=C3BUtpYeKzxEn8uM+7GxjN9p5rbrp5/omyLxwOo6Q5DbjiMAgIZOaQlKnr9fbigwxu R+7NNoHIVk3xW360bQumlM+5/Dpq1vaTANLxSnnYMRrD8+MNKkEKWl8rU8KkFBDmyVRX +aPLmEtpEpWuXhWqLU1AZrczliyNar1qfegof21wzeIvBosiEgpedIKfldvdxMWEnS/d bSbnaUqJtKYJP1FGBwjEPVE324wAyx0zFH5k320Qu5KEKVr9F5HC95VILVlQxdjF0yBd yqPxHds8mPLvotMoLbJkl9conhXMfoIRWSuu0Dt0814FtlMnNmRV1ADXcBFZpTP26YOw q3zA== 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 by22si10311465ejc.175.2021.06.14.04.44.54; Mon, 14 Jun 2021 04:45:17 -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 S235342AbhFNLnQ (ORCPT + 99 others); Mon, 14 Jun 2021 07:43:16 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:4061 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235850AbhFNLeJ (ORCPT ); Mon, 14 Jun 2021 07:34:09 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4G3TgY0byHzXfjn; Mon, 14 Jun 2021 19:27:05 +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; Mon, 14 Jun 2021 19:32:03 +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, 14 Jun 2021 19:32:03 +0800 From: Guangbin Huang To: , , , , CC: , , , Subject: [PATCH V2 net-next 05/11] net: z85230: replace comparison to NULL with "!skb" Date: Mon, 14 Jun 2021 19:28:45 +0800 Message-ID: <1623670131-49973-6-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1623670131-49973-1-git-send-email-huangguangbin2@huawei.com> References: <1623670131-49973-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) 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