Skip to content

Commit

Permalink
[PATCH] i386: romsignature/checksum cleanup
Browse files Browse the repository at this point in the history
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: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
  • Loading branch information
Rene Herman authored and Andi Kleen committed Feb 13, 2007
1 parent f969098 commit 3b3d5e1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions arch/i386/kernel/e820.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,22 @@ static struct resource standard_io_resources[] = { {
.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;
int ret = 0;
if (probe_kernel_address((const unsigned short *)x, sig) == 0)
ret = (sig == 0xaa55);
return ret;

return probe_kernel_address((const unsigned short *)rom, sig) == 0 &&
sig == ROMSIGNATURE;
}

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++)
sum += *p;
for (sum = 0; length; length--)
sum += *rom++;
return sum == 0;
}

Expand Down

0 comments on commit 3b3d5e1

Please sign in to comment.