Commit 5089cd41 authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman

staging: ks7010: use CIRC_CNT_TO_END macro in cnt_smeqbody

This commit changes custom implementation of CIRC_CNT_TO_END.
Just use the linux kernel header one to simplify code.
Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 203ad5a1
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
* Copyright (C) 2009 Renesas Technology Corp. * Copyright (C) 2009 Renesas Technology Corp.
*/ */
#include <linux/circ_buf.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <net/iw_handler.h> #include <net/iw_handler.h>
#include <uapi/linux/llc.h> #include <uapi/linux/llc.h>
...@@ -26,9 +27,8 @@ static inline void inc_smeqtail(struct ks_wlan_private *priv) ...@@ -26,9 +27,8 @@ static inline void inc_smeqtail(struct ks_wlan_private *priv)
static inline unsigned int cnt_smeqbody(struct ks_wlan_private *priv) static inline unsigned int cnt_smeqbody(struct ks_wlan_private *priv)
{ {
unsigned int sme_cnt = priv->sme_i.qtail - priv->sme_i.qhead; return CIRC_CNT_TO_END(priv->sme_i.qhead, priv->sme_i.qtail,
SME_EVENT_BUFF_SIZE);
return (sme_cnt + SME_EVENT_BUFF_SIZE) % SME_EVENT_BUFF_SIZE;
} }
static inline u8 get_byte(struct ks_wlan_private *priv) static inline u8 get_byte(struct ks_wlan_private *priv)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment