login
Header Space

 
 

Re: [PATCH 12/12] net: use the common ascii hex helpers

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: <davem@...>, <linux-kernel@...>
Date: Friday, May 2, 2008 - 8:15 pm

On Fri, 2008-05-02 at 17:08 -0700, Andrew Morton wrote:

Sorry about the fat-fingered send, as before:

allyesconfig :(


int hex_char_to_int(char ch)
{
	return -1 if not [a-fA-F0-9]
}

int hex_to_u8(const char *buf, u8 *val)
int hex_to_u16(const char *buf, u16 *val)
int hex_to_u32(const char *buf, u32 *val)
int hex_to_u64(const char *buf, u64 *val)

Which return the number of chars read and reads up to a maximum of
2,4,8,16 chars respectively and returns early if a non-hex char
is encountered.

Thoughts?

Harvey

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 12/12] net: use the common ascii hex helpers, Harvey Harrison, (Fri May 2, 3:01 pm)
Re: [PATCH 12/12] net: use the common ascii hex helpers, Andrew Morton, (Fri May 2, 7:31 pm)
Re: [PATCH 12/12] net: use the common ascii hex helpers, Harvey Harrison, (Fri May 2, 7:52 pm)
Re: [PATCH 12/12] net: use the common ascii hex helpers, Andrew Morton, (Fri May 2, 8:08 pm)
Re: [PATCH 12/12] net: use the common ascii hex helpers, Harvey Harrison, (Fri May 2, 8:15 pm)
Re: [PATCH 12/12] net: use the common ascii hex helpers, Andrew Morton, (Fri May 2, 8:30 pm)
Re: [PATCH 12/12] net: use the common ascii hex helpers, Harvey Harrison, (Fri May 2, 8:11 pm)
Re: [PATCH 12/12] net: use the common ascii hex helpers, Andrew Morton, (Fri May 2, 7:43 pm)
speck-geostationary