From: Frank Munzert Date: Thu, 26 Mar 2009 14:24:45 +0000 (+0100) Subject: [S390] Use csum_partial in checksum.h X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=159d1ff8f6c38086ed75f8e892790d0a4f3a6b71;p=linux-2.6-omap-h63xx.git [S390] Use csum_partial in checksum.h The cksm function in system.h is duplicate to csum_partial in checksum.h. Remove cksm and use csum_partial instead. Signed-off-by: Frank Munzert Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h index 3f2ccb82b86..3a8b26eb1f2 100644 --- a/arch/s390/include/asm/system.h +++ b/arch/s390/include/asm/system.h @@ -458,22 +458,6 @@ static inline unsigned short stap(void) return cpu_address; } -static inline u32 cksm(void *addr, unsigned long len) -{ - register unsigned long _addr asm("0") = (unsigned long) addr; - register unsigned long _len asm("1") = len; - unsigned long accu = 0; - - asm volatile( - "0:\n" - " cksm %0,%1\n" - " jnz 0b\n" - : "+d" (accu), "+d" (_addr), "+d" (_len) - : - : "cc", "memory"); - return accu; -} - extern void (*_machine_restart)(char *command); extern void (*_machine_halt)(void); extern void (*_machine_power_off)(void); diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index 5663c1f8e46..505fec06e63 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c @@ -24,6 +24,7 @@ #include #include #include +#include #define IPL_PARM_BLOCK_VERSION 0 @@ -1359,7 +1360,8 @@ static void dump_reipl_run(struct shutdown_trigger *trigger) "a" (&lowcore_ptr[smp_processor_id()]->ipib)); #endif asm volatile("stura %0,%1" - :: "a" (cksm(reipl_block_actual, reipl_block_actual->hdr.len)), + :: "a" (csum_partial(reipl_block_actual, + reipl_block_actual->hdr.len, 0)), "a" (&lowcore_ptr[smp_processor_id()]->ipib_checksum)); preempt_enable(); dump_run(trigger); diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index cfe782ee647..1bbae433fbd 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "sclp.h" #define TRACE(x...) debug_sprintf_event(zcore_dbf, 1, x) @@ -704,7 +705,8 @@ static int __init zcore_reipl_init(void) free_page((unsigned long) ipl_block); return rc; } - if (cksm(ipl_block, ipl_block->hdr.len) != ipib_info.checksum) { + if (csum_partial(ipl_block, ipl_block->hdr.len, 0) != + ipib_info.checksum) { TRACE("Checksum does not match\n"); free_page((unsigned long) ipl_block); ipl_block = NULL;