qcacmn: utils: Replace explicit comparison to NULL

Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within utils replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: Iae6c2f2f0b3041a9397dd13092ea500a8b995fd2
CRs-Fixed: 2418251
This commit is contained in:
Jeff Johnson
2019-03-18 09:45:12 -07:00
committed by nshrivas
orang tua f26fa0e5a4
melakukan 4c5ac90746
12 mengubah file dengan 55 tambahan dan 55 penghapusan

Melihat File

@@ -107,7 +107,7 @@ struct epping_cookie *epping_alloc_cookie(epping_context_t *pEpping_ctx)
qdf_spin_lock_bh(&pEpping_ctx->cookie_lock);
cookie = pEpping_ctx->cookie_list;
if (cookie != NULL) {
if (cookie) {
pEpping_ctx->cookie_list = cookie->next;
pEpping_ctx->cookie_count--;
}

Melihat File

@@ -110,7 +110,7 @@ void epping_disable(void)
}
hif_ctx = cds_get_context(QDF_MODULE_ID_HIF);
if (hif_ctx == NULL) {
if (!hif_ctx) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: error: hif_ctx = NULL", __func__);
return;
@@ -119,7 +119,7 @@ void epping_disable(void)
hif_reset_soc(hif_ctx);
htc_handle = cds_get_context(QDF_MODULE_ID_HTC);
if (htc_handle == NULL) {
if (!htc_handle) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: error: htc_handle = NULL", __func__);
return;
@@ -145,7 +145,7 @@ void epping_close(void)
{
epping_context_t *to_free;
if (g_epping_ctx == NULL) {
if (!g_epping_ctx) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: error: g_epping_ctx = NULL", __func__);
return;
@@ -163,7 +163,7 @@ void epping_close(void)
*/
static void epping_target_suspend_acknowledge(void *context, bool wow_nack)
{
if (NULL == g_epping_ctx) {
if (!g_epping_ctx) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: epping_ctx is NULL", __func__);
return;
@@ -251,7 +251,7 @@ int epping_enable(struct device *parent_dev, bool rtnl_held)
p_cds_context = cds_get_global_context();
if (p_cds_context == NULL) {
if (!p_cds_context) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: Failed cds_get_global_context", __func__);
ret = -1;

Melihat File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2017, 2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -76,7 +76,7 @@ void epping_refill(void *ctx, HTC_ENDPOINT_ID Endpoint)
for (RxBuffers = 0; RxBuffers < buffersToRefill; RxBuffers++) {
osBuf = qdf_nbuf_alloc(NULL, AR6000_BUFFER_SIZE,
AR6000_MIN_HEAD_ROOM, 4, false);
if (NULL == osBuf) {
if (!osBuf) {
break;
}
/* the HTC packet wrapper is at the head of the reserved area

Melihat File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
* Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
@@ -54,7 +54,7 @@ void epping_tx_dup_pkt(epping_adapter_t *adapter,
qdf_nbuf_t new_skb;
cookie = epping_alloc_cookie(adapter->pEpping_ctx);
if (cookie == NULL) {
if (!cookie) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: epping_alloc_cookie returns no resource\n",
__func__);
@@ -103,7 +103,7 @@ static int epping_tx_send_int(qdf_nbuf_t skb, epping_adapter_t *adapter)
/* allocate resource for this packet */
cookie = epping_alloc_cookie(adapter->pEpping_ctx);
/* no resource */
if (cookie == NULL) {
if (!cookie) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: epping_alloc_cookie returns no resource\n",
__func__);
@@ -318,7 +318,7 @@ void epping_tx_complete(void *ctx, HTC_PACKET *htc_pkt)
A_BOOL flushing = false;
qdf_nbuf_queue_t skb_queue;
if (htc_pkt == NULL)
if (!htc_pkt)
return;
qdf_nbuf_queue_init(&skb_queue);
@@ -381,7 +381,7 @@ void epping_tx_complete(void *ctx, HTC_PACKET *htc_pkt)
while (qdf_nbuf_queue_len(&skb_queue)) {
/* use non-lock version */
pktSkb = qdf_nbuf_queue_remove(&skb_queue);
if (pktSkb == NULL)
if (!pktSkb)
break;
qdf_nbuf_tx_free(pktSkb, QDF_NBUF_PKT_ERROR);
pEpping_ctx->total_tx_acks++;

Melihat File

@@ -50,14 +50,14 @@ static void epping_timer_expire(void *data)
struct net_device *dev = (struct net_device *)data;
epping_adapter_t *adapter;
if (dev == NULL) {
if (!dev) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: netdev = NULL", __func__);
return;
}
adapter = netdev_priv(dev);
if (adapter == NULL) {
if (!adapter) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: adapter = NULL", __func__);
return;
@@ -82,7 +82,7 @@ static int epping_ndev_stop(struct net_device *dev)
int ret = 0;
adapter = netdev_priv(dev);
if (NULL == adapter) {
if (!adapter) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: EPPING adapter context is Null", __func__);
ret = -ENODEV;
@@ -98,7 +98,7 @@ static void epping_ndev_uninit(struct net_device *dev)
epping_adapter_t *adapter;
adapter = netdev_priv(dev);
if (NULL == adapter) {
if (!adapter) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: EPPING adapter context is Null", __func__);
goto end;
@@ -113,7 +113,7 @@ static void epping_tx_queue_timeout(struct net_device *dev)
epping_adapter_t *adapter;
adapter = netdev_priv(dev);
if (NULL == adapter) {
if (!adapter) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: EPPING adapter context is Null", __func__);
goto end;
@@ -142,7 +142,7 @@ static netdev_tx_t epping_hard_start_xmit(struct sk_buff *skb,
int ret = 0;
adapter = netdev_priv(dev);
if (NULL == adapter) {
if (!adapter) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: EPPING adapter context is Null", __func__);
kfree_skb(skb);
@@ -159,7 +159,7 @@ static struct net_device_stats *epping_get_stats(struct net_device *dev)
{
epping_adapter_t *adapter = netdev_priv(dev);
if (NULL == adapter) {
if (!adapter) {
EPPING_LOG(QDF_TRACE_LEVEL_ERROR, "%s: adapter = NULL",
__func__);
return NULL;
@@ -174,7 +174,7 @@ static int epping_ndev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
int ret = 0;
adapter = netdev_priv(dev);
if (NULL == adapter) {
if (!adapter) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: EPPING adapter context is Null", __func__);
ret = -ENODEV;
@@ -363,7 +363,7 @@ epping_adapter_t *epping_add_adapter(epping_context_t *pEpping_ctx,
NET_NAME_UNKNOWN,
#endif
ether_setup);
if (dev == NULL) {
if (!dev) {
EPPING_LOG(QDF_TRACE_LEVEL_FATAL,
"%s: Cannot allocate epping_adapter_t\n", __func__);
return NULL;