fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git] / drivers / char / consolemap.c
index 406dea9..b99b756 100644 (file)
@@ -11,7 +11,6 @@
  * Fix bug in inverse translation. Stanislav Voronyi <stas@cnti.uanet.kharkov.ua>, Dec 1998
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kd.h>
 #include <linux/errno.h>
@@ -345,17 +344,15 @@ static void con_release_unimap(struct uni_pagedir *p)
        for (i = 0; i < 32; i++) {
                if ((p1 = p->uni_pgdir[i]) != NULL) {
                        for (j = 0; j < 32; j++)
-                               if (p1[j])
-                                       kfree(p1[j]);
+                               kfree(p1[j]);
                        kfree(p1);
                }
                p->uni_pgdir[i] = NULL;
        }
-       for (i = 0; i < 4; i++)
-               if (p->inverse_translations[i]) {
-                       kfree(p->inverse_translations[i]);
-                       p->inverse_translations[i] = NULL;
-               }
+       for (i = 0; i < 4; i++) {
+               kfree(p->inverse_translations[i]);
+               p->inverse_translations[i] = NULL;
+       }
 }
 
 void con_free_unimap(struct vc_data *vc)
@@ -446,7 +443,7 @@ int con_clear_unimap(struct vc_data *vc, struct unimapinit *ui)
        p = (struct uni_pagedir *)*vc->vc_uni_pagedir_loc;
        if (p && p->readonly) return -EIO;
        if (!p || --p->refcount) {
-               q = (struct uni_pagedir *)kmalloc(sizeof(*p), GFP_KERNEL);
+               q = kmalloc(sizeof(*p), GFP_KERNEL);
                if (!q) {
                        if (p) p->refcount++;
                        return -ENOMEM;