mirror of
https://github.com/opnsense/src.git
synced 2026-06-03 22:02:58 -04:00
LinuxKPI: add no_printk
Add a version of no_printk(), which seems to be there to have format
string checking while never calling the printk. It seems a very weird
thing and it needs a return code and for some reason my initial
while (0) { } version hadn't worked while porting over new code but
could have been further downstream format string problems.
if (0) seems to do the job though I would have expected that to more
likely simply get optimised out without any futher format checking.
Sponsored by: The FreeBSD Foundation
Reviewed by: emaste
Differential Revision: https://reviews.freebsd.org/D46463
(cherry picked from commit 1847e63d63f440cfcb2f4ee2c2ee8990f0272d88)
This commit is contained in:
parent
6dedd620cf
commit
cedae002cb
1 changed files with 7 additions and 0 deletions
|
|
@ -125,4 +125,11 @@ print_hex_dump_bytes(const char *prefix_str, const int prefix_type,
|
|||
#define pr_info_ratelimited(fmt, ...) \
|
||||
printk_ratelimited(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__)
|
||||
|
||||
#define no_printk(fmt, ...) \
|
||||
({ \
|
||||
if (0) \
|
||||
printk(pr_fmt(fmt), ##__VA_ARGS__); \
|
||||
0; \
|
||||
})
|
||||
|
||||
#endif /* _LINUXKPI_LINUX_PRINTK_H_ */
|
||||
|
|
|
|||
Loading…
Reference in a new issue