[ovs-dev] [PATCH v2 1/6] vlog: Make 'vlog_modules' private to vlog.c.

Ben Pfaff blp at ovn.org
Wed Feb 3 21:50:06 UTC 2016


I think we once used this variable from an inline function in vlog.h, so
that we had to make it "extern", but these days it's only used from vlog.c,
so it can be static now.

Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 include/openvswitch/vlog.h | 5 +----
 lib/vlog.c                 | 4 ++--
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/include/openvswitch/vlog.h b/include/openvswitch/vlog.h
index 5309602..739c049 100644
--- a/include/openvswitch/vlog.h
+++ b/include/openvswitch/vlog.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2016 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -86,9 +86,6 @@ struct vlog_module {
     bool honor_rate_limits;       /* Set false to ignore rate limits. */
 };
 
-/* Global list of all logging modules */
-extern struct ovs_list vlog_modules;
-
 void vlog_insert_module(struct ovs_list *);
 
 /* Creates and initializes a global instance of a module named MODULE. */
diff --git a/lib/vlog.c b/lib/vlog.c
index 28cea5d..3d0b87c 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2015, 2016 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@ VLOG_LEVELS
 BUILD_ASSERT_DECL(LOG_LOCAL0 == (16 << 3));
 
 /* The log modules. */
-struct ovs_list vlog_modules = OVS_LIST_INITIALIZER(&vlog_modules);
+static struct ovs_list vlog_modules = OVS_LIST_INITIALIZER(&vlog_modules);
 
 /* Protects the 'pattern' in all "struct destination"s, so that a race between
  * changing and reading the pattern does not cause an access to freed
-- 
2.1.3




More information about the dev mailing list