This commit changes custom implementation of CIRC_CNT_TO_END.
Just use the linux kernel header one to simplify code.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Copyright (C) 2009 Renesas Technology Corp.
*/
+#include <linux/circ_buf.h>
#include <linux/if_arp.h>
#include <net/iw_handler.h>
#include <uapi/linux/llc.h>
static inline unsigned int cnt_smeqbody(struct ks_wlan_private *priv)
{
- unsigned int sme_cnt = priv->sme_i.qtail - priv->sme_i.qhead;
-
- return (sme_cnt + SME_EVENT_BUFF_SIZE) % SME_EVENT_BUFF_SIZE;
+ return CIRC_CNT_TO_END(priv->sme_i.qhead, priv->sme_i.qtail,
+ SME_EVENT_BUFF_SIZE);
}
static inline u8 get_byte(struct ks_wlan_private *priv)