From 06476ce1df2c403d31be3e1b6c336dfa631c1cc3 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Mon, 18 Mar 2019 14:02:49 -0700 Subject: [PATCH] qcacld-3.0: disa: 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 disa replace any such comparisons with logical operations performed on the pointer itself. Change-Id: Id25e4748819d206e361a55532a5ccfd648744b15 CRs-Fixed: 2418403 --- components/disa/core/src/wlan_disa_main.c | 4 ++-- components/disa/dispatcher/src/wlan_disa_obj_mgmt_api.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/disa/core/src/wlan_disa_main.c b/components/disa/core/src/wlan_disa_main.c index 73033944d732..86431bf3fb10 100644 --- a/components/disa/core/src/wlan_disa_main.c +++ b/components/disa/core/src/wlan_disa_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-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 @@ -29,7 +29,7 @@ static struct wlan_disa_ctx *gp_disa_ctx; QDF_STATUS disa_allocate_ctx(void) { /* If it is already created, ignore */ - if (gp_disa_ctx != NULL) { + if (gp_disa_ctx) { disa_debug("already allocated disa_ctx"); return QDF_STATUS_SUCCESS; } diff --git a/components/disa/dispatcher/src/wlan_disa_obj_mgmt_api.c b/components/disa/dispatcher/src/wlan_disa_obj_mgmt_api.c index 7c6a1feca270..885ab982ef6c 100644 --- a/components/disa/dispatcher/src/wlan_disa_obj_mgmt_api.c +++ b/components/disa/dispatcher/src/wlan_disa_obj_mgmt_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-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 @@ -128,7 +128,7 @@ QDF_STATUS disa_psoc_object_created_notification( DISA_ENTER(); disa_priv = qdf_mem_malloc(sizeof(*disa_priv)); - if (disa_priv == NULL) { + if (!disa_priv) { disa_err("Failed to allocate disa_priv"); status = QDF_STATUS_E_NOMEM; goto out;