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