tree:
https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git devel
head: b1d08004826c99d8af2be6744a7c623a18965562
commit: 2113cfbdf4f04075dcfe447b93ce56e7fb25b68b [53/60] make VGA_MAP_MEM return pointer
config: powerpc64-randconfig-s031-20200607 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-247-gcadbd124-dirty
git checkout 2113cfbdf4f04075dcfe447b93ce56e7fb25b68b
# save the attached .config to linux build tree
make W=1 C=1 ARCH=powerpc64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> drivers/video/console/vgacon.c:532:23: sparse: sparse: incorrect
type in assignment (different address spaces) @@ expected unsigned short [usertype]
*static [toplevel] vga_vram_base @@ got void [noderef] <asn:2> * @@
> drivers/video/console/vgacon.c:532:23: sparse: expected unsigned short [usertype]
*static [toplevel] vga_vram_base
> drivers/video/console/vgacon.c:532:23: sparse: got void [noderef] <asn:2>
*
> drivers/video/console/vgacon.c:1087:25: sparse: sparse: incorrect type in assignment
(different address spaces) @@ expected char *charmap @@ got void [noderef]
<asn:2> * @@
> drivers/video/console/vgacon.c:1087:25: sparse: expected char *charmap
drivers/video/console/vgacon.c:1087:25: sparse: got void [noderef] <asn:2> *
drivers/video/console/vgacon.c:1090:25: sparse: sparse: incorrect type in assignment
(different address spaces) @@ expected char *charmap @@ got void [noderef]
<asn:2> * @@
drivers/video/console/vgacon.c:1090:25: sparse: expected char *charmap
drivers/video/console/vgacon.c:1090:25: sparse: got void [noderef] <asn:2> *
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:34:16: sparse: sparse: cast to restricted __le16
arch/powerpc/include/asm/vga.h:29:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/powerpc/include/asm/vga.h:29:15: sparse: expected unsigned short volatile
[usertype]
arch/powerpc/include/asm/vga.h:29:15: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/vga.h:40:21: sparse: sparse: incorrect type in argument 2
(different base types) @@ expected unsigned short [usertype] v @@ got restricted
__le16 [usertype] @@
arch/powerpc/include/asm/vga.h:40:21: sparse: expected unsigned short [usertype] v
arch/powerpc/include/asm/vga.h:40:21: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/vga.h:40:21: sparse: sparse: incorrect type in argument 2
(different base types) @@ expected unsigned short [usertype] v @@ got restricted
__le16 [usertype] @@
arch/powerpc/include/asm/vga.h:40:21: sparse: expected unsigned short [usertype] v
arch/powerpc/include/asm/vga.h:40:21: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/vga.h:40:21: sparse: sparse: incorrect type in argument 2
(different base types) @@ expected unsigned short [usertype] v @@ got restricted
__le16 [usertype] @@
arch/powerpc/include/asm/vga.h:40:21: sparse: expected unsigned short [usertype] v
arch/powerpc/include/asm/vga.h:40:21: sparse: got restricted __le16 [usertype]
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
arch/powerpc/include/asm/io.h:148:1: sparse: sparse: dereference of noderef expression
vim +532 drivers/video/console/vgacon.c
389
390 static const char *vgacon_startup(void)
391 {
392 const char *display_desc = NULL;
393 phys_addr_t vram_phys;
394 u16 saved1, saved2;
395 volatile u16 *p;
396
397 if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB ||
398 screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) {
399 no_vga:
400 #ifdef CONFIG_DUMMY_CONSOLE
401 conswitchp = &dummy_con;
402 return conswitchp->con_startup();
403 #else
404 return NULL;
405 #endif
406 }
407
408 /* boot_params.screen_info reasonably initialized? */
409 if ((screen_info.orig_video_lines == 0) ||
410 (screen_info.orig_video_cols == 0))
411 goto no_vga;
412
413 /* VGA16 modes are not handled by VGACON */
414 if ((screen_info.orig_video_mode == 0x0D) || /* 320x200/4 */
415 (screen_info.orig_video_mode == 0x0E) || /* 640x200/4 */
416 (screen_info.orig_video_mode == 0x10) || /* 640x350/4 */
417 (screen_info.orig_video_mode == 0x12) || /* 640x480/4 */
418 (screen_info.orig_video_mode == 0x6A)) /* 800x600/4 (VESA) */
419 goto no_vga;
420
421 vga_video_num_lines = screen_info.orig_video_lines;
422 vga_video_num_columns = screen_info.orig_video_cols;
423 vgastate.vgabase = NULL;
424
425 if (screen_info.orig_video_mode == 7) {
426 /* Monochrome display */
427 vram_phys = 0xb0000;
428 vga_video_port_reg = VGA_CRT_IM;
429 vga_video_port_val = VGA_CRT_DM;
430 if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) {
431 static struct resource ega_console_resource =
432 { .name = "ega",
433 .flags = IORESOURCE_IO,
434 .start = 0x3B0,
435 .end = 0x3BF };
436 vga_video_type = VIDEO_TYPE_EGAM;
437 vga_vram_size = 0x8000;
438 display_desc = "EGA+";
439 request_resource(&ioport_resource,
440 &ega_console_resource);
441 } else {
442 static struct resource mda1_console_resource =
443 { .name = "mda",
444 .flags = IORESOURCE_IO,
445 .start = 0x3B0,
446 .end = 0x3BB };
447 static struct resource mda2_console_resource =
448 { .name = "mda",
449 .flags = IORESOURCE_IO,
450 .start = 0x3BF,
451 .end = 0x3BF };
452 vga_video_type = VIDEO_TYPE_MDA;
453 vga_vram_size = 0x2000;
454 display_desc = "*MDA";
455 request_resource(&ioport_resource,
456 &mda1_console_resource);
457 request_resource(&ioport_resource,
458 &mda2_console_resource);
459 vga_video_font_height = 14;
460 }
461 } else {
462 /* If not, it is color. */
463 vga_can_do_color = true;
464 vram_phys = 0xb8000;
465 vga_video_port_reg = VGA_CRT_IC;
466 vga_video_port_val = VGA_CRT_DC;
467 if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) {
468 int i;
469
470 vga_vram_size = 0x8000;
471
472 if (!screen_info.orig_video_isVGA) {
473 static struct resource ega_console_resource =
474 { .name = "ega",
475 .flags = IORESOURCE_IO,
476 .start = 0x3C0,
477 .end = 0x3DF };
478 vga_video_type = VIDEO_TYPE_EGAC;
479 display_desc = "EGA";
480 request_resource(&ioport_resource,
481 &ega_console_resource);
482 } else {
483 static struct resource vga_console_resource =
484 { .name = "vga+",
485 .flags = IORESOURCE_IO,
486 .start = 0x3C0,
487 .end = 0x3DF };
488 vga_video_type = VIDEO_TYPE_VGAC;
489 display_desc = "VGA+";
490 request_resource(&ioport_resource,
491 &vga_console_resource);
492
493 /*
494 * Normalise the palette registers, to point
495 * the 16 screen colours to the first 16
496 * DAC entries.
497 */
498
499 for (i = 0; i < 16; i++) {
500 inb_p(VGA_IS1_RC);
501 outb_p(i, VGA_ATT_W);
502 outb_p(i, VGA_ATT_W);
503 }
504 outb_p(0x20, VGA_ATT_W);
505
506 /*
507 * Now set the DAC registers back to their
508 * default values
509 */
510 for (i = 0; i < 16; i++) {
511 outb_p(color_table[i], VGA_PEL_IW);
512 outb_p(default_red[i], VGA_PEL_D);
513 outb_p(default_grn[i], VGA_PEL_D);
514 outb_p(default_blu[i], VGA_PEL_D);
515 }
516 }
517 } else {
518 static struct resource cga_console_resource =
519 { .name = "cga",
520 .flags = IORESOURCE_IO,
521 .start = 0x3D4,
522 .end = 0x3D5 };
523 vga_video_type = VIDEO_TYPE_CGA;
524 vga_vram_size = 0x2000;
525 display_desc = "*CGA";
526 request_resource(&ioport_resource,
527 &cga_console_resource);
528 vga_video_font_height = 8;
529 }
530 }
531
532 vga_vram_base = VGA_MAP_MEM(vram_phys, vga_vram_size);
533 vga_vram_end = (void *)vga_vram_base + vga_vram_size;
534
535 /*
536 * Find out if there is a graphics card present.
537 * Are there smarter methods around?
538 */
539 p = (volatile u16 *) vga_vram_base;
540 saved1 = scr_readw(p);
541 saved2 = scr_readw(p + 1);
542 scr_writew(0xAA55, p);
543 scr_writew(0x55AA, p + 1);
544 if (scr_readw(p) != 0xAA55 || scr_readw(p + 1) != 0x55AA) {
545 scr_writew(saved1, p);
546 scr_writew(saved2, p + 1);
547 goto no_vga;
548 }
549 scr_writew(0x55AA, p);
550 scr_writew(0xAA55, p + 1);
551 if (scr_readw(p) != 0x55AA || scr_readw(p + 1) != 0xAA55) {
552 scr_writew(saved1, p);
553 scr_writew(saved2, p + 1);
554 goto no_vga;
555 }
556 scr_writew(saved1, p);
557 scr_writew(saved2, p + 1);
558
559 if (vga_video_type == VIDEO_TYPE_EGAC
560 || vga_video_type == VIDEO_TYPE_VGAC
561 || vga_video_type == VIDEO_TYPE_EGAM) {
562 vga_hardscroll_enabled = vga_hardscroll_user_enable;
563 vga_default_font_height = screen_info.orig_video_points;
564 vga_video_font_height = screen_info.orig_video_points;
565 /* This may be suboptimal but is a safe bet - go with it */
566 vga_scan_lines =
567 vga_video_font_height * vga_video_num_lines;
568 }
569
570 vgacon_xres = screen_info.orig_video_cols * VGA_FONTWIDTH;
571 vgacon_yres = vga_scan_lines;
572
573 if (!vga_init_done) {
574 vgacon_scrollback_startup();
575 vga_init_done = true;
576 }
577
578 return display_desc;
579 }
580
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org