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

ia64: move the screen_info setup to common code

There is nothing really platform specific about setting about the
screen_info from the ia64_boot_param structure, so move it from the
dig machvec to common code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lkml.kernel.org/r/20190813072514.23299-26-hch@lst.de
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by

Christoph Hellwig and committed by
Tony Luck
a8384e6c fa809d70

+34 -30
-30
arch/ia64/dig/setup.c
··· 26 26 void __init 27 27 dig_setup (char **cmdline_p) 28 28 { 29 - unsigned int orig_x, orig_y, num_cols, num_rows, font_height; 30 - 31 29 #ifdef CONFIG_SMP 32 30 init_smp_config(); 33 31 #endif 34 - 35 - memset(&screen_info, 0, sizeof(screen_info)); 36 - 37 - if (!ia64_boot_param->console_info.num_rows 38 - || !ia64_boot_param->console_info.num_cols) 39 - { 40 - printk(KERN_WARNING "dig_setup: warning: invalid screen-info, guessing 80x25\n"); 41 - orig_x = 0; 42 - orig_y = 0; 43 - num_cols = 80; 44 - num_rows = 25; 45 - font_height = 16; 46 - } else { 47 - orig_x = ia64_boot_param->console_info.orig_x; 48 - orig_y = ia64_boot_param->console_info.orig_y; 49 - num_cols = ia64_boot_param->console_info.num_cols; 50 - num_rows = ia64_boot_param->console_info.num_rows; 51 - font_height = 400 / num_rows; 52 - } 53 - 54 - screen_info.orig_x = orig_x; 55 - screen_info.orig_y = orig_y; 56 - screen_info.orig_video_cols = num_cols; 57 - screen_info.orig_video_lines = num_rows; 58 - screen_info.orig_video_points = font_height; 59 - screen_info.orig_video_mode = 3; /* XXX fake */ 60 - screen_info.orig_video_isVGA = 1; /* XXX fake */ 61 - screen_info.orig_video_ega_bx = 3; /* XXX fake */ 62 32 }
+34
arch/ia64/kernel/setup.c
··· 469 469 return -1; 470 470 } 471 471 472 + static void __init 473 + screen_info_setup(void) 474 + { 475 + unsigned int orig_x, orig_y, num_cols, num_rows, font_height; 476 + 477 + memset(&screen_info, 0, sizeof(screen_info)); 478 + 479 + if (!ia64_boot_param->console_info.num_rows || 480 + !ia64_boot_param->console_info.num_cols) { 481 + printk(KERN_WARNING "invalid screen-info, guessing 80x25\n"); 482 + orig_x = 0; 483 + orig_y = 0; 484 + num_cols = 80; 485 + num_rows = 25; 486 + font_height = 16; 487 + } else { 488 + orig_x = ia64_boot_param->console_info.orig_x; 489 + orig_y = ia64_boot_param->console_info.orig_y; 490 + num_cols = ia64_boot_param->console_info.num_cols; 491 + num_rows = ia64_boot_param->console_info.num_rows; 492 + font_height = 400 / num_rows; 493 + } 494 + 495 + screen_info.orig_x = orig_x; 496 + screen_info.orig_y = orig_y; 497 + screen_info.orig_video_cols = num_cols; 498 + screen_info.orig_video_lines = num_rows; 499 + screen_info.orig_video_points = font_height; 500 + screen_info.orig_video_mode = 3; /* XXX fake */ 501 + screen_info.orig_video_isVGA = 1; /* XXX fake */ 502 + screen_info.orig_video_ega_bx = 3; /* XXX fake */ 503 + } 504 + 472 505 static inline void 473 506 mark_bsp_online (void) 474 507 { ··· 642 609 ROOT_DEV = Root_SDA2; /* default to second partition on first drive */ 643 610 644 611 platform_setup(cmdline_p); 612 + screen_info_setup(); 645 613 paging_init(); 646 614 647 615 clear_sched_clock_stable();