1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /* ZD1211 USB-WLAN driver for Linux
4 * Copyright (C) 2005-2007 Ulrich Kunitz <kune@deine-taler.de>
5 * Copyright (C) 2006-2007 Daniel Drake <dsd@gentoo.org>
11 #include <linux/kernel.h>
12 #include <linux/stringify.h>
13 #include <linux/device.h>
15 typedef u16 __nocast zd_addr_t;
17 #define dev_printk_f(level, dev, fmt, args...) \
18 dev_printk(level, dev, "%s() " fmt, __func__, ##args)
21 # define dev_dbg_f(dev, fmt, args...) \
22 dev_printk_f(KERN_DEBUG, dev, fmt, ## args)
23 # define dev_dbg_f_limit(dev, fmt, args...) do { \
24 if (net_ratelimit()) \
25 dev_printk_f(KERN_DEBUG, dev, fmt, ## args); \
27 # define dev_dbg_f_cond(dev, cond, fmt, args...) ({ \
28 bool __cond = !!(cond); \
29 if (unlikely(__cond)) \
30 dev_printk_f(KERN_DEBUG, dev, fmt, ## args); \
33 # define dev_dbg_f(dev, fmt, args...) do { (void)(dev); } while (0)
34 # define dev_dbg_f_limit(dev, fmt, args...) do { (void)(dev); } while (0)
35 # define dev_dbg_f_cond(dev, cond, fmt, args...) do { (void)(dev); } while (0)
39 # define ZD_ASSERT(x) \
41 if (unlikely(!(x))) { \
42 pr_debug("%s:%d ASSERT %s VIOLATED!\n", \
43 __FILE__, __LINE__, __stringify(x)); \
48 # define ZD_ASSERT(x) do { } while (0)
52 # define ZD_MEMCLEAR(pointer, size) memset((pointer), 0xff, (size))
54 # define ZD_MEMCLEAR(pointer, size) do { } while (0)
57 #endif /* _ZD_DEF_H */