diff options
| author | Christoph Hellwig <hch@lst.de> | 2002-12-31 23:43:32 -0800 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2002-12-31 23:43:32 -0800 |
| commit | f5254cb3ca4b80d41d02096e9268477676c6416d (patch) | |
| tree | 54eef9a97b7387db2fddd5415ce4b68dbd427111 /drivers | |
| parent | 3d1864bcd5a61eeeaedcf22c9c1b13c5d3fdf448 (diff) | |
[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.
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/net/ppp_generic.c | 2 | ||||
| -rw-r--r-- | drivers/net/pppox.c | 11 | ||||
| -rw-r--r-- | drivers/net/slhc.c | 4 |
3 files changed, 2 insertions, 15 deletions
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index cf64b44d706a..d86cb7b9e5f9 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c @@ -1841,7 +1841,6 @@ ppp_register_channel(struct ppp_channel *chan) list_add(&pch->list, &new_channels); atomic_inc(&channel_count); spin_unlock_bh(&all_channels_lock); - MOD_INC_USE_COUNT; return 0; } @@ -1904,7 +1903,6 @@ ppp_unregister_channel(struct ppp_channel *chan) wake_up_interruptible(&pch->file.rwait); if (atomic_dec_and_test(&pch->file.refcnt)) ppp_destroy_channel(pch); - MOD_DEC_USE_COUNT; } /* diff --git a/drivers/net/pppox.c b/drivers/net/pppox.c index 657786d3915e..311c09f18bf0 100644 --- a/drivers/net/pppox.c +++ b/drivers/net/pppox.c @@ -40,25 +40,18 @@ static struct pppox_proto *proto[PX_MAX_PROTO+1]; 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; - } - if (proto[proto_num]) return -EALREADY; - - MOD_INC_USE_COUNT; - proto[proto_num] = pp; return 0; } 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; - MOD_DEC_USE_COUNT; - } } void pppox_unbind_sock(struct sock *sk) diff --git a/drivers/net/slhc.c b/drivers/net/slhc.c index 8bbb4666246d..470c637dfb8f 100644 --- a/drivers/net/slhc.c +++ b/drivers/net/slhc.c @@ -95,7 +95,6 @@ slhc_init(int rslots, int tslots) register struct cstate *ts; struct slcompress *comp; - MOD_INC_USE_COUNT; comp = (struct slcompress *)kmalloc(sizeof(struct slcompress), GFP_KERNEL); if (! comp) @@ -147,7 +146,6 @@ out_free2: out_free: kfree((unsigned char *)comp); out_fail: - MOD_DEC_USE_COUNT; return NULL; } @@ -166,7 +164,6 @@ slhc_free(struct slcompress *comp) kfree( comp->rstate ); kfree( comp ); - MOD_DEC_USE_COUNT; } @@ -685,7 +682,6 @@ slhc_remember(struct slcompress *comp, unsigned char *icp, int isize) return isize; } - int slhc_toss(struct slcompress *comp) { |
