11 #include <linux/kernel.h> 23 max_nr_entries *
sizeof(
void *)));
36 return pstack->
top == 0;
41 unsigned short i = pstack->
top, last_index = pstack->
top - 1;
44 if (pstack->
entries[i] == key) {
48 (last_index - i) *
sizeof(
void *));
53 pr_err(
"%s: %p not on the pstack!\n", __func__, key);
59 pr_err(
"%s: top=%d, overflow!\n", __func__, pstack->
top);
69 if (pstack->
top == 0) {
70 pr_err(
"%s: underflow!\n", __func__);
struct pstack * pstack__new(unsigned short max_nr_entries)
void * pstack__pop(struct pstack *pstack)
void pstack__remove(struct pstack *pstack, void *key)
void pstack__push(struct pstack *pstack, void *key)
void pstack__delete(struct pstack *pstack)
bool pstack__empty(const struct pstack *pstack)
unsigned short max_nr_entries
void * pstack__peek(struct pstack *pstack)
void static void * zalloc(size_t size)