summaryrefslogtreecommitdiff
path: root/mac80211.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-08-09 11:25:52 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-08-09 11:25:52 +0200
commit15ef4943912f53d784c6150fa9fc368809a0d221 (patch)
tree519ff16056d2f94f05f07a204ed413d122d54928 /mac80211.c
parentb6828945dc12cbf447913445fb0e61745e7779f6 (diff)
mac80211.c: Remove or mark unused function parameters
Compiling with "-W -Wall -Wextra" reveals the following warnings in mac80211.c: mac80211.c: In function ‘nl80211_init’: mac80211.c:78:67: warning: unused parameter ‘device’ [-Wunused-parameter] mac80211.c: In function ‘nl80211_wait_handler’: mac80211.c:106:48: warning: unused parameter ‘msg’ [-Wunused-parameter] mac80211.c: In function ‘nl80211_error_handler’: mac80211.c:115:54: warning: unused parameter ‘nla’ [-Wunused-parameter] mac80211.c:117:12: warning: unused parameter ‘arg’ [-Wunused-parameter] mac80211.c: In function ‘nl80211_del_mon_if’: mac80211.c:181:72: warning: unused parameter ‘device’ [-Wunused-parameter] Fix them by either marking them as unused (where we need to conform to library APIs or remove them alltogether (for our own APIs). For the function leave_rfmon_mac80211() the according users (netsniff-ng and trafgen) are also changed. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'mac80211.c')
-rw-r--r--mac80211.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mac80211.c b/mac80211.c
index efb4af8..326cf65 100644
--- a/mac80211.c
+++ b/mac80211.c
@@ -75,7 +75,7 @@ static inline struct nl_sock *nl80211_nl_socket_xalloc(void)
return ret;
}
-static void nl80211_init(struct nl80211_state *state, const char *device)
+static void nl80211_init(struct nl80211_state *state)
{
int ret;
@@ -103,7 +103,7 @@ static void nl80211_cleanup(struct nl80211_state *state)
nl_socket_free(state->nl_sock);
}
-static int nl80211_wait_handler(struct nl_msg *msg, void *arg)
+static int nl80211_wait_handler(struct nl_msg *msg __maybe_unused, void *arg)
{
int *finished = arg;
@@ -112,9 +112,9 @@ static int nl80211_wait_handler(struct nl_msg *msg, void *arg)
return NL_STOP;
}
-static int nl80211_error_handler(struct sockaddr_nl *nla,
+static int nl80211_error_handler(struct sockaddr_nl *nla __maybe_unused,
struct nlmsgerr *err,
- void *arg)
+ void *arg __maybe_unused)
{
panic("nl80211 returned with error %d\n", err->error);
}
@@ -178,7 +178,7 @@ nla_put_failure:
return -EIO; /* dummy */
}
-static int nl80211_del_mon_if(struct nl80211_state *state, const char *device,
+static int nl80211_del_mon_if(struct nl80211_state *state,
const char *mondevice)
{
int ifindex, ret;
@@ -219,7 +219,7 @@ void enter_rfmon_mac80211(const char *device, char **mondev)
/* XXX: is this already a monN device? */
get_mac80211_phydev(device, phydev_path, sizeof(phydev_path));
- nl80211_init(&nlstate, device);
+ nl80211_init(&nlstate);
for (n = 0; n < UINT_MAX; n++) {
char mondevice[32];
@@ -241,7 +241,7 @@ void enter_rfmon_mac80211(const char *device, char **mondev)
panic("No free monN interfaces!\n");
}
-void leave_rfmon_mac80211(const char *device, const char *mondev)
+void leave_rfmon_mac80211(const char *mondev)
{
short flags;
struct nl80211_state nlstate;
@@ -250,7 +250,7 @@ void leave_rfmon_mac80211(const char *device, const char *mondev)
flags &= ~(IFF_UP | IFF_RUNNING);
device_set_flags(mondev, flags);
- nl80211_init(&nlstate, device);
- nl80211_del_mon_if(&nlstate, device, mondev);
+ nl80211_init(&nlstate);
+ nl80211_del_mon_if(&nlstate, mondev);
nl80211_cleanup(&nlstate);
}