/* Return: 0-255 Success, the byte was parsed correctly -1 Error, an invalid character was supplied  */
static int ldm_parse_hexbyte(const u8 *src)
/* Return: 0-255 Success, the byte was parsed correctly -1 Error, an invalid character was supplied  */
static int ldm_parse_hexbyte(const u8 *src)
{
	unsigned int x;
	int h;
	if      ((x = src[0] - '0') <= '9'-'0') h = x;
	else if ((x = src[0] - 'a') <= 'f'-'a') h = x+10;
	else if ((x = src[0] - 'A') <= 'F'-'A') h = x+10;
	else return -1;
	h <<= 4;
	if ((x = src[1] - '0') <= '9'-'0') return h | x;
	if ((x = src[1] - 'a') <= 'f'-'a') return h | (x+10);
	if ((x = src[1] - 'A') <= 'F'-'A') return h | (x+10);
	return -1;
}