tun: get rid of DBG1() macro
This macro is no-op unless TUN_DEBUG is defined (which requires editing and recompiling the source) and only does something if variable debug is 2 but that variable is zero initialized and never set to anything else. Moreover, the only use of the macro informs about entering function tun_chr_open() which can be easily achieved using ftrace or kprobe. Drop DBG1() macro, its only use and global variable debug. Signed-off-by: Michal Kubecek <mkubecek@suse.cz> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
516c512bde
commit
7522416d25
|
@ -79,29 +79,17 @@ static void tun_default_link_ksettings(struct net_device *dev,
|
||||||
/* #define TUN_DEBUG 1 */
|
/* #define TUN_DEBUG 1 */
|
||||||
|
|
||||||
#ifdef TUN_DEBUG
|
#ifdef TUN_DEBUG
|
||||||
static int debug;
|
|
||||||
|
|
||||||
#define tun_debug(level, tun, fmt, args...) \
|
#define tun_debug(level, tun, fmt, args...) \
|
||||||
do { \
|
do { \
|
||||||
if (tun->debug) \
|
if (tun->debug) \
|
||||||
netdev_printk(level, tun->dev, fmt, ##args); \
|
netdev_printk(level, tun->dev, fmt, ##args); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define DBG1(level, fmt, args...) \
|
|
||||||
do { \
|
|
||||||
if (debug == 2) \
|
|
||||||
printk(level fmt, ##args); \
|
|
||||||
} while (0)
|
|
||||||
#else
|
#else
|
||||||
#define tun_debug(level, tun, fmt, args...) \
|
#define tun_debug(level, tun, fmt, args...) \
|
||||||
do { \
|
do { \
|
||||||
if (0) \
|
if (0) \
|
||||||
netdev_printk(level, tun->dev, fmt, ##args); \
|
netdev_printk(level, tun->dev, fmt, ##args); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#define DBG1(level, fmt, args...) \
|
|
||||||
do { \
|
|
||||||
if (0) \
|
|
||||||
printk(level fmt, ##args); \
|
|
||||||
} while (0)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TUN_RX_PAD (NET_IP_ALIGN + NET_SKB_PAD)
|
#define TUN_RX_PAD (NET_IP_ALIGN + NET_SKB_PAD)
|
||||||
|
@ -3415,8 +3403,6 @@ static int tun_chr_open(struct inode *inode, struct file * file)
|
||||||
struct net *net = current->nsproxy->net_ns;
|
struct net *net = current->nsproxy->net_ns;
|
||||||
struct tun_file *tfile;
|
struct tun_file *tfile;
|
||||||
|
|
||||||
DBG1(KERN_INFO, "tunX: tun_chr_open\n");
|
|
||||||
|
|
||||||
tfile = (struct tun_file *)sk_alloc(net, AF_UNSPEC, GFP_KERNEL,
|
tfile = (struct tun_file *)sk_alloc(net, AF_UNSPEC, GFP_KERNEL,
|
||||||
&tun_proto, 0);
|
&tun_proto, 0);
|
||||||
if (!tfile)
|
if (!tfile)
|
||||||
|
|
Loading…
Reference in New Issue