Skip to content

Commit 0cc6d77

Browse files
committed
Merge branch 'x86-setup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-setup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: x86, e820: Guard against array overflowed in __e820_add_region() x86, setup: remove obsolete pre-Kconfig CONFIG_VIDEO_ variables
2 parents 55e0715 + 5051fd6 commit 0cc6d77

5 files changed

Lines changed: 4 additions & 40 deletions

File tree

‎arch/x86/boot/video-vesa.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ static inline void vesa_store_mode_params_graphics(void) {}
3131

3232
static int vesa_probe(void)
3333
{
34-
#if defined(CONFIG_VIDEO_VESA) || defined(CONFIG_FIRMWARE_EDID)
3534
struct biosregs ireg, oreg;
3635
u16 mode;
3736
addr_t mode_ptr;
@@ -49,8 +48,7 @@ static int vesa_probe(void)
4948
vginfo.signature != VESA_MAGIC ||
5049
vginfo.version < 0x0102)
5150
return 0; /* Not present */
52-
#endif /* CONFIG_VIDEO_VESA || CONFIG_FIRMWARE_EDID */
53-
#ifdef CONFIG_VIDEO_VESA
51+
5452
set_fs(vginfo.video_mode_ptr.seg);
5553
mode_ptr = vginfo.video_mode_ptr.off;
5654

@@ -102,9 +100,6 @@ static int vesa_probe(void)
102100
}
103101

104102
return nmodes;
105-
#else
106-
return 0;
107-
#endif /* CONFIG_VIDEO_VESA */
108103
}
109104

110105
static int vesa_set_mode(struct mode_info *mode)

‎arch/x86/boot/video-vga.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,16 @@ static u8 vga_set_basic_mode(void)
4747

4848
initregs(&ireg);
4949

50-
#ifdef CONFIG_VIDEO_400_HACK
51-
if (adapter >= ADAPTER_VGA) {
52-
ireg.ax = 0x1202;
53-
ireg.bx = 0x0030;
54-
intcall(0x10, &ireg, NULL);
55-
}
56-
#endif
57-
5850
ax = 0x0f00;
5951
intcall(0x10, &ireg, &oreg);
6052
mode = oreg.al;
6153

6254
set_fs(0);
6355
rows = rdfs8(0x484); /* rows minus one */
6456

65-
#ifndef CONFIG_VIDEO_400_HACK
6657
if ((oreg.ax == 0x5003 || oreg.ax == 0x5007) &&
6758
(rows == 0 || rows == 24))
6859
return mode;
69-
#endif
7060

7161
if (mode != 3 && mode != 7)
7262
mode = 3;

‎arch/x86/boot/video.c‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ static unsigned int mode_menu(void)
221221
}
222222
}
223223

224-
#ifdef CONFIG_VIDEO_RETAIN
225224
/* Save screen content to the heap */
226225
static struct saved_screen {
227226
int x, y;
@@ -299,10 +298,6 @@ static void restore_screen(void)
299298
ireg.dl = saved.curx;
300299
intcall(0x10, &ireg, NULL);
301300
}
302-
#else
303-
#define save_screen() ((void)0)
304-
#define restore_screen() ((void)0)
305-
#endif
306301

307302
void set_video(void)
308303
{

‎arch/x86/boot/video.h‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,8 @@
1717

1818
#include <linux/types.h>
1919

20-
/* Enable autodetection of SVGA adapters and modes. */
21-
#undef CONFIG_VIDEO_SVGA
22-
23-
/* Enable autodetection of VESA modes */
24-
#define CONFIG_VIDEO_VESA
25-
26-
/* Retain screen contents when switching modes */
27-
#define CONFIG_VIDEO_RETAIN
28-
29-
/* Force 400 scan lines for standard modes (hack to fix bad BIOS behaviour */
30-
#undef CONFIG_VIDEO_400_HACK
31-
32-
/* This code uses an extended set of video mode numbers. These include:
20+
/*
21+
* This code uses an extended set of video mode numbers. These include:
3322
* Aliases for standard modes
3423
* NORMAL_VGA (-1)
3524
* EXTENDED_VGA (-2)
@@ -67,13 +56,8 @@
6756
/* The "recalculate timings" flag */
6857
#define VIDEO_RECALC 0x8000
6958

70-
/* Define DO_STORE according to CONFIG_VIDEO_RETAIN */
71-
#ifdef CONFIG_VIDEO_RETAIN
7259
void store_screen(void);
7360
#define DO_STORE() store_screen()
74-
#else
75-
#define DO_STORE() ((void)0)
76-
#endif /* CONFIG_VIDEO_RETAIN */
7761

7862
/*
7963
* Mode table structures

‎arch/x86/kernel/e820.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static void __init __e820_add_region(struct e820map *e820x, u64 start, u64 size,
115115
{
116116
int x = e820x->nr_map;
117117

118-
if (x == ARRAY_SIZE(e820x->map)) {
118+
if (x >= ARRAY_SIZE(e820x->map)) {
119119
printk(KERN_ERR "Ooops! Too many entries in the memory map!\n");
120120
return;
121121
}

0 commit comments

Comments
 (0)