tree:
https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git devel
head: 82a313407ec913c11e42b0759a716809d42edffc
commit: 82337fd93f471d51590a65991c4ca9498ab2473b [44/52] make VGA_MAP_MEM return pointer
config: mips-randconfig-s031-20201014 (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce:
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-rc1-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git/commi...
git remote add jirislaby
https://git.kernel.org/pub/scm/linux/kernel/git/jirislaby/linux.git
git fetch --no-tags jirislaby devel
git checkout 82337fd93f471d51590a65991c4ca9498ab2473b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=mips
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:323:23: sparse: sparse: incorrect
type in assignment (different address spaces) @@ expected unsigned short [usertype]
*static [toplevel] vga_vram_base @@ got void [noderef] __iomem * @@
> drivers/video/console/vgacon.c:323:23: sparse: expected unsigned short [usertype]
*static [toplevel] vga_vram_base
> drivers/video/console/vgacon.c:323:23: sparse: got void [noderef] __iomem *
> drivers/video/console/vgacon.c:874:25: sparse: sparse: incorrect type in assignment
(different address spaces) @@ expected char *charmap @@ got void [noderef] __iomem
* @@
> drivers/video/console/vgacon.c:874:25: sparse: expected char *charmap
drivers/video/console/vgacon.c:874:25: sparse: got void [noderef] __iomem *
drivers/video/console/vgacon.c:877:25: sparse: sparse: incorrect type in assignment
(different address spaces) @@ expected char *charmap @@ got void [noderef] __iomem
* @@
drivers/video/console/vgacon.c:877:25: sparse: expected char *charmap
drivers/video/console/vgacon.c:877:25: sparse: got void [noderef] __iomem *
drivers/video/console/vgacon.c: note: in included file (through
include/linux/vt_buffer.h, include/linux/selection.h):
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:42:16: sparse: sparse: cast to restricted __le16
arch/mips/include/asm/vga.h:37:15: sparse: sparse: incorrect type in assignment
(different base types) @@ expected unsigned short volatile [usertype] @@ got
restricted __le16 [usertype] @@
arch/mips/include/asm/vga.h:37:15: sparse: expected unsigned short volatile
[usertype]
arch/mips/include/asm/vga.h:37:15: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:47:21: sparse: sparse: incorrect type in argument 2
(different base types) @@ expected unsigned short [usertype] @@ got restricted
__le16 [usertype] @@
arch/mips/include/asm/vga.h:47:21: sparse: expected unsigned short [usertype]
arch/mips/include/asm/vga.h:47:21: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:47:21: sparse: sparse: incorrect type in argument 2
(different base types) @@ expected unsigned short [usertype] @@ got restricted
__le16 [usertype] @@
arch/mips/include/asm/vga.h:47:21: sparse: expected unsigned short [usertype]
arch/mips/include/asm/vga.h:47:21: sparse: got restricted __le16 [usertype]
arch/mips/include/asm/vga.h:47:21: sparse: sparse: incorrect type in argument 2
(different base types) @@ expected unsigned short [usertype] @@ got restricted
__le16 [usertype] @@
arch/mips/include/asm/vga.h:47:21: sparse: expected unsigned short [usertype]
arch/mips/include/asm/vga.h:47:21: sparse: got restricted __le16 [usertype]
vim +323 drivers/video/console/vgacon.c
180
181 static const char *vgacon_startup(void)
182 {
183 const char *display_desc = NULL;
184 phys_addr_t vram_phys;
185 u16 saved1, saved2;
186 volatile u16 *p;
187
188 if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB ||
189 screen_info.orig_video_isVGA == VIDEO_TYPE_EFI) {
190 no_vga:
191 #ifdef CONFIG_DUMMY_CONSOLE
192 conswitchp = &dummy_con;
193 return conswitchp->con_startup();
194 #else
195 return NULL;
196 #endif
197 }
198
199 /* boot_params.screen_info reasonably initialized? */
200 if ((screen_info.orig_video_lines == 0) ||
201 (screen_info.orig_video_cols == 0))
202 goto no_vga;
203
204 /* VGA16 modes are not handled by VGACON */
205 if ((screen_info.orig_video_mode == 0x0D) || /* 320x200/4 */
206 (screen_info.orig_video_mode == 0x0E) || /* 640x200/4 */
207 (screen_info.orig_video_mode == 0x10) || /* 640x350/4 */
208 (screen_info.orig_video_mode == 0x12) || /* 640x480/4 */
209 (screen_info.orig_video_mode == 0x6A)) /* 800x600/4 (VESA) */
210 goto no_vga;
211
212 vga_video_num_lines = screen_info.orig_video_lines;
213 vga_video_num_columns = screen_info.orig_video_cols;
214 vgastate.vgabase = NULL;
215
216 if (screen_info.orig_video_mode == 7) {
217 /* Monochrome display */
218 vram_phys = 0xb0000;
219 vga_video_port_reg = VGA_CRT_IM;
220 vga_video_port_val = VGA_CRT_DM;
221 if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) {
222 static struct resource ega_console_resource =
223 { .name = "ega",
224 .flags = IORESOURCE_IO,
225 .start = 0x3B0,
226 .end = 0x3BF };
227 vga_video_type = VIDEO_TYPE_EGAM;
228 vga_vram_size = 0x8000;
229 display_desc = "EGA+";
230 request_resource(&ioport_resource,
231 &ega_console_resource);
232 } else {
233 static struct resource mda1_console_resource =
234 { .name = "mda",
235 .flags = IORESOURCE_IO,
236 .start = 0x3B0,
237 .end = 0x3BB };
238 static struct resource mda2_console_resource =
239 { .name = "mda",
240 .flags = IORESOURCE_IO,
241 .start = 0x3BF,
242 .end = 0x3BF };
243 vga_video_type = VIDEO_TYPE_MDA;
244 vga_vram_size = 0x2000;
245 display_desc = "*MDA";
246 request_resource(&ioport_resource,
247 &mda1_console_resource);
248 request_resource(&ioport_resource,
249 &mda2_console_resource);
250 vga_video_font_height = 14;
251 }
252 } else {
253 /* If not, it is color. */
254 vga_can_do_color = true;
255 vram_phys = 0xb8000;
256 vga_video_port_reg = VGA_CRT_IC;
257 vga_video_port_val = VGA_CRT_DC;
258 if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) {
259 int i;
260
261 vga_vram_size = 0x8000;
262
263 if (!screen_info.orig_video_isVGA) {
264 static struct resource ega_console_resource =
265 { .name = "ega",
266 .flags = IORESOURCE_IO,
267 .start = 0x3C0,
268 .end = 0x3DF };
269 vga_video_type = VIDEO_TYPE_EGAC;
270 display_desc = "EGA";
271 request_resource(&ioport_resource,
272 &ega_console_resource);
273 } else {
274 static struct resource vga_console_resource =
275 { .name = "vga+",
276 .flags = IORESOURCE_IO,
277 .start = 0x3C0,
278 .end = 0x3DF };
279 vga_video_type = VIDEO_TYPE_VGAC;
280 display_desc = "VGA+";
281 request_resource(&ioport_resource,
282 &vga_console_resource);
283
284 /*
285 * Normalise the palette registers, to point
286 * the 16 screen colours to the first 16
287 * DAC entries.
288 */
289
290 for (i = 0; i < 16; i++) {
291 inb_p(VGA_IS1_RC);
292 outb_p(i, VGA_ATT_W);
293 outb_p(i, VGA_ATT_W);
294 }
295 outb_p(0x20, VGA_ATT_W);
296
297 /*
298 * Now set the DAC registers back to their
299 * default values
300 */
301 for (i = 0; i < 16; i++) {
302 outb_p(color_table[i], VGA_PEL_IW);
303 outb_p(default_red[i], VGA_PEL_D);
304 outb_p(default_grn[i], VGA_PEL_D);
305 outb_p(default_blu[i], VGA_PEL_D);
306 }
307 }
308 } else {
309 static struct resource cga_console_resource =
310 { .name = "cga",
311 .flags = IORESOURCE_IO,
312 .start = 0x3D4,
313 .end = 0x3D5 };
314 vga_video_type = VIDEO_TYPE_CGA;
315 vga_vram_size = 0x2000;
316 display_desc = "*CGA";
317 request_resource(&ioport_resource,
318 &cga_console_resource);
319 vga_video_font_height = 8;
320 }
321 }
322
323 vga_vram_base = VGA_MAP_MEM(vram_phys, vga_vram_size);
324 vga_vram_end = (void *)vga_vram_base + vga_vram_size;
325
326 /*
327 * Find out if there is a graphics card present.
328 * Are there smarter methods around?
329 */
330 p = (volatile u16 *) vga_vram_base;
331 saved1 = scr_readw(p);
332 saved2 = scr_readw(p + 1);
333 scr_writew(0xAA55, p);
334 scr_writew(0x55AA, p + 1);
335 if (scr_readw(p) != 0xAA55 || scr_readw(p + 1) != 0x55AA) {
336 scr_writew(saved1, p);
337 scr_writew(saved2, p + 1);
338 goto no_vga;
339 }
340 scr_writew(0x55AA, p);
341 scr_writew(0xAA55, p + 1);
342 if (scr_readw(p) != 0x55AA || scr_readw(p + 1) != 0xAA55) {
343 scr_writew(saved1, p);
344 scr_writew(saved2, p + 1);
345 goto no_vga;
346 }
347 scr_writew(saved1, p);
348 scr_writew(saved2, p + 1);
349
350 if (vga_video_type == VIDEO_TYPE_EGAC
351 || vga_video_type == VIDEO_TYPE_VGAC
352 || vga_video_type == VIDEO_TYPE_EGAM) {
353 vga_hardscroll_enabled = vga_hardscroll_user_enable;
354 vga_default_font_height = screen_info.orig_video_points;
355 vga_video_font_height = screen_info.orig_video_points;
356 /* This may be suboptimal but is a safe bet - go with it */
357 vga_scan_lines =
358 vga_video_font_height * vga_video_num_lines;
359 }
360
361 vgacon_xres = screen_info.orig_video_cols * VGA_FONTWIDTH;
362 vgacon_yres = vga_scan_lines;
363
364 vga_init_done = true;
365
366 return display_desc;
367 }
368
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org