浏览代码

qcacld-3.0: pmo: 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 pmo replace any such comparisons with logical
operations performed on the pointer itself.

Change-Id: I3697ede27e074252017e31be23caa93fc25885c5
CRs-Fixed: 2418398
Jeff Johnson 6 年之前
父节点
当前提交
361e1786c6

+ 3 - 3
components/pmo/core/src/wlan_pmo_lphb.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 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
@@ -42,7 +42,7 @@ static QDF_STATUS pmo_core_send_lphb_enable(struct wlan_objmgr_psoc *psoc,
 	struct pmo_lphb_enable_req *ts_lphb_enable;
 	int i;
 
-	if (lphb_conf_req == NULL) {
+	if (!lphb_conf_req) {
 		pmo_err("LPHB configuration is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
@@ -214,7 +214,7 @@ QDF_STATUS pmo_core_lphb_config_req(struct wlan_objmgr_psoc *psoc,
 {
 	struct pmo_psoc_priv_obj *psoc_ctx;
 
-	if (lphb_req == NULL) {
+	if (!lphb_req) {
 		pmo_err("LPHB configuration is NULL");
 		return QDF_STATUS_E_NULL_VALUE;
 	}

+ 1 - 1
components/pmo/core/src/wlan_pmo_main.c

@@ -31,7 +31,7 @@ static struct wlan_pmo_ctx *gp_pmo_ctx;
 QDF_STATUS pmo_allocate_ctx(void)
 {
 	/* If it is already created, ignore */
-	if (gp_pmo_ctx != NULL) {
+	if (gp_pmo_ctx) {
 		pmo_debug("already allocated pmo_ctx");
 		return QDF_STATUS_SUCCESS;
 	}

+ 2 - 2
components/pmo/dispatcher/src/wlan_pmo_obj_mgmt_api.c

@@ -157,7 +157,7 @@ QDF_STATUS pmo_psoc_object_created_notification(
 	}
 
 	psoc_ctx = qdf_mem_malloc(sizeof(*psoc_ctx));
-	if (psoc_ctx == NULL) {
+	if (!psoc_ctx) {
 		pmo_err("Failed to allocate pmo_psoc");
 		status = QDF_STATUS_E_NOMEM;
 		goto out;
@@ -241,7 +241,7 @@ QDF_STATUS pmo_vdev_object_created_notification(
 	psoc_ctx = pmo_psoc_get_priv(psoc);
 
 	vdev_ctx = qdf_mem_malloc(sizeof(*vdev_ctx));
-	if (vdev_ctx == NULL) {
+	if (!vdev_ctx) {
 		pmo_err("Failed to allocate vdev_ctx");
 		status = QDF_STATUS_E_NOMEM;
 		goto out;

+ 3 - 3
components/pmo/dispatcher/src/wlan_pmo_tgt_pkt_filter.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 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
@@ -50,7 +50,7 @@ QDF_STATUS pmo_tgt_set_pkt_filter(struct wlan_objmgr_vdev *vdev,
 
 	request_buf = qdf_mem_malloc(sizeof(*request_buf));
 
-	if (request_buf == NULL) {
+	if (!request_buf) {
 		pmo_err("Not able to allocate memory for Receive Filter Set Filter request");
 		status = QDF_STATUS_E_NOMEM;
 		goto out;
@@ -114,7 +114,7 @@ QDF_STATUS pmo_tgt_clear_pkt_filter(struct wlan_objmgr_vdev *vdev,
 
 	request_buf = qdf_mem_malloc(sizeof(*request_buf));
 
-	if (request_buf == NULL) {
+	if (!request_buf) {
 		pmo_err("Not able to allocate memory for Receive Filter Set Filter request");
 		status = QDF_STATUS_E_NOMEM;
 		goto out;