[1/3] alfred: vis: Use debugfs_make_path helper

Message ID 1453953196-29943-1-git-send-email-andrew@lunn.ch (mailing list archive)
State Accepted, archived
Commit dca3ebf5e44e421f5b5c9ac29efa61021d9b6bcb
Delegated to: Simon Wunderlich
Headers

Commit Message

Andrew Lunn Jan. 28, 2016, 3:53 a.m. UTC
  By using the helper, knowledge of network namespaces can be kept to
within the helper.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
---
 vis/vis.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Simon Wunderlich March 11, 2016, 1:48 p.m. UTC | #1
On Thursday 28 January 2016 04:53:13 Andrew Lunn wrote:
> By using the helper, knowledge of network namespaces can be kept to
> within the helper.

I've applied this one, since its a good change even without the namespace 
changes.

Applied in revision dca3ebf

Thanks!
      Simon
  

Patch

diff --git a/vis/vis.c b/vis/vis.c
index c1f8dad..d1640b6 100644
--- a/vis/vis.c
+++ b/vis/vis.c
@@ -325,7 +325,7 @@  static int parse_orig_list(struct globals *globals)
 	char path[1024];
 	struct vis_list_entry *v_entry;
 
-	snprintf(path, sizeof(path), "/sys/kernel/debug/batman_adv/%s/originators", globals->interface);
+	debugfs_make_path(DEBUG_BATIF_PATH_FMT "/" "originators", globals->interface, path, sizeof(path));
 	fbuf = read_file(path);
 	if (!fbuf)
 		return -1;