aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386/kernel/e820.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/i386/kernel/e820.c')
-rw-r--r--arch/i386/kernel/e820.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/i386/kernel/e820.c b/arch/i386/kernel/e820.c
index 9ded1e49119e..70f39560846a 100644
--- a/arch/i386/kernel/e820.c
+++ b/arch/i386/kernel/e820.c
@@ -157,21 +157,22 @@ static struct resource standard_io_resources[] = { {
157 .flags = IORESOURCE_BUSY | IORESOURCE_IO 157 .flags = IORESOURCE_BUSY | IORESOURCE_IO
158} }; 158} };
159 159
160static int romsignature(const unsigned char *x) 160#define ROMSIGNATURE 0xaa55
161
162static int __init romsignature(const unsigned char *rom)
161{ 163{
162 unsigned short sig; 164 unsigned short sig;
163 int ret = 0; 165
164 if (probe_kernel_address((const unsigned short *)x, sig) == 0) 166 return probe_kernel_address((const unsigned short *)rom, sig) == 0 &&
165 ret = (sig == 0xaa55); 167 sig == ROMSIGNATURE;
166 return ret;
167} 168}
168 169
169static int __init romchecksum(unsigned char *rom, unsigned long length) 170static int __init romchecksum(unsigned char *rom, unsigned long length)
170{ 171{
171 unsigned char *p, sum = 0; 172 unsigned char sum;
172 173
173 for (p = rom; p < rom + length; p++) 174 for (sum = 0; length; length--)
174 sum += *p; 175 sum += *rom++;
175 return sum == 0; 176 return sum == 0;
176} 177}
177 178