Patchwork accounting: staticise accounting_sta_interim

login
register
mail settings
Submitter Baruch Siach
Date July 5, 2012, 2:19 p.m.
Message ID <4e8b110b7efab9c3cc64e5c13517848f49f04539.1341464520.git.baruch@tkos.co.il>
Download mbox | patch
Permalink /patch/169607/
State Changes Requested
Headers show

Comments

Baruch Siach - July 5, 2012, 2:19 p.m.
This routine is not used anywhere else.

Signed-hostap Baruch Siach <baruch@tkos.co.il>
---
 src/ap/accounting.c |   25 +++++++++++++------------
 src/ap/accounting.h |    1 -
 2 files changed, 13 insertions(+), 13 deletions(-)
Jouni Malinen - Aug. 4, 2012, 8:59 a.m.
On Thu, Jul 05, 2012 at 05:19:51PM +0300, Baruch Siach wrote:
> This routine is not used anywhere else.

> +static void accounting_sta_interim(struct hostapd_data *hapd,
> +				   struct sta_info *sta)
> +{
> +	if (sta->acct_session_started)
> +		accounting_sta_report(hapd, sta, 0);

This results in compiler warnings/errors due to accounting_sta_report()
not being declared here. It would be easier to just leave
accounting_sta_interim() in its old location and add a static prototype
for it in the beginning of the file.

Patch

diff --git a/src/ap/accounting.c b/src/ap/accounting.c
index 2c3a6d9..40828c1 100644
--- a/src/ap/accounting.c
+++ b/src/ap/accounting.c
@@ -242,6 +242,19 @@  static int accounting_sta_update_stats(struct hostapd_data *hapd,
 }
 
 
+/**
+ * accounting_sta_interim - Send a interim STA accounting report
+ * @hapd: hostapd BSS data
+ * @sta: The station
+ */
+static void accounting_sta_interim(struct hostapd_data *hapd,
+				   struct sta_info *sta)
+{
+	if (sta->acct_session_started)
+		accounting_sta_report(hapd, sta, 0);
+}
+
+
 static void accounting_interim_update(void *eloop_ctx, void *timeout_ctx)
 {
 	struct hostapd_data *hapd = eloop_ctx;
@@ -411,18 +424,6 @@  static void accounting_sta_report(struct hostapd_data *hapd,
 
 
 /**
- * accounting_sta_interim - Send a interim STA accounting report
- * @hapd: hostapd BSS data
- * @sta: The station
- */
-void accounting_sta_interim(struct hostapd_data *hapd, struct sta_info *sta)
-{
-	if (sta->acct_session_started)
-		accounting_sta_report(hapd, sta, 0);
-}
-
-
-/**
  * accounting_sta_stop - Stop STA accounting
  * @hapd: hostapd BSS data
  * @sta: The station
diff --git a/src/ap/accounting.h b/src/ap/accounting.h
index 797e24d..9d13d01 100644
--- a/src/ap/accounting.h
+++ b/src/ap/accounting.h
@@ -9,7 +9,6 @@ 
 #ifndef ACCOUNTING_H
 #define ACCOUNTING_H
 
-void accounting_sta_interim(struct hostapd_data *hapd, struct sta_info *sta);
 #ifdef CONFIG_NO_ACCOUNTING
 static inline void accounting_sta_start(struct hostapd_data *hapd,
 					struct sta_info *sta)