From patchwork Thu Sep 1 08:25:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 16670 X-Patchwork-Delegate: sven@narfation.org Return-Path: X-Original-To: patchwork@open-mesh.org Delivered-To: patchwork@open-mesh.org Received: from open-mesh.org (localhost [IPv6:::1]) by open-mesh.org (Postfix) with ESMTP id 0290D81BA3; Thu, 1 Sep 2016 10:25:19 +0200 (CEST) Authentication-Results: open-mesh.org; dmarc=none header.from=narfation.org Authentication-Results: open-mesh.org; dkim=fail reason="verification failed; unprotected key" header.d=narfation.org header.i=@narfation.org header.b=bV0TOy5U; dkim-adsp=fail (unprotected policy); dkim-atps=neutral Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=79.140.41.39; helo=v3-1039.vlinux.de; envelope-from=sven@narfation.org; receiver=b.a.t.m.a.n@lists.open-mesh.org Authentication-Results: open-mesh.org; dmarc=pass header.from=narfation.org Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id C184280868 for ; Thu, 1 Sep 2016 10:25:16 +0200 (CEST) Received: from sven-desktop.home.narfation.org (p2003007C6F0349FEB4D52CF11ED177AC.dip0.t-ipconnect.de [IPv6:2003:7c:6f03:49fe:b4d5:2cf1:1ed1:77ac]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 31ADA1100B0; Thu, 1 Sep 2016 10:25:16 +0200 (CEST) Authentication-Results: v3-1039.vlinux.de; dmarc=none header.from=narfation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=narfation.org; s=20121; t=1472718316; bh=KcacgNXQyJNMEVWzAHHmRpSHIMDhtZ6afWLU+4hEgJ4=; h=From:To:Cc:Subject:Date:From; b=bV0TOy5Ui88D4Ai2nVCpJuEB6r3ifwdNkP/e4AnjEqCNMAkcuohrXFkL501BSgjBI JBXM4g8jQg9ohbX+5mZGURg1W+kXn2eueK6dfFs1JeN/21pCNE6CmQguKQuowupGW8 caoic8VfB9nMRPgGi189gQvPartIpMSXNYjj7p2E= From: Sven Eckelmann To: b.a.t.m.a.n@lists.open-mesh.org Date: Thu, 1 Sep 2016 10:25:12 +0200 Message-Id: <20160901082512.16160-1-sven@narfation.org> X-Mailer: git-send-email 2.9.3 Subject: [B.A.T.M.A.N.] [PATCH v2] batman-adv: Use octal permissions instead of macros X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking Errors-To: b.a.t.m.a.n-bounces@lists.open-mesh.org Sender: "B.A.T.M.A.N" Linus prefers to have octal permission numbers instead of combinations of macro names ("random line noise"). Also old existing "bad symbolic permission bit macro use" should be converted to octal numbers. (http://lkml.kernel.org/r/CA+55aFw5v23T-zvDZp-MmD_EYxF8WbafwwB59934FV7g21uMGQ@mail.gmail.com) Also remove the S_IFREG bit from the octal representation because it is filtered out by debugfs_create. Signed-off-by: Sven Eckelmann --- v2: - fix error in patch subject --- net/batman-adv/icmp_socket.c | 4 ++-- net/batman-adv/log.c | 3 +-- net/batman-adv/network-coding.c | 7 +++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/net/batman-adv/icmp_socket.c b/net/batman-adv/icmp_socket.c index 378cc11..aed8125 100644 --- a/net/batman-adv/icmp_socket.c +++ b/net/batman-adv/icmp_socket.c @@ -322,8 +322,8 @@ int batadv_socket_setup(struct batadv_priv *bat_priv) if (!bat_priv->debug_dir) goto err; - d = debugfs_create_file(BATADV_ICMP_SOCKET, S_IFREG | S_IWUSR | S_IRUSR, - bat_priv->debug_dir, bat_priv, &batadv_fops); + d = debugfs_create_file(BATADV_ICMP_SOCKET, 0600, bat_priv->debug_dir, + bat_priv, &batadv_fops); if (!d) goto err; diff --git a/net/batman-adv/log.c b/net/batman-adv/log.c index 56dc532..46b0725 100644 --- a/net/batman-adv/log.c +++ b/net/batman-adv/log.c @@ -212,8 +212,7 @@ int batadv_debug_log_setup(struct batadv_priv *bat_priv) spin_lock_init(&bat_priv->debug_log->lock); init_waitqueue_head(&bat_priv->debug_log->queue_wait); - d = debugfs_create_file("log", S_IFREG | S_IRUSR, - bat_priv->debug_dir, bat_priv, + d = debugfs_create_file("log", 0400, bat_priv->debug_dir, bat_priv, &batadv_log_fops); if (!d) goto err; diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c index e3baf69..0fc3b5f 100644 --- a/net/batman-adv/network-coding.c +++ b/net/batman-adv/network-coding.c @@ -1961,17 +1961,16 @@ int batadv_nc_init_debugfs(struct batadv_priv *bat_priv) if (!nc_dir) goto out; - file = debugfs_create_u8("min_tq", S_IRUGO | S_IWUSR, nc_dir, - &bat_priv->nc.min_tq); + file = debugfs_create_u8("min_tq", 0644, nc_dir, &bat_priv->nc.min_tq); if (!file) goto out; - file = debugfs_create_u32("max_fwd_delay", S_IRUGO | S_IWUSR, nc_dir, + file = debugfs_create_u32("max_fwd_delay", 0644, nc_dir, &bat_priv->nc.max_fwd_delay); if (!file) goto out; - file = debugfs_create_u32("max_buffer_time", S_IRUGO | S_IWUSR, nc_dir, + file = debugfs_create_u32("max_buffer_time", 0644, nc_dir, &bat_priv->nc.max_buffer_time); if (!file) goto out;