summaryrefslogtreecommitdiff
path: root/lib/kfifo.c
AgeCommit message (Collapse)AuthorFilesLines
2018-03-27kfifo: fix inaccurate commentMartin Kelly1-1/+1
The comment in __kfifo_alloc says we round down, but we actually round up, so correct it. Signed-off-by: Martin Kelly <mkelly@xevo.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-08-09kfifo: use BUG_ONHimangi Saraogi1-4/+2
Use BUG_ON(x) rather than if(x) BUG(); The semantic patch that fixes this problem is as follows: // <smpl> @@ identifier x; @@ -if (!x) BUG(); +BUG_ON(!x); // </smpl> Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Cc: Stefani Seibold <stefani@seibold.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-15kfifo: kfifo_copy_{to,from}_user: fix copied bytes calculationLars-Peter Clausen1-2/+2
'copied' and 'len' are in bytes, while 'ret' is in elements, so we need to multiply 'ret' with the size of one element to get the correct result. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Stefani Seibold <stefani@seibold.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-28kfifo: fix kfifo_alloc() and kfifo_init()Stefani Seibold1-4/+2
Fix kfifo_alloc() and kfifo_init() to alloc at least the requested number of elements. Since the kfifo operates on power of 2 the request size will be rounded up to the next power of two. Signed-off-by: Stefani Seibold <stefani@seibold.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-28kfifo: move kfifo.c from kernel/ to lib/Stefani Seibold1-0/+609
Move kfifo.c from kernel/ to lib/ Signed-off-by: Stefani Seibold <stefani@seibold.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>