Commit 3b3d5e1d authored by Rene Herman's avatar Rene Herman Committed by Andi Kleen

[PATCH] i386: romsignature/checksum cleanup

Use adding __init to romsignature() (it's only called from probe_roms()
which is itself __init) as an excuse to submit a pedantic cleanup.
Signed-off-by: default avatarRene Herman <rene.herman@gmail.com>
Signed-off-by: default avatarAndi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
parent f9690982
...@@ -157,21 +157,22 @@ static struct resource standard_io_resources[] = { { ...@@ -157,21 +157,22 @@ static struct resource standard_io_resources[] = { {
.flags = IORESOURCE_BUSY | IORESOURCE_IO .flags = IORESOURCE_BUSY | IORESOURCE_IO
} }; } };
static int romsignature(const unsigned char *x) #define ROMSIGNATURE 0xaa55
static int __init romsignature(const unsigned char *rom)
{ {
unsigned short sig; unsigned short sig;
int ret = 0;
if (probe_kernel_address((const unsigned short *)x, sig) == 0) return probe_kernel_address((const unsigned short *)rom, sig) == 0 &&
ret = (sig == 0xaa55); sig == ROMSIGNATURE;
return ret;
} }
static int __init romchecksum(unsigned char *rom, unsigned long length) static int __init romchecksum(unsigned char *rom, unsigned long length)
{ {
unsigned char *p, sum = 0; unsigned char sum;
for (p = rom; p < rom + length; p++) for (sum = 0; length; length--)
sum += *p; sum += *rom++;
return sum == 0; return sum == 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment