aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2008-12-18 22:59:32 -0800
committerDavid S. Miller <davem@davemloft.net>2008-12-18 22:59:32 -0800
commitab5024ab23b78c86a0a1425defcdde48710fe449 (patch)
treea9e1e343b7db0f39bb9311927eb3e849e4efaa6b
parenta109a5b916bc180e14fad0d1e9c37a08c85652c0 (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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 3ee7830d458..c832d600d1e 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -179,7 +179,7 @@ struct channel {
*/
static DEFINE_MUTEX(all_ppp_mutex);
static atomic_t ppp_unit_count = ATOMIC_INIT(0);
-static struct idr ppp_units_idr;
+static DEFINE_IDR(ppp_units_idr);
/*
* all_channels_lock protects all_channels and last_channel_index,
@@ -852,8 +852,6 @@ static int __init ppp_init(void)
"ppp");
}
- idr_init(&ppp_units_idr);
-
out:
if (err)
printk(KERN_ERR "failed to register PPP device (%d)\n", err);
@@ -2435,7 +2433,7 @@ ppp_create_interface(int unit, int *retp)
if (unit_find(&ppp_units_idr, unit))
goto out2; /* unit already exists */
else {
- /* darn, someone is cheatting us? */
+ /* darn, someone is cheating us? */
*retp = -EINVAL;
goto out2;
}