Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b3d5e1db66cd66148b2cebd2c38aff2a8df03d6
Commit:     3b3d5e1db66cd66148b2cebd2c38aff2a8df03d6
Parent:     f9690982b8c2f9a2c65acdc113e758ec356676a3
Author:     Rene Herman <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 13 13:26:22 2007 +0100
Committer:  Andi Kleen <[EMAIL PROTECTED]>
CommitDate: Tue Feb 13 13:26:22 2007 +0100

    [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: Rene Herman <[EMAIL PROTECTED]>
    Signed-off-by: Andi Kleen <[EMAIL PROTECTED]>
    Cc: Andi Kleen <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---
 arch/i386/kernel/e820.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/i386/kernel/e820.c b/arch/i386/kernel/e820.c
index 9ded1e4..70f3956 100644
--- a/arch/i386/kernel/e820.c
+++ b/arch/i386/kernel/e820.c
@@ -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;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to