From: Andrew Morton <akpm@linux-foundation.org>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] lib: add ascii hex helper functions
Date: Mon, 5 May 2008 14:58:07 -0700 [thread overview]
Message-ID: <20080505145807.da846236.akpm@linux-foundation.org> (raw)
In-Reply-To: <1209842847.26173.122.camel@brick>
On Sat, 03 May 2008 12:27:27 -0700
Harvey Harrison <harvey.harrison@gmail.com> wrote:
> Everyone rolls their own version around the tree, centralize
> in lib/hexdump.c. Move the only existing users of hex_asc over
> to the hi/lo helpers.
>
> Add helpers for reading binary values from a stream of hex chars.
> Most existing users want to know how many chars were read as well.
> This implementation chooses to return the number of chars read
> and takes a pointer to the value being read.
>
> As an alternative, a char **buf could be passed and the value could
> be returned and the pointer updated by reference.
>
> Fixed size helpers for u8, u16, u32 and u64 have been added with
> another helper that takes an argument specifying the max number of
> chars to read (capped to the size that will fit in an unsigned long)
>
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
> Andrew, I've thought a little more about this, It's possible we could
> get away without the u8/u16 helpers, but it does make the api nicely
> complete, and they are pretty small. Most users really want to read
> a long or an int, but many can be move to the u32/u64 versions to
> tighten up implicit assumptions being made about the length being
> read.
hex_to_val() is distressingly similar to simple_strtoul(..., ..., 16).
> I'll wait for coment before fixing the previous series of patches to
> use these.
I'm all worn out on this one.
prev parent reply other threads:[~2008-05-05 21:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-03 19:27 [RFC PATCH] lib: add ascii hex helper functions Harvey Harrison
2008-05-04 16:35 ` Cyrill Gorcunov
2008-05-05 21:58 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080505145807.da846236.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=harvey.harrison@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox