
From: Chris Wright <chrisw@osdl.org>

With gcc-3.5 from CVS:

security/selinux/avc.c:76: error: static declaration of 'avc_cache_stats' follows non-static declaration
security/selinux/include/avc.h:107: error: previous declaration of 'avc_cache_stats' was here

Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/security/selinux/avc.c         |   18 ++++++++++++++++++
 25-akpm/security/selinux/include/avc.h |   19 -------------------
 2 files changed, 18 insertions(+), 19 deletions(-)

diff -puN security/selinux/avc.c~selinux-build-fix security/selinux/avc.c
--- 25/security/selinux/avc.c~selinux-build-fix	2004-07-03 13:26:49.011856008 -0700
+++ 25-akpm/security/selinux/avc.c	2004-07-03 13:26:49.016855248 -0700
@@ -81,6 +81,24 @@ static inline int avc_hash(u32 ssid, u32
 	return (ssid ^ (tsid<<2) ^ (tclass<<4)) & (AVC_CACHE_SLOTS - 1);
 }
 
+#ifdef AVC_CACHE_STATS
+static inline void avc_cache_stats_incr(int type)
+{
+	avc_cache_stats[type]++;
+}
+
+static inline void avc_cache_stats_add(int type, unsigned val)
+{
+	avc_cache_stats[type] += val;
+}
+#else
+static inline void avc_cache_stats_incr(int type)
+{ }
+
+static inline void avc_cache_stats_add(int type, unsigned val)
+{ }
+#endif
+
 /**
  * avc_dump_av - Display an access vector in human-readable form.
  * @tclass: target security class
diff -puN security/selinux/include/avc.h~selinux-build-fix security/selinux/include/avc.h
--- 25/security/selinux/include/avc.h~selinux-build-fix	2004-07-03 13:26:49.012855856 -0700
+++ 25-akpm/security/selinux/include/avc.h	2004-07-03 13:26:49.017855096 -0700
@@ -104,25 +104,6 @@ struct avc_audit_data {
 #define AVC_CAV_PROBES           6
 #define AVC_CAV_MISSES           7
 #define AVC_NSTATS               8
-extern unsigned avc_cache_stats[AVC_NSTATS];
-
-#ifdef AVC_CACHE_STATS
-static inline void avc_cache_stats_incr(int type)
-{
-	avc_cache_stats[type]++;
-}
-
-static inline void avc_cache_stats_add(int type, unsigned val)
-{
-	avc_cache_stats[type] += val;
-}
-#else
-static inline void avc_cache_stats_incr(int type)
-{ }
-
-static inline void avc_cache_stats_add(int type, unsigned val)
-{ }
-#endif
 
 /*
  * AVC display support
_
