Skip to content
Snippets Groups Projects
Commit fd702902 authored by Simon Glass's avatar Simon Glass
Browse files

Update WARN_ON() to return a value


In linux v4.9 this returns a value. This saves checking the warning
condition twice in some code.

Update the U-Boot version to do this also.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent 01b120b6
No related branches found
No related tags found
No related merge requests found
...@@ -106,8 +106,12 @@ static inline void kmem_cache_destroy(struct kmem_cache *cachep) ...@@ -106,8 +106,12 @@ static inline void kmem_cache_destroy(struct kmem_cache *cachep)
#define BUG_ON(condition) do { if (condition) BUG(); } while(0) #define BUG_ON(condition) do { if (condition) BUG(); } while(0)
#endif /* BUG */ #endif /* BUG */
#define WARN_ON(x) if (x) {printf("WARNING in %s line %d\n" \ #define WARN_ON(condition) ({ \
, __FILE__, __LINE__); } 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 #define PAGE_SIZE 4096
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment