Skip to content

Commit 628703f

Browse files
tomparkindavem330
authored andcommitted
l2tp: return void from l2tp_session_delete
l2tp_session_delete is used to schedule a session instance for deletion. The function itself always returns zero, and none of its direct callers check its return value, so have the function return void. This change de-facto changes the l2tp netlink session_delete callback prototype since all pseudowires currently use l2tp_session_delete for their implementation of that operation. Signed-off-by: Tom Parkin <tparkin@katalix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 52016e2 commit 628703f

3 files changed

Lines changed: 5 additions & 10 deletions

File tree

‎net/l2tp/l2tp_core.c‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,22 +1620,17 @@ void l2tp_tunnel_delete(struct l2tp_tunnel *tunnel)
16201620
}
16211621
EXPORT_SYMBOL_GPL(l2tp_tunnel_delete);
16221622

1623-
/* This function is used by the netlink SESSION_DELETE command and by
1624-
* pseudowire modules.
1625-
*/
1626-
int l2tp_session_delete(struct l2tp_session *session)
1623+
void l2tp_session_delete(struct l2tp_session *session)
16271624
{
16281625
if (test_and_set_bit(0, &session->dead))
1629-
return 0;
1626+
return;
16301627

16311628
l2tp_session_unhash(session);
16321629
l2tp_session_queue_purge(session);
16331630
if (session->session_close)
16341631
(*session->session_close)(session);
16351632

16361633
l2tp_session_dec_refcount(session);
1637-
1638-
return 0;
16391634
}
16401635
EXPORT_SYMBOL_GPL(l2tp_session_delete);
16411636

‎net/l2tp/l2tp_core.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ struct l2tp_nl_cmd_ops {
167167
int (*session_create)(struct net *net, struct l2tp_tunnel *tunnel,
168168
u32 session_id, u32 peer_session_id,
169169
struct l2tp_session_cfg *cfg);
170-
int (*session_delete)(struct l2tp_session *session);
170+
void (*session_delete)(struct l2tp_session *session);
171171
};
172172

173173
static inline void *l2tp_session_priv(struct l2tp_session *session)
@@ -204,7 +204,7 @@ struct l2tp_session *l2tp_session_create(int priv_size,
204204
int l2tp_session_register(struct l2tp_session *session,
205205
struct l2tp_tunnel *tunnel);
206206

207-
int l2tp_session_delete(struct l2tp_session *session);
207+
void l2tp_session_delete(struct l2tp_session *session);
208208
void l2tp_recv_common(struct l2tp_session *session, struct sk_buff *skb,
209209
unsigned char *ptr, unsigned char *optr, u16 hdrflags,
210210
int length);

‎net/l2tp/l2tp_netlink.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ static int l2tp_nl_cmd_session_delete(struct sk_buff *skb, struct genl_info *inf
670670
pw_type = session->pwtype;
671671
if (pw_type < __L2TP_PWTYPE_MAX)
672672
if (l2tp_nl_cmd_ops[pw_type] && l2tp_nl_cmd_ops[pw_type]->session_delete)
673-
ret = (*l2tp_nl_cmd_ops[pw_type]->session_delete)(session);
673+
l2tp_nl_cmd_ops[pw_type]->session_delete(session);
674674

675675
l2tp_session_dec_refcount(session);
676676

0 commit comments

Comments
 (0)