]> git.ipfire.org Git - thirdparty/xtables-addons.git/commitdiff
condition: squash variables
authorJan Engelhardt <jengelh@computergmbh.de>
Wed, 2 Apr 2008 08:28:36 +0000 (10:28 +0200)
committerJan Engelhardt <jengelh@computergmbh.de>
Tue, 8 Apr 2008 09:58:35 +0000 (11:58 +0200)
extensions/xt_condition.c

index a3a3544daf5ad66784042dc54960de10ac7dd2dc..536ed51eac910fffac70cdae322e9f7647cf6850 100644 (file)
@@ -126,7 +126,7 @@ condition_mt_check(const char *tablename, const void *entry,
 {
        const struct xt_condition_mtinfo *info = matchinfo;
        struct list_head *pos;
-       struct condition_variable *var, *newvar;
+       struct condition_variable *var;
 
        /* Forbid certain names */
        if (*info->name == '\0' || *info->name == '.' ||
@@ -154,34 +154,34 @@ condition_mt_check(const char *tablename, const void *entry,
        }
 
        /* At this point, we need to allocate a new condition variable. */
-       newvar = kmalloc(sizeof(struct condition_variable), GFP_KERNEL);
+       var = kmalloc(sizeof(struct condition_variable), GFP_KERNEL);
 
-       if (newvar == NULL) {
+       if (var == NULL) {
                up(&proc_lock);
                return false;
        }
 
        /* Create the condition variable's proc file entry. */
-       newvar->status_proc = create_proc_entry(info->name, condition_list_perms, proc_net_condition);
+       var->status_proc = create_proc_entry(info->name, condition_list_perms, proc_net_condition);
 
-       if (newvar->status_proc == NULL) {
-               kfree(newvar);
+       if (var->status_proc == NULL) {
+               kfree(var);
                up(&proc_lock);
                return false;
        }
 
-       newvar->refcount = 1;
-       newvar->enabled  = false;
-       newvar->status_proc->owner = THIS_MODULE;
-       newvar->status_proc->data = newvar;
+       var->refcount = 1;
+       var->enabled  = false;
+       var->status_proc->owner = THIS_MODULE;
+       var->status_proc->data  = var;
        wmb();
-       newvar->status_proc->read_proc  = condition_proc_read;
-       newvar->status_proc->write_proc = condition_proc_write;
+       var->status_proc->read_proc  = condition_proc_read;
+       var->status_proc->write_proc = condition_proc_write;
 
-       list_add_rcu(&newvar->list, &conditions_list);
+       list_add_rcu(&var->list, &conditions_list);
 
-       newvar->status_proc->uid = condition_uid_perms;
-       newvar->status_proc->gid = condition_gid_perms;
+       var->status_proc->uid = condition_uid_perms;
+       var->status_proc->gid = condition_gid_perms;
 
        up(&proc_lock);