Переглянути джерело

qcacmn: Add support to get absolute value

Add qdf API to get absolute value

Change-Id: Ib543cd5b53a48f6f7209bd95827b32041a34d3fe
CRs-Fixed: 3310875
Amrit 2 роки тому
батько
коміт
ba6c849571
2 змінених файлів з 7 додано та 1 видалено
  1. 5 0
      qdf/inc/qdf_util.h
  2. 2 1
      qdf/linux/src/i_qdf_util.h

+ 5 - 0
qdf/inc/qdf_util.h

@@ -500,6 +500,11 @@ static inline uint8_t *qdf_get_u32(uint8_t *ptr, uint32_t *value)
 	return ptr + 4;
 }
 
+/**
+ * qdf_abs - Get absolute value
+ */
+#define qdf_abs(x)                           __qdf_abs(x)
+
 /**
  * qdf_ntohs - Convert a 16-bit value from network byte order to host byte order
  */

+ 2 - 1
qdf/linux/src/i_qdf_util.h

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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
@@ -266,6 +266,7 @@ static inline bool __qdf_is_macaddr_equal(struct qdf_mac_addr *mac_addr1,
 
 #define __qdf_roundup(x, y) roundup(x, y)
 #define __qdf_ceil(x, y) DIV_ROUND_UP(x, y)
+#define __qdf_abs(x) abs(x)
 
 #if LINUX_VERSION_CODE  < KERNEL_VERSION(4, 3, 0)
 #define  __qdf_ewma_tx_lag_init(tx_lag)