diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-12-15 08:25:16 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-12-15 08:25:16 +0100 |
commit | a2501c9e889abd22b47d42956d27b02607dbb0d8 (patch) | |
tree | f30b5c829fe0adcc784c143aaf436abb6eb9724d /include | |
parent | abad1451586d8e8b36f86ef2772cef81d4ce2651 (diff) | |
parent | 2962e19b55e970c7a2f1b0048abf1ef95463c6f5 (diff) | |
download | barebox-a2501c9e889abd22b47d42956d27b02607dbb0d8.tar.gz barebox-a2501c9e889abd22b47d42956d27b02607dbb0d8.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'include')
-rw-r--r-- | include/crc.h | 1 | ||||
-rw-r--r-- | include/debug_ll/ns16550.h | 2 | ||||
-rw-r--r-- | include/efi/efi-stdio.h | 2 | ||||
-rw-r--r-- | include/linux/build_bug.h | 19 | ||||
-rw-r--r-- | include/linux/printk.h | 12 |
5 files changed, 34 insertions, 2 deletions
diff --git a/include/crc.h b/include/crc.h index eb972705c2..a5204aaabb 100644 --- a/include/crc.h +++ b/include/crc.h @@ -36,6 +36,7 @@ static inline u16 crc_itu_t_byte(u16 crc, const u8 data) #endif uint32_t crc32(uint32_t, const void *, unsigned int); +uint32_t crc32_be(uint32_t, const void *, unsigned int); uint32_t crc32_no_comp(uint32_t, const void *, unsigned int); int file_crc(char *filename, unsigned long start, unsigned long size, unsigned long *crc, unsigned long *total); diff --git a/include/debug_ll/ns16550.h b/include/debug_ll/ns16550.h index 7e4dbeb453..373c917d86 100644 --- a/include/debug_ll/ns16550.h +++ b/include/debug_ll/ns16550.h @@ -43,7 +43,7 @@ static inline uint16_t debug_ll_ns16550_calc_divisor(unsigned long clk) static inline void debug_ll_ns16550_init(uint16_t divisor) { debug_ll_write_reg(NS16550_LCR, 0x0); /* select ier reg */ - debug_ll_write_reg(0x00, NS16550_IER); + debug_ll_write_reg(NS16550_IER, 0x0); /* disable interrupts */ debug_ll_write_reg(NS16550_LCR, NS16550_LCR_BKSE); debug_ll_write_reg(NS16550_DLL, divisor & 0xff); diff --git a/include/efi/efi-stdio.h b/include/efi/efi-stdio.h index 4086604e43..66fb0afc36 100644 --- a/include/efi/efi-stdio.h +++ b/include/efi/efi-stdio.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +/* SPDX-License-Identifier: GPL-2.0-only */ #ifndef EFI_STDIO_H_ #define EFI_STDIO_H_ diff --git a/include/linux/build_bug.h b/include/linux/build_bug.h index 43d1fd50d4..40cd504f63 100644 --- a/include/linux/build_bug.h +++ b/include/linux/build_bug.h @@ -80,4 +80,23 @@ #endif /* __CHECKER__ */ +/** + * static_assert - check integer constant expression at build time + * + * static_assert() is a wrapper for the C11 _Static_assert, with a + * little macro magic to make the message optional (defaulting to the + * stringification of the tested expression). + * + * Contrary to BUILD_BUG_ON(), static_assert() can be used at global + * scope, but requires the expression to be an integer constant + * expression (i.e., it is not enough that __builtin_constant_p() is + * true for expr). + * + * Also note that BUILD_BUG_ON() fails the build if the condition is + * true, while static_assert() fails the build if the expression is + * false. + */ +#define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr) +#define __static_assert(expr, msg, ...) _Static_assert(expr, msg) + #endif /* _LINUX_BUILD_BUG_H */ diff --git a/include/linux/printk.h b/include/linux/printk.h index aab9c89639..39523b0572 100644 --- a/include/linux/printk.h +++ b/include/linux/printk.h @@ -75,6 +75,18 @@ static inline int pr_print(int level, const char *format, ...) #define dev_vdbg(dev, format, arg...) \ __dev_printf(8, (dev) , format , ## arg) +#if LOGLEVEL >= MSG_ERR +int dev_err_probe(const struct device_d *dev, int err, const char *fmt, ...) + __attribute__ ((format(__printf__, 3, 4))); +#elif !defined(dev_err_probe) +static int dev_err_probe(const struct device_d *dev, int err, const char *fmt, ...) + __attribute__ ((format(__printf__, 3, 4))); +static inline int dev_err_probe(const struct device_d *dev, int err, const char *fmt, ...) +{ + return err; +} +#endif + #define __pr_printk(level, format, args...) \ ({ \ (level) <= LOGLEVEL ? pr_print((level), (format), ##args) : 0; \ |