summaryrefslogtreecommitdiffstats
path: root/sys/net
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2015-01-27 03:17:35 +0000
committerdlg <dlg@openbsd.org>2015-01-27 03:17:35 +0000
commite419548092f59c20a140404818050eb2ab331a19 (patch)
treeff250435e8b28c07c967073741c21d374241b774 /sys/net
parentRemove an unused and confusing assignment that had been commented out for (diff)
downloadwireguard-openbsd-e419548092f59c20a140404818050eb2ab331a19.tar.xz
wireguard-openbsd-e419548092f59c20a140404818050eb2ab331a19.zip
remove the second void * argument on tasks.
when workqs were introduced, we provided a second argument so you could pass a thing and some context to work on it in. there were very few things that took advantage of the second argument, so when i introduced pools i suggested removing it. since tasks were meant to replace workqs, it was requested that we keep the second argument to make porting from workqs to tasks easier. now that workqs are gone, i had a look at the use of the second argument again and found only one good use of it (vdsp(4) on sparc64 if you're interested) and a tiny handful of questionable uses. the vast majority of tasks only used a single argument. i have since modified all tasks that used two args to only use one, so now we can remove the second argument. so this is a mechanical change. all tasks only passed NULL as their second argument, so we can just remove it. ok krw@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if.c9
-rw-r--r--sys/net/if_spppsubr.c25
2 files changed, 16 insertions, 18 deletions
diff --git a/sys/net/if.c b/sys/net/if.c
index 8cef7bbb507..4b70862449a 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.313 2015/01/21 02:23:14 guenther Exp $ */
+/* $OpenBSD: if.c,v 1.314 2015/01/27 03:17:36 dlg Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
@@ -142,7 +142,7 @@ struct if_clone *if_clone_lookup(const char *, int *);
void if_congestion_clear(void *);
int if_group_egress_build(void);
-void if_link_state_change_task(void *, void *);
+void if_link_state_change_task(void *);
#ifdef DDB
void ifa_print_all(void);
@@ -265,8 +265,7 @@ if_attachsetup(struct ifnet *ifp)
timeout_set(ifp->if_slowtimo, if_slowtimo, ifp);
if_slowtimo(ifp);
- task_set(ifp->if_linkstatetask, if_link_state_change_task,
- ifp, NULL);
+ task_set(ifp->if_linkstatetask, if_link_state_change_task, ifp);
/* Announce the interface. */
rt_ifannouncemsg(ifp, IFAN_ARRIVAL);
@@ -1119,7 +1118,7 @@ if_link_state_change(struct ifnet *ifp)
* Process a link state change.
*/
void
-if_link_state_change_task(void *arg, void *unused)
+if_link_state_change_task(void *arg)
{
struct ifnet *ifp = arg;
int s;
diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c
index 4f02e529f3c..e75fb72f5c4 100644
--- a/sys/net/if_spppsubr.c
+++ b/sys/net/if_spppsubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_spppsubr.c,v 1.129 2014/12/19 17:14:39 tedu Exp $ */
+/* $OpenBSD: if_spppsubr.c,v 1.130 2015/01/27 03:17:36 dlg Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
* Keepalive protocol implemented in both Cisco and PPP modes.
@@ -317,7 +317,7 @@ const char *sppp_ipv6cp_opt_name(u_char opt);
void sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src,
struct in6_addr *dst, struct in6_addr *srcmask);
void sppp_set_ip6_addr(struct sppp *sp, const struct in6_addr *src, const struct in6_addr *dst);
-void sppp_update_ip6_addr(void *arg1, void *arg2);
+void sppp_update_ip6_addr(void *sp);
void sppp_suggest_ip6_addr(struct sppp *sp, struct in6_addr *suggest);
void sppp_pap_input(struct sppp *sp, struct mbuf *m);
@@ -358,8 +358,8 @@ void sppp_print_string(const char *p, u_short len);
void sppp_qflush(struct ifqueue *ifq);
int sppp_update_gw_walker(struct radix_node *rn, void *arg, u_int);
void sppp_update_gw(struct ifnet *ifp);
-void sppp_set_ip_addrs(void *, void *);
-void sppp_clear_ip_addrs(void *, void *);
+void sppp_set_ip_addrs(void *);
+void sppp_clear_ip_addrs(void *);
void sppp_set_phase(struct sppp *sp);
/* our control protocol descriptors */
@@ -2609,8 +2609,8 @@ sppp_ipcp_init(struct sppp *sp)
sp->ipcp.flags = 0;
sp->state[IDX_IPCP] = STATE_INITIAL;
sp->fail_counter[IDX_IPCP] = 0;
- task_set(&sp->ipcp.set_addr_task, sppp_set_ip_addrs, sp, NULL);
- task_set(&sp->ipcp.clear_addr_task, sppp_clear_ip_addrs, sp, NULL);
+ task_set(&sp->ipcp.set_addr_task, sppp_set_ip_addrs, sp);
+ task_set(&sp->ipcp.clear_addr_task, sppp_clear_ip_addrs, sp);
}
void
@@ -3058,8 +3058,7 @@ sppp_ipv6cp_init(struct sppp *sp)
sp->ipv6cp.flags = 0;
sp->state[IDX_IPV6CP] = STATE_INITIAL;
sp->fail_counter[IDX_IPV6CP] = 0;
- task_set(&sp->ipv6cp.set_addr_task, sppp_update_ip6_addr, sp,
- &sp->ipv6cp.req_ifid);
+ task_set(&sp->ipv6cp.set_addr_task, sppp_update_ip6_addr, sp);
}
void
@@ -4558,7 +4557,7 @@ sppp_update_gw(struct ifnet *ifp)
* If an address is 0, leave it the way it is.
*/
void
-sppp_set_ip_addrs(void *arg1, void *arg2)
+sppp_set_ip_addrs(void *arg1)
{
struct sppp *sp = arg1;
u_int32_t myaddr;
@@ -4631,7 +4630,7 @@ sppp_set_ip_addrs(void *arg1, void *arg2)
* Clear IP addresses.
*/
void
-sppp_clear_ip_addrs(void *arg1, void *arg2)
+sppp_clear_ip_addrs(void *arg1)
{
struct sppp *sp = (struct sppp *)arg1;
struct ifnet *ifp = &sp->pp_if;
@@ -4728,11 +4727,11 @@ sppp_get_ip6_addrs(struct sppp *sp, struct in6_addr *src, struct in6_addr *dst,
/* Task to update my IPv6 address from process context. */
void
-sppp_update_ip6_addr(void *arg1, void *arg2)
+sppp_update_ip6_addr(void *arg)
{
- struct sppp *sp = arg1;
+ struct sppp *sp = arg;
struct ifnet *ifp = &sp->pp_if;
- struct in6_aliasreq *ifra = arg2;
+ struct in6_aliasreq *ifra = &sp->ipv6cp.req_ifid;
struct in6_addr mask = in6mask128;
struct in6_ifaddr *ia6;
int s, error;