Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty/vt: consolemap: rename struct vc_data::vc_uni_pagedir*

As a follow-up to the commit 4173f018aae1 (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>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
8da443b1 d524e1c7

+38 -38
+23 -23
drivers/tty/vt/consolemap.c
··· 296 296 if (glyph >= MAX_GLYPH) 297 297 return 0; 298 298 299 - p = *conp->vc_uni_pagedir_loc; 299 + p = *conp->uni_pagedict_loc; 300 300 if (!p) 301 301 return glyph; 302 302 ··· 323 323 for (i = 0; i < MAX_NR_CONSOLES; i++) { 324 324 if (!vc_cons_allocated(i)) 325 325 continue; 326 - p = *vc_cons[i].d->vc_uni_pagedir_loc; 326 + p = *vc_cons[i].d->uni_pagedict_loc; 327 327 if (p && p != q) { 328 328 set_inverse_transl(vc_cons[i].d, p, USER_MAP); 329 329 set_inverse_trans_unicode(p); ··· 445 445 { 446 446 struct uni_pagedict *p; 447 447 448 - p = *vc->vc_uni_pagedir_loc; 448 + p = *vc->uni_pagedict_loc; 449 449 if (!p) 450 450 return; 451 - *vc->vc_uni_pagedir_loc = NULL; 451 + *vc->uni_pagedict_loc = NULL; 452 452 if (--p->refcount) 453 453 return; 454 454 con_release_unimap(p); ··· 463 463 for (cons = 0; cons < MAX_NR_CONSOLES; cons++) { 464 464 if (!vc_cons_allocated(cons)) 465 465 continue; 466 - dict2 = *vc_cons[cons].d->vc_uni_pagedir_loc; 466 + dict2 = *vc_cons[cons].d->uni_pagedict_loc; 467 467 if (!dict2 || dict2 == dict1 || dict2->sum != dict1->sum) 468 468 continue; 469 469 for (d = 0; d < UNI_DIRS; d++) { ··· 487 487 } 488 488 if (d == UNI_DIRS) { 489 489 dict2->refcount++; 490 - *conp->vc_uni_pagedir_loc = dict2; 490 + *conp->uni_pagedict_loc = dict2; 491 491 con_release_unimap(dict1); 492 492 kfree(dict1); 493 493 return 1; ··· 531 531 532 532 static int con_allocate_new(struct vc_data *vc) 533 533 { 534 - struct uni_pagedict *new, *old = *vc->vc_uni_pagedir_loc; 534 + struct uni_pagedict *new, *old = *vc->uni_pagedict_loc; 535 535 536 536 new = kzalloc(sizeof(*new), GFP_KERNEL); 537 537 if (!new) 538 538 return -ENOMEM; 539 539 540 540 new->refcount = 1; 541 - *vc->vc_uni_pagedir_loc = new; 541 + *vc->uni_pagedict_loc = new; 542 542 543 543 if (old) 544 544 old->refcount--; ··· 549 549 /* Caller must hold the lock */ 550 550 static int con_do_clear_unimap(struct vc_data *vc) 551 551 { 552 - struct uni_pagedict *old = *vc->vc_uni_pagedir_loc; 552 + struct uni_pagedict *old = *vc->uni_pagedict_loc; 553 553 554 554 if (!old || old->refcount > 1) 555 555 return con_allocate_new(vc); ··· 583 583 if (ret) 584 584 return ERR_PTR(ret); 585 585 586 - new = *vc->vc_uni_pagedir_loc; 586 + new = *vc->uni_pagedict_loc; 587 587 588 588 /* 589 589 * uni_pgdir is a 32*32*64 table with rows allocated when its first ··· 616 616 ret = con_insert_unipair(new, uni, row[g]); 617 617 if (ret) { 618 618 old->refcount++; 619 - *vc->vc_uni_pagedir_loc = old; 619 + *vc->uni_pagedict_loc = old; 620 620 con_release_unimap(new); 621 621 kfree(new); 622 622 return ERR_PTR(ret); ··· 644 644 console_lock(); 645 645 646 646 /* Save original vc_unipagdir_loc in case we allocate a new one */ 647 - dict = *vc->vc_uni_pagedir_loc; 647 + dict = *vc->uni_pagedict_loc; 648 648 if (!dict) { 649 649 err = -EINVAL; 650 650 goto out_unlock; ··· 704 704 u16 *dfont; 705 705 706 706 if (dflt) { 707 - dict = *vc->vc_uni_pagedir_loc; 707 + dict = *vc->uni_pagedict_loc; 708 708 if (dict == dflt) 709 709 return 0; 710 710 711 711 dflt->refcount++; 712 - *vc->vc_uni_pagedir_loc = dflt; 712 + *vc->uni_pagedict_loc = dflt; 713 713 if (dict && !--dict->refcount) { 714 714 con_release_unimap(dict); 715 715 kfree(dict); ··· 723 723 if (err) 724 724 return err; 725 725 726 - dict = *vc->vc_uni_pagedir_loc; 726 + dict = *vc->uni_pagedict_loc; 727 727 dfont = dfont_unitable; 728 728 729 729 for (fontpos = 0; fontpos < 256U; fontpos++) ··· 734 734 } 735 735 736 736 if (con_unify_unimap(vc, dict)) { 737 - dflt = *vc->vc_uni_pagedir_loc; 737 + dflt = *vc->uni_pagedict_loc; 738 738 return err; 739 739 } 740 740 ··· 757 757 { 758 758 struct uni_pagedict *src; 759 759 760 - if (!*src_vc->vc_uni_pagedir_loc) 760 + if (!*src_vc->uni_pagedict_loc) 761 761 return -EINVAL; 762 - if (*dst_vc->vc_uni_pagedir_loc == *src_vc->vc_uni_pagedir_loc) 762 + if (*dst_vc->uni_pagedict_loc == *src_vc->uni_pagedict_loc) 763 763 return 0; 764 764 con_free_unimap(dst_vc); 765 - src = *src_vc->vc_uni_pagedir_loc; 765 + src = *src_vc->uni_pagedict_loc; 766 766 src->refcount++; 767 - *dst_vc->vc_uni_pagedir_loc = src; 767 + *dst_vc->uni_pagedict_loc = src; 768 768 return 0; 769 769 } 770 770 EXPORT_SYMBOL(con_copy_unimap); ··· 791 791 console_lock(); 792 792 793 793 ect = 0; 794 - dict = *vc->vc_uni_pagedir_loc; 794 + dict = *vc->uni_pagedict_loc; 795 795 if (!dict) 796 796 goto unlock; 797 797 ··· 873 873 else if ((ucs & ~UNI_DIRECT_MASK) == UNI_DIRECT_BASE) 874 874 return ucs & UNI_DIRECT_MASK; 875 875 876 - dict = *conp->vc_uni_pagedir_loc; 876 + dict = *conp->uni_pagedict_loc; 877 877 if (!dict) 878 878 return -3; 879 879 ··· 903 903 int i; 904 904 905 905 for (i = 0; i < MAX_NR_CONSOLES; i++) 906 - if (vc_cons_allocated(i) && !*vc_cons[i].d->vc_uni_pagedir_loc) 906 + if (vc_cons_allocated(i) && !*vc_cons[i].d->uni_pagedict_loc) 907 907 con_set_default_unimap(vc_cons[i].d); 908 908 } 909 909
+4 -4
drivers/tty/vt/vt.c
··· 1063 1063 __module_get(vc->vc_sw->owner); 1064 1064 vc->vc_num = num; 1065 1065 vc->vc_display_fg = &master_display_fg; 1066 - if (vc->vc_uni_pagedir_loc) 1066 + if (vc->uni_pagedict_loc) 1067 1067 con_free_unimap(vc); 1068 - vc->vc_uni_pagedir_loc = &vc->vc_uni_pagedir; 1069 - vc->vc_uni_pagedir = NULL; 1068 + vc->uni_pagedict_loc = &vc->uni_pagedict; 1069 + vc->uni_pagedict = NULL; 1070 1070 vc->vc_hi_font_mask = 0; 1071 1071 vc->vc_complement_mask = 0; 1072 1072 vc->vc_can_do_color = 0; ··· 1136 1136 1137 1137 visual_init(vc, currcons, 1); 1138 1138 1139 - if (!*vc->vc_uni_pagedir_loc) 1139 + if (!*vc->uni_pagedict_loc) 1140 1140 con_set_default_unimap(vc); 1141 1141 1142 1142 err = -EINVAL;
+1 -1
drivers/usb/misc/sisusbvga/sisusb_con.c
··· 248 248 */ 249 249 kref_get(&sisusb->kref); 250 250 251 - if (!*c->vc_uni_pagedir_loc) 251 + if (!*c->uni_pagedict_loc) 252 252 con_set_default_unimap(c); 253 253 254 254 mutex_unlock(&sisusb->lock);
+4 -4
drivers/video/console/vgacon.c
··· 367 367 c->vc_complement_mask = 0x7700; 368 368 if (vga_512_chars) 369 369 c->vc_hi_font_mask = 0x0800; 370 - p = *c->vc_uni_pagedir_loc; 371 - if (c->vc_uni_pagedir_loc != &vgacon_uni_pagedir) { 370 + p = *c->uni_pagedict_loc; 371 + if (c->uni_pagedict_loc != &vgacon_uni_pagedir) { 372 372 con_free_unimap(c); 373 - c->vc_uni_pagedir_loc = &vgacon_uni_pagedir; 373 + c->uni_pagedict_loc = &vgacon_uni_pagedir; 374 374 vgacon_refcount++; 375 375 } 376 376 if (!vgacon_uni_pagedir && p) ··· 392 392 393 393 if (!--vgacon_refcount) 394 394 con_free_unimap(c); 395 - c->vc_uni_pagedir_loc = &c->vc_uni_pagedir; 395 + c->uni_pagedict_loc = &c->uni_pagedict; 396 396 con_set_default_unimap(c); 397 397 } 398 398
+4 -4
drivers/video/fbdev/core/fbcon.c
··· 1058 1058 vc->vc_complement_mask <<= 1; 1059 1059 } 1060 1060 1061 - if (!*svc->vc_uni_pagedir_loc) 1061 + if (!*svc->uni_pagedict_loc) 1062 1062 con_set_default_unimap(svc); 1063 - if (!*vc->vc_uni_pagedir_loc) 1063 + if (!*vc->uni_pagedict_loc) 1064 1064 con_copy_unimap(vc, svc); 1065 1065 1066 1066 ops = info->fbcon_par; ··· 1382 1382 vc->vc_complement_mask <<= 1; 1383 1383 } 1384 1384 1385 - if (!*svc->vc_uni_pagedir_loc) 1385 + if (!*svc->uni_pagedict_loc) 1386 1386 con_set_default_unimap(svc); 1387 - if (!*vc->vc_uni_pagedir_loc) 1387 + if (!*vc->uni_pagedict_loc) 1388 1388 con_copy_unimap(vc, svc); 1389 1389 1390 1390 cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);
+2 -2
include/linux/console_struct.h
··· 157 157 unsigned int vc_bell_duration; /* Console bell duration */ 158 158 unsigned short vc_cur_blink_ms; /* Cursor blink duration */ 159 159 struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */ 160 - struct uni_pagedict *vc_uni_pagedir; 161 - struct uni_pagedict **vc_uni_pagedir_loc; /* [!] Location of uni_pagedict variable for this console */ 160 + struct uni_pagedict *uni_pagedict; 161 + struct uni_pagedict **uni_pagedict_loc; /* [!] Location of uni_pagedict variable for this console */ 162 162 struct uni_screen *vc_uni_screen; /* unicode screen content */ 163 163 /* additional information is in vt_kern.h */ 164 164 };