summaryrefslogtreecommitdiff
path: root/include/sbi
diff options
context:
space:
mode:
authorDong Du <Dd_nirvana@sjtu.edu.cn>2021-08-27 17:46:28 +0300
committerAnup Patel <anup@brainfault.org>2021-09-03 09:29:35 +0300
commit1718b1642ee8c31eb2c49d78b5834e06f3324394 (patch)
tree9be55a03f345e11b6bd3fa1d2626e3d28ec621f1 /include/sbi
parentc2623065331a9ae93f7dbd9d1bc7b4d46d0415a6 (diff)
downloadopensbi-1718b1642ee8c31eb2c49d78b5834e06f3324394.tar.xz
lib: sbi: Checking fifo validness in sbi_fifo_is_empty and is_full
As other exported fifo functions, we should check whether the fifo is valid in sbi_fifo_is_empty and sbi_fifo_is_full. To this end, this patch changes the retval from bool to int, and the two functions will return SBI_EINVAL in the case the fifo is invalid. Signed-off-by: Dong Du <Dd_nirvana@sjtu.edu.cn> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'include/sbi')
-rw-r--r--include/sbi/sbi_fifo.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/sbi/sbi_fifo.h b/include/sbi/sbi_fifo.h
index bc8f8f6..1a85f07 100644
--- a/include/sbi/sbi_fifo.h
+++ b/include/sbi/sbi_fifo.h
@@ -33,8 +33,8 @@ int sbi_fifo_dequeue(struct sbi_fifo *fifo, void *data);
int sbi_fifo_enqueue(struct sbi_fifo *fifo, void *data);
void sbi_fifo_init(struct sbi_fifo *fifo, void *queue_mem, u16 entries,
u16 entry_size);
-bool sbi_fifo_is_empty(struct sbi_fifo *fifo);
-bool sbi_fifo_is_full(struct sbi_fifo *fifo);
+int sbi_fifo_is_empty(struct sbi_fifo *fifo);
+int sbi_fifo_is_full(struct sbi_fifo *fifo);
int sbi_fifo_inplace_update(struct sbi_fifo *fifo, void *in,
int (*fptr)(void *in, void *data));
u16 sbi_fifo_avail(struct sbi_fifo *fifo);