https://github.com/torvalds/linux
Revision 103a1d5c57fac3623613b130b104f5b03367b31c authored by Alan Cox on 04 August 2008, 16:56:28 UTC, committed by Linus Torvalds on 05 August 2008, 00:12:08 UTC
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8183006
Raw File
Tip revision: 103a1d5c57fac3623613b130b104f5b03367b31c authored by Alan Cox on 04 August 2008, 16:56:28 UTC
sc1200 watchdog driver: Fix locking, sems and coding style
Tip revision: 103a1d5
check_signature.c
#include <linux/io.h>
#include <linux/module.h>

/**
 *	check_signature		-	find BIOS signatures
 *	@io_addr: mmio address to check
 *	@signature:  signature block
 *	@length: length of signature
 *
 *	Perform a signature comparison with the mmio address io_addr. This
 *	address should have been obtained by ioremap.
 *	Returns 1 on a match.
 */

int check_signature(const volatile void __iomem *io_addr,
			const unsigned char *signature, int length)
{
	while (length--) {
		if (readb(io_addr) != *signature)
			return 0;
		io_addr++;
		signature++;
	}
	return 1;
}
EXPORT_SYMBOL(check_signature);
back to top