提交 ee1ef82c 编写于 作者: H Harald Welte 提交者: Linus Torvalds

viafb: make it work on x86_64

Fix a bug in viafb on x86_64 builds (e.g. for VIA Nano CPU).

You cannot make the assumption that sizeof(unsigned int) ==
sizeof(unsigned long), so the parsing of the default mode (640x480) fails,
leading to a division by zero during insmod of the driver.
Signed-off-by: NHarald Welte <HaraldWelte@viatech.com>
Cc: <JosephChan@via.com.tw>
Cc: <ScottFang@viatech.com.cn>
Cc: Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 ee83126b
...@@ -2103,7 +2103,7 @@ static void viafb_remove_proc(struct proc_dir_entry *viafb_entry) ...@@ -2103,7 +2103,7 @@ static void viafb_remove_proc(struct proc_dir_entry *viafb_entry)
static int __devinit via_pci_probe(void) static int __devinit via_pci_probe(void)
{ {
unsigned int default_xres, default_yres; unsigned long default_xres, default_yres;
char *tmpc, *tmpm; char *tmpc, *tmpm;
char *tmpc_sec, *tmpm_sec; char *tmpc_sec, *tmpm_sec;
int vmode_index; int vmode_index;
...@@ -2196,8 +2196,8 @@ static int __devinit via_pci_probe(void) ...@@ -2196,8 +2196,8 @@ static int __devinit via_pci_probe(void)
viafb_FB_MM = viaparinfo->fbmem_virt; viafb_FB_MM = viaparinfo->fbmem_virt;
tmpm = viafb_mode; tmpm = viafb_mode;
tmpc = strsep(&tmpm, "x"); tmpc = strsep(&tmpm, "x");
strict_strtoul(tmpc, 0, (unsigned long *)&default_xres); strict_strtoul(tmpc, 0, &default_xres);
strict_strtoul(tmpm, 0, (unsigned long *)&default_yres); strict_strtoul(tmpm, 0, &default_yres);
vmode_index = viafb_get_mode_index(default_xres, default_yres, 0); vmode_index = viafb_get_mode_index(default_xres, default_yres, 0);
DEBUG_MSG(KERN_INFO "0->index=%d\n", vmode_index); DEBUG_MSG(KERN_INFO "0->index=%d\n", vmode_index);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册