aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/bitops/minix.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/bitops/minix.h')
0 files changed, 0 insertions, 0 deletions
d='n237' href='#n237'>237 238 239 240 241 242
/*
 * lib/hexdump.c
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation. See README and COPYING for
 * more details.
 */

#include <linux/types.h>
#include <linux/ctype.h>
#include <linux/kernel.h>
#include <linux/module.h>

const char hex_asc[] = "0123456789abcdef";
EXPORT_SYMBOL(hex_asc);

/**
 * hex_to_bin - convert a hex digit to its real value
 * @ch: ascii character represents hex digit
 *
 * hex_to_bin() converts one hex digit to its actual value or -1 in case of bad
 * input.
 */
int hex_to_bin(char ch)
{
	if ((ch >= '0') && (ch <= '9'))
		return ch - '0';
	ch = tolower(ch);