Commit f5254cb3 authored by Christoph Hellwig's avatar Christoph Hellwig

[PATCH] some ppp/usecount bug

There's a bunch of useless MOD_INC_USE_COUNT/MOD_DEC_USE_COUNT in
ppp-related code when it manipulates the use count in functions
that are only called from other modules, i.e. it's locked in by
the depencies anyway.  Get rid of it.
parent 3d1864bc
...@@ -1841,7 +1841,6 @@ ppp_register_channel(struct ppp_channel *chan) ...@@ -1841,7 +1841,6 @@ ppp_register_channel(struct ppp_channel *chan)
list_add(&pch->list, &new_channels); list_add(&pch->list, &new_channels);
atomic_inc(&channel_count); atomic_inc(&channel_count);
spin_unlock_bh(&all_channels_lock); spin_unlock_bh(&all_channels_lock);
MOD_INC_USE_COUNT;
return 0; return 0;
} }
...@@ -1904,7 +1903,6 @@ ppp_unregister_channel(struct ppp_channel *chan) ...@@ -1904,7 +1903,6 @@ ppp_unregister_channel(struct ppp_channel *chan)
wake_up_interruptible(&pch->file.rwait); wake_up_interruptible(&pch->file.rwait);
if (atomic_dec_and_test(&pch->file.refcnt)) if (atomic_dec_and_test(&pch->file.refcnt))
ppp_destroy_channel(pch); ppp_destroy_channel(pch);
MOD_DEC_USE_COUNT;
} }
/* /*
......
...@@ -40,25 +40,18 @@ static struct pppox_proto *proto[PX_MAX_PROTO+1]; ...@@ -40,25 +40,18 @@ static struct pppox_proto *proto[PX_MAX_PROTO+1];
int register_pppox_proto(int proto_num, struct pppox_proto *pp) int register_pppox_proto(int proto_num, struct pppox_proto *pp)
{ {
if (proto_num < 0 || proto_num > PX_MAX_PROTO) { if (proto_num < 0 || proto_num > PX_MAX_PROTO)
return -EINVAL; return -EINVAL;
}
if (proto[proto_num]) if (proto[proto_num])
return -EALREADY; return -EALREADY;
MOD_INC_USE_COUNT;
proto[proto_num] = pp; proto[proto_num] = pp;
return 0; return 0;
} }
void unregister_pppox_proto(int proto_num) void unregister_pppox_proto(int proto_num)
{ {
if (proto_num >= 0 && proto_num <= PX_MAX_PROTO) { if (proto_num >= 0 && proto_num <= PX_MAX_PROTO)
proto[proto_num] = NULL; proto[proto_num] = NULL;
MOD_DEC_USE_COUNT;
}
} }
void pppox_unbind_sock(struct sock *sk) void pppox_unbind_sock(struct sock *sk)
......
...@@ -95,7 +95,6 @@ slhc_init(int rslots, int tslots) ...@@ -95,7 +95,6 @@ slhc_init(int rslots, int tslots)
register struct cstate *ts; register struct cstate *ts;
struct slcompress *comp; struct slcompress *comp;
MOD_INC_USE_COUNT;
comp = (struct slcompress *)kmalloc(sizeof(struct slcompress), comp = (struct slcompress *)kmalloc(sizeof(struct slcompress),
GFP_KERNEL); GFP_KERNEL);
if (! comp) if (! comp)
...@@ -147,7 +146,6 @@ slhc_init(int rslots, int tslots) ...@@ -147,7 +146,6 @@ slhc_init(int rslots, int tslots)
out_free: out_free:
kfree((unsigned char *)comp); kfree((unsigned char *)comp);
out_fail: out_fail:
MOD_DEC_USE_COUNT;
return NULL; return NULL;
} }
...@@ -166,7 +164,6 @@ slhc_free(struct slcompress *comp) ...@@ -166,7 +164,6 @@ slhc_free(struct slcompress *comp)
kfree( comp->rstate ); kfree( comp->rstate );
kfree( comp ); kfree( comp );
MOD_DEC_USE_COUNT;
} }
...@@ -685,7 +682,6 @@ slhc_remember(struct slcompress *comp, unsigned char *icp, int isize) ...@@ -685,7 +682,6 @@ slhc_remember(struct slcompress *comp, unsigned char *icp, int isize)
return isize; return isize;
} }
int int
slhc_toss(struct slcompress *comp) slhc_toss(struct slcompress *comp)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment