mirror of https://gitee.com/openkylin/linux.git
staging: rtl8188eu: Remove unused functions rtw_cbuf_[full, empty, push, pop]()
Signed-off-by: navin patidar <navin.patidar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1e28b63db9
commit
67db20f0bb
|
@ -194,10 +194,4 @@ struct rtw_cbuf {
|
|||
u32 size;
|
||||
void *bufs[0];
|
||||
};
|
||||
|
||||
bool rtw_cbuf_full(struct rtw_cbuf *cbuf);
|
||||
bool rtw_cbuf_empty(struct rtw_cbuf *cbuf);
|
||||
bool rtw_cbuf_push(struct rtw_cbuf *cbuf, void *buf);
|
||||
void *rtw_cbuf_pop(struct rtw_cbuf *cbuf);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -163,68 +163,3 @@ void rtw_buf_update(u8 **buf, u32 *buf_len, u8 *src, u32 src_len)
|
|||
/* free ori */
|
||||
kfree(ori);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* rtw_cbuf_full - test if cbuf is full
|
||||
* @cbuf: pointer of struct rtw_cbuf
|
||||
*
|
||||
* Returns: true if cbuf is full
|
||||
*/
|
||||
inline bool rtw_cbuf_full(struct rtw_cbuf *cbuf)
|
||||
{
|
||||
return (cbuf->write == cbuf->read-1) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_cbuf_empty - test if cbuf is empty
|
||||
* @cbuf: pointer of struct rtw_cbuf
|
||||
*
|
||||
* Returns: true if cbuf is empty
|
||||
*/
|
||||
inline bool rtw_cbuf_empty(struct rtw_cbuf *cbuf)
|
||||
{
|
||||
return (cbuf->write == cbuf->read) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_cbuf_push - push a pointer into cbuf
|
||||
* @cbuf: pointer of struct rtw_cbuf
|
||||
* @buf: pointer to push in
|
||||
*
|
||||
* Lock free operation, be careful of the use scheme
|
||||
* Returns: true push success
|
||||
*/
|
||||
bool rtw_cbuf_push(struct rtw_cbuf *cbuf, void *buf)
|
||||
{
|
||||
if (rtw_cbuf_full(cbuf))
|
||||
return _FAIL;
|
||||
|
||||
if (0)
|
||||
DBG_88E("%s on %u\n", __func__, cbuf->write);
|
||||
cbuf->bufs[cbuf->write] = buf;
|
||||
cbuf->write = (cbuf->write+1)%cbuf->size;
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_cbuf_pop - pop a pointer from cbuf
|
||||
* @cbuf: pointer of struct rtw_cbuf
|
||||
*
|
||||
* Lock free operation, be careful of the use scheme
|
||||
* Returns: pointer popped out
|
||||
*/
|
||||
void *rtw_cbuf_pop(struct rtw_cbuf *cbuf)
|
||||
{
|
||||
void *buf;
|
||||
if (rtw_cbuf_empty(cbuf))
|
||||
return NULL;
|
||||
|
||||
if (0)
|
||||
DBG_88E("%s on %u\n", __func__, cbuf->read);
|
||||
buf = cbuf->bufs[cbuf->read];
|
||||
cbuf->read = (cbuf->read+1)%cbuf->size;
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue