Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4671375ybf; Wed, 4 Mar 2020 08:24:38 -0800 (PST) X-Google-Smtp-Source: ADFU+vtM2Jnu6/cuSEfVeuRF/W0GNYrhGwRXfnib0CtJlApmDMGAH4kPVIptA99JDqpWFW6vOKct X-Received: by 2002:a9d:6b87:: with SMTP id b7mr3068487otq.248.1583339078118; Wed, 04 Mar 2020 08:24:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583339078; cv=none; d=google.com; s=arc-20160816; b=uK/hzNlXqINMEBXb6GkmrYfNNj20HPeAOoc6p5cg/WH+jBGlKd8NHhURH2v7SmtVao oitMgTHURQ6kF/H3/pUejAMNSzSTk5oh1fMmCSoLgsnmGLWevjLDZ7JGNvIoQYFq13FY NUzNeaJFdIBua3qjUoTM5SeAjwfYv+c5DiROD9Pt5criFH34EgfYUdF4bCxFpCKWofv/ nE6/3F+fCPoDgQ9a+nII1sgYKrP17kzXCluretLKLeL8kN0hXwiVF2kJBibBOYlg2yTJ 8EEonC3f16yLRfSB7Du2b/u1JKhjqVup5tUFfkY+WG5vk2ezTZ9as1HKBA0Xm4gRD+La pguw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id; bh=HmVHlIPY0Y7kTSKIRtJ6j4PltyvDrGxNsYcmCRHda3Q=; b=HBwco59r8LbU6x5SdPJDJUcJPXf5mgSozrpc5a8Snhd+QKOhnHi92KB7jEcB2tZxlm mHJ1EG6QwefRujrFJWmTt93DaA7tjzB7sIncRcOoRAlkRLogxOCUgZBqC5WuP++1NSLR wdjoAP9rMFvqNq8qnxVN56JMYp8X+5iMxQAPlV7Lhv3PLXvYQes5qdX3TkSqbFt0TEtf 6I58ai9nFDObK76FEpylNRx07GZCN3CKYdWHVg0hRw06nw40njRjqNwJ1ud5n+Aejc+M jl/5jOWjhS4bBGoS2hf/gts9gyNH0rOhaV9huIClr6rC+/QM6+7ZPPb7KKcrZDq00O7A FvqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t25si1477526oic.183.2020.03.04.08.24.26; Wed, 04 Mar 2020 08:24:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388183AbgCDQYI (ORCPT + 99 others); Wed, 4 Mar 2020 11:24:08 -0500 Received: from mx2.suse.de ([195.135.220.15]:42236 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729906AbgCDQYH (ORCPT ); Wed, 4 Mar 2020 11:24:07 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5F335B486; Wed, 4 Mar 2020 16:24:05 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id E48B6E037F; Wed, 4 Mar 2020 17:24:04 +0100 (CET) Message-Id: In-Reply-To: References: From: Michal Kubecek Subject: [PATCH net-next 2/5] tun: get rid of DBG1() macro To: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Date: Wed, 4 Mar 2020 17:24:04 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/tun.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index ea64c311a554..59290ef07497 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -79,29 +79,17 @@ static void tun_default_link_ksettings(struct net_device *dev, /* #define TUN_DEBUG 1 */ #ifdef TUN_DEBUG -static int debug; - #define tun_debug(level, tun, fmt, args...) \ do { \ if (tun->debug) \ netdev_printk(level, tun->dev, fmt, ##args); \ } while (0) -#define DBG1(level, fmt, args...) \ -do { \ - if (debug == 2) \ - printk(level fmt, ##args); \ -} while (0) #else #define tun_debug(level, tun, fmt, args...) \ do { \ if (0) \ netdev_printk(level, tun->dev, fmt, ##args); \ } while (0) -#define DBG1(level, fmt, args...) \ -do { \ - if (0) \ - printk(level fmt, ##args); \ -} while (0) #endif #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 tun_file *tfile; - DBG1(KERN_INFO, "tunX: tun_chr_open\n"); - tfile = (struct tun_file *)sk_alloc(net, AF_UNSPEC, GFP_KERNEL, &tun_proto, 0); if (!tfile) -- 2.25.1