diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2008-12-19 01:59:32 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-19 01:59:32 -0500 |
commit | ab5024ab23b78c86a0a1425defcdde48710fe449 (patch) | |
tree | a9e1e343b7db0f39bb9311927eb3e849e4efaa6b | |
parent | a109a5b916bc180e14fad0d1e9c37a08c85652c0 (diff) |
net: ppp_generic - use DEFINE_IDR for static initialization
We could use DEFINE_IDR for statically allocated idr
that allow us to save a few lines of code.
And spell fix.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ppp_generic.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 3ee7830d458d..c832d600d1e8 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -179,7 +179,7 @@ struct channel { | |||
179 | */ | 179 | */ |
180 | static DEFINE_MUTEX(all_ppp_mutex); | 180 | static DEFINE_MUTEX(all_ppp_mutex); |
181 | static atomic_t ppp_unit_count = ATOMIC_INIT(0); | 181 | static atomic_t ppp_unit_count = ATOMIC_INIT(0); |
182 | static struct idr ppp_units_idr; | 182 | static DEFINE_IDR(ppp_units_idr); |
183 | 183 | ||
184 | /* | 184 | /* |
185 | * all_channels_lock protects all_channels and last_channel_index, | 185 | * all_channels_lock protects all_channels and last_channel_index, |
@@ -852,8 +852,6 @@ static int __init ppp_init(void) | |||
852 | "ppp"); | 852 | "ppp"); |
853 | } | 853 | } |
854 | 854 | ||
855 | idr_init(&ppp_units_idr); | ||
856 | |||
857 | out: | 855 | out: |
858 | if (err) | 856 | if (err) |
859 | printk(KERN_ERR "failed to register PPP device (%d)\n", err); | 857 | printk(KERN_ERR "failed to register PPP device (%d)\n", err); |
@@ -2435,7 +2433,7 @@ ppp_create_interface(int unit, int *retp) | |||
2435 | if (unit_find(&ppp_units_idr, unit)) | 2433 | if (unit_find(&ppp_units_idr, unit)) |
2436 | goto out2; /* unit already exists */ | 2434 | goto out2; /* unit already exists */ |
2437 | else { | 2435 | else { |
2438 | /* darn, someone is cheatting us? */ | 2436 | /* darn, someone is cheating us? */ |
2439 | *retp = -EINVAL; | 2437 | *retp = -EINVAL; |
2440 | goto out2; | 2438 | goto out2; |
2441 | } | 2439 | } |