mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 10:39:08 +00:00
bug.h: move runtime BUG/WARN macros into <linux/bug.h>
Collect runtime BUG/WARN into a self-contained header <linux/bug.h> to make these macros easier to use. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
parent
059a48096c
commit
0a70fb4c1c
4 changed files with 29 additions and 24 deletions
|
@ -87,21 +87,6 @@ static inline void kmem_cache_destroy(struct kmem_cache *cachep)
|
|||
|
||||
#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
||||
|
||||
#ifndef BUG
|
||||
#define BUG() do { \
|
||||
printf("U-Boot BUG at %s:%d!\n", __FILE__, __LINE__); \
|
||||
} while (0)
|
||||
|
||||
#define BUG_ON(condition) do { if (condition) BUG(); } while(0)
|
||||
#endif /* BUG */
|
||||
|
||||
#define WARN_ON(condition) ({ \
|
||||
int __ret_warn_on = !!(condition); \
|
||||
if (unlikely(__ret_warn_on)) \
|
||||
printf("WARNING in %s line %d\n", __FILE__, __LINE__); \
|
||||
unlikely(__ret_warn_on); \
|
||||
})
|
||||
|
||||
#define PAGE_SIZE 4096
|
||||
|
||||
/* drivers/char/random.c */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue