Browse Source

qcacmn: Add MACRO qdf_ceil

Add MACRO qdf_ceil(x, y) as DIV_ROUND_UP(x, y)

Change-Id: I92ecffbaf29c43809712e2b950a8064890e98136
CRs-Fixed: 2807611
Jianmin Zhu 4 years ago
parent
commit
6ce6be5c32
2 changed files with 10 additions and 0 deletions
  1. 9 0
      qdf/inc/qdf_util.h
  2. 1 0
      qdf/linux/src/i_qdf_util.h

+ 9 - 0
qdf/inc/qdf_util.h

@@ -290,6 +290,15 @@ typedef __qdf_wait_queue_head_t qdf_wait_queue_head_t;
  */
  */
 #define qdf_roundup(x, y) __qdf_roundup(x, y)
 #define qdf_roundup(x, y) __qdf_roundup(x, y)
 
 
+/**
+ * qdf_ceil() - roundup of x/y
+ * @x: dividend
+ * @y: divisor
+ *
+ * Return: rounded value
+ */
+#define qdf_ceil(x, y) __qdf_ceil(x, y)
+
 /**
 /**
  * qdf_is_macaddr_equal() - compare two QDF MacAddress
  * qdf_is_macaddr_equal() - compare two QDF MacAddress
  * @mac_addr1: Pointer to one qdf MacAddress to compare
  * @mac_addr1: Pointer to one qdf MacAddress to compare

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

@@ -267,6 +267,7 @@ static inline bool __qdf_is_macaddr_equal(struct qdf_mac_addr *mac_addr1,
 #define __qdf_iowrite32(offset, value)     iowrite32(value, offset)
 #define __qdf_iowrite32(offset, value)     iowrite32(value, offset)
 
 
 #define __qdf_roundup(x, y) roundup(x, y)
 #define __qdf_roundup(x, y) roundup(x, y)
+#define __qdf_ceil(x, y) DIV_ROUND_UP(x, y)
 
 
 #if LINUX_VERSION_CODE  < KERNEL_VERSION(4, 3, 0)
 #if LINUX_VERSION_CODE  < KERNEL_VERSION(4, 3, 0)
 #define  __qdf_ewma_tx_lag_init(tx_lag)
 #define  __qdf_ewma_tx_lag_init(tx_lag)