]> git.baikalelectronics.ru Git - kernel.git/commitdiff
tty/vt: consolemap: rename struct vc_data::vc_uni_pagedir*
authorJiri Slaby <jslaby@suse.cz>
Tue, 14 Jun 2022 09:05:34 +0000 (11:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jun 2022 12:17:12 +0000 (14:17 +0200)
As a follow-up to the commit b6044fa84377 (tty/vt: consolemap: rename
and document struct uni_pagedir), rename also the members of struct
vc_data. I.e. pagedir -> pagedict. And while touching all the places,
remove also the unnecessary vc_ prefix.

Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220614090537.15557-5-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/consolemap.c
drivers/tty/vt/vt.c
drivers/usb/misc/sisusbvga/sisusb_con.c
drivers/video/console/vgacon.c
drivers/video/fbdev/core/fbcon.c
include/linux/console_struct.h

index 3d0e10dac6d940bdb7c4bb2eef7bf0449c27f6be..16d0d8f04f0ec2e1225aaaff86f9101162b6e6d4 100644 (file)
@@ -296,7 +296,7 @@ u16 inverse_translate(const struct vc_data *conp, u16 glyph, bool use_unicode)
        if (glyph >= MAX_GLYPH)
                return 0;
 
-       p = *conp->vc_uni_pagedir_loc;
+       p = *conp->uni_pagedict_loc;
        if (!p)
                return glyph;
 
@@ -323,7 +323,7 @@ static void update_user_maps(void)
        for (i = 0; i < MAX_NR_CONSOLES; i++) {
                if (!vc_cons_allocated(i))
                        continue;
-               p = *vc_cons[i].d->vc_uni_pagedir_loc;
+               p = *vc_cons[i].d->uni_pagedict_loc;
                if (p && p != q) {
                        set_inverse_transl(vc_cons[i].d, p, USER_MAP);
                        set_inverse_trans_unicode(p);
@@ -445,10 +445,10 @@ void con_free_unimap(struct vc_data *vc)
 {
        struct uni_pagedict *p;
 
-       p = *vc->vc_uni_pagedir_loc;
+       p = *vc->uni_pagedict_loc;
        if (!p)
                return;
-       *vc->vc_uni_pagedir_loc = NULL;
+       *vc->uni_pagedict_loc = NULL;
        if (--p->refcount)
                return;
        con_release_unimap(p);
@@ -463,7 +463,7 @@ static int con_unify_unimap(struct vc_data *conp, struct uni_pagedict *dict1)
        for (cons = 0; cons < MAX_NR_CONSOLES; cons++) {
                if (!vc_cons_allocated(cons))
                        continue;
-               dict2 = *vc_cons[cons].d->vc_uni_pagedir_loc;
+               dict2 = *vc_cons[cons].d->uni_pagedict_loc;
                if (!dict2 || dict2 == dict1 || dict2->sum != dict1->sum)
                        continue;
                for (d = 0; d < UNI_DIRS; d++) {
@@ -487,7 +487,7 @@ static int con_unify_unimap(struct vc_data *conp, struct uni_pagedict *dict1)
                }
                if (d == UNI_DIRS) {
                        dict2->refcount++;
-                       *conp->vc_uni_pagedir_loc = dict2;
+                       *conp->uni_pagedict_loc = dict2;
                        con_release_unimap(dict1);
                        kfree(dict1);
                        return 1;
@@ -531,14 +531,14 @@ con_insert_unipair(struct uni_pagedict *p, u_short unicode, u_short fontpos)
 
 static int con_allocate_new(struct vc_data *vc)
 {
-       struct uni_pagedict *new, *old = *vc->vc_uni_pagedir_loc;
+       struct uni_pagedict *new, *old = *vc->uni_pagedict_loc;
 
        new = kzalloc(sizeof(*new), GFP_KERNEL);
        if (!new)
                return -ENOMEM;
 
        new->refcount = 1;
-       *vc->vc_uni_pagedir_loc = new;
+       *vc->uni_pagedict_loc = new;
 
        if (old)
                old->refcount--;
@@ -549,7 +549,7 @@ static int con_allocate_new(struct vc_data *vc)
 /* Caller must hold the lock */
 static int con_do_clear_unimap(struct vc_data *vc)
 {
-       struct uni_pagedict *old = *vc->vc_uni_pagedir_loc;
+       struct uni_pagedict *old = *vc->uni_pagedict_loc;
 
        if (!old || old->refcount > 1)
                return con_allocate_new(vc);
@@ -583,7 +583,7 @@ static struct uni_pagedict *con_unshare_unimap(struct vc_data *vc,
        if (ret)
                return ERR_PTR(ret);
 
-       new = *vc->vc_uni_pagedir_loc;
+       new = *vc->uni_pagedict_loc;
 
        /*
         * uni_pgdir is a 32*32*64 table with rows allocated when its first
@@ -616,7 +616,7 @@ static struct uni_pagedict *con_unshare_unimap(struct vc_data *vc,
                                ret = con_insert_unipair(new, uni, row[g]);
                                if (ret) {
                                        old->refcount++;
-                                       *vc->vc_uni_pagedir_loc = old;
+                                       *vc->uni_pagedict_loc = old;
                                        con_release_unimap(new);
                                        kfree(new);
                                        return ERR_PTR(ret);
@@ -644,7 +644,7 @@ int con_set_unimap(struct vc_data *vc, ushort ct, struct unipair __user *list)
        console_lock();
 
        /* Save original vc_unipagdir_loc in case we allocate a new one */
-       dict = *vc->vc_uni_pagedir_loc;
+       dict = *vc->uni_pagedict_loc;
        if (!dict) {
                err = -EINVAL;
                goto out_unlock;
@@ -704,12 +704,12 @@ int con_set_default_unimap(struct vc_data *vc)
        u16 *dfont;
 
        if (dflt) {
-               dict = *vc->vc_uni_pagedir_loc;
+               dict = *vc->uni_pagedict_loc;
                if (dict == dflt)
                        return 0;
 
                dflt->refcount++;
-               *vc->vc_uni_pagedir_loc = dflt;
+               *vc->uni_pagedict_loc = dflt;
                if (dict && !--dict->refcount) {
                        con_release_unimap(dict);
                        kfree(dict);
@@ -723,7 +723,7 @@ int con_set_default_unimap(struct vc_data *vc)
        if (err)
                return err;
 
-       dict = *vc->vc_uni_pagedir_loc;
+       dict = *vc->uni_pagedict_loc;
        dfont = dfont_unitable;
 
        for (fontpos = 0; fontpos < 256U; fontpos++)
@@ -734,7 +734,7 @@ int con_set_default_unimap(struct vc_data *vc)
                }
 
        if (con_unify_unimap(vc, dict)) {
-               dflt = *vc->vc_uni_pagedir_loc;
+               dflt = *vc->uni_pagedict_loc;
                return err;
        }
 
@@ -757,14 +757,14 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc)
 {
        struct uni_pagedict *src;
 
-       if (!*src_vc->vc_uni_pagedir_loc)
+       if (!*src_vc->uni_pagedict_loc)
                return -EINVAL;
-       if (*dst_vc->vc_uni_pagedir_loc == *src_vc->vc_uni_pagedir_loc)
+       if (*dst_vc->uni_pagedict_loc == *src_vc->uni_pagedict_loc)
                return 0;
        con_free_unimap(dst_vc);
-       src = *src_vc->vc_uni_pagedir_loc;
+       src = *src_vc->uni_pagedict_loc;
        src->refcount++;
-       *dst_vc->vc_uni_pagedir_loc = src;
+       *dst_vc->uni_pagedict_loc = src;
        return 0;
 }
 EXPORT_SYMBOL(con_copy_unimap);
@@ -791,7 +791,7 @@ int con_get_unimap(struct vc_data *vc, ushort ct, ushort __user *uct,
        console_lock();
 
        ect = 0;
-       dict = *vc->vc_uni_pagedir_loc;
+       dict = *vc->uni_pagedict_loc;
        if (!dict)
                goto unlock;
 
@@ -873,7 +873,7 @@ int conv_uni_to_pc(struct vc_data *conp, long ucs)
        else if ((ucs & ~UNI_DIRECT_MASK) == UNI_DIRECT_BASE)
                return ucs & UNI_DIRECT_MASK;
 
-       dict = *conp->vc_uni_pagedir_loc;
+       dict = *conp->uni_pagedict_loc;
        if (!dict)
                return -3;
 
@@ -903,7 +903,7 @@ console_map_init(void)
        int i;
 
        for (i = 0; i < MAX_NR_CONSOLES; i++)
-               if (vc_cons_allocated(i) && !*vc_cons[i].d->vc_uni_pagedir_loc)
+               if (vc_cons_allocated(i) && !*vc_cons[i].d->uni_pagedict_loc)
                        con_set_default_unimap(vc_cons[i].d);
 }
 
index c718b0d01e3dbdf49cbb0e03eac1ed68c34eb982..1899b8a5d73ee7fb2a2ed2a68a6db44f5527671f 100644 (file)
@@ -1063,10 +1063,10 @@ static void visual_init(struct vc_data *vc, int num, int init)
        __module_get(vc->vc_sw->owner);
        vc->vc_num = num;
        vc->vc_display_fg = &master_display_fg;
-       if (vc->vc_uni_pagedir_loc)
+       if (vc->uni_pagedict_loc)
                con_free_unimap(vc);
-       vc->vc_uni_pagedir_loc = &vc->vc_uni_pagedir;
-       vc->vc_uni_pagedir = NULL;
+       vc->uni_pagedict_loc = &vc->uni_pagedict;
+       vc->uni_pagedict = NULL;
        vc->vc_hi_font_mask = 0;
        vc->vc_complement_mask = 0;
        vc->vc_can_do_color = 0;
@@ -1136,7 +1136,7 @@ int vc_allocate(unsigned int currcons)    /* return 0 on success */
 
        visual_init(vc, currcons, 1);
 
-       if (!*vc->vc_uni_pagedir_loc)
+       if (!*vc->uni_pagedict_loc)
                con_set_default_unimap(vc);
 
        err = -EINVAL;
index dfa0d5ce6012ce46d415a8723016a1abaa5ce9ef..fcb95fb639e00abf2969afb7698f58cdea38bd49 100644 (file)
@@ -248,7 +248,7 @@ sisusbcon_init(struct vc_data *c, int init)
         */
        kref_get(&sisusb->kref);
 
-       if (!*c->vc_uni_pagedir_loc)
+       if (!*c->uni_pagedict_loc)
                con_set_default_unimap(c);
 
        mutex_unlock(&sisusb->lock);
index 058a78b8dbcfc668ca53b10ea8eb9682c6818e14..fcdf017e266522366d7ddccea386de274d4c2c2d 100644 (file)
@@ -367,10 +367,10 @@ static void vgacon_init(struct vc_data *c, int init)
        c->vc_complement_mask = 0x7700;
        if (vga_512_chars)
                c->vc_hi_font_mask = 0x0800;
-       p = *c->vc_uni_pagedir_loc;
-       if (c->vc_uni_pagedir_loc != &vgacon_uni_pagedir) {
+       p = *c->uni_pagedict_loc;
+       if (c->uni_pagedict_loc != &vgacon_uni_pagedir) {
                con_free_unimap(c);
-               c->vc_uni_pagedir_loc = &vgacon_uni_pagedir;
+               c->uni_pagedict_loc = &vgacon_uni_pagedir;
                vgacon_refcount++;
        }
        if (!vgacon_uni_pagedir && p)
@@ -392,7 +392,7 @@ static void vgacon_deinit(struct vc_data *c)
 
        if (!--vgacon_refcount)
                con_free_unimap(c);
-       c->vc_uni_pagedir_loc = &c->vc_uni_pagedir;
+       c->uni_pagedict_loc = &c->uni_pagedict;
        con_set_default_unimap(c);
 }
 
index c4e91715ef0063570381b1cac8366f47c9e160f0..b10236fe588698a99d424aa895a9a65538b8d42c 100644 (file)
@@ -1058,9 +1058,9 @@ static void fbcon_init(struct vc_data *vc, int init)
                        vc->vc_complement_mask <<= 1;
        }
 
-       if (!*svc->vc_uni_pagedir_loc)
+       if (!*svc->uni_pagedict_loc)
                con_set_default_unimap(svc);
-       if (!*vc->vc_uni_pagedir_loc)
+       if (!*vc->uni_pagedict_loc)
                con_copy_unimap(vc, svc);
 
        ops = info->fbcon_par;
@@ -1382,9 +1382,9 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var,
                        vc->vc_complement_mask <<= 1;
        }
 
-       if (!*svc->vc_uni_pagedir_loc)
+       if (!*svc->uni_pagedict_loc)
                con_set_default_unimap(svc);
-       if (!*vc->vc_uni_pagedir_loc)
+       if (!*vc->uni_pagedict_loc)
                con_copy_unimap(vc, svc);
 
        cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);
index f75033f0277fcf0185f63b0c1aa08b2e2cedf428..1518568aaf0f2763ca6ad2bc6e1aa4cf763ea900 100644 (file)
@@ -157,8 +157,8 @@ struct vc_data {
        unsigned int    vc_bell_duration;       /* Console bell duration */
        unsigned short  vc_cur_blink_ms;        /* Cursor blink duration */
        struct vc_data **vc_display_fg;         /* [!] Ptr to var holding fg console for this display */
-       struct uni_pagedict *vc_uni_pagedir;
-       struct uni_pagedict **vc_uni_pagedir_loc; /* [!] Location of uni_pagedict variable for this console */
+       struct uni_pagedict *uni_pagedict;
+       struct uni_pagedict **uni_pagedict_loc; /* [!] Location of uni_pagedict variable for this console */
        struct uni_screen *vc_uni_screen;       /* unicode screen content */
        /* additional information is in vt_kern.h */
 };