[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150411130637.GD6540@thunk.org>
Date: Sat, 11 Apr 2015 09:06:37 -0400
From: Theodore Ts'o <tytso@....edu>
To: Andreas Dilger <adilger@...ger.ca>
Cc: Ext4 Developers List <linux-ext4@...r.kernel.org>,
jaegeuk@...nel.org, mhalcrow@...gle.com,
Ildar Muslukhov <muslukhovi@...il.com>
Subject: Re: [PATCH 06/22] ext4 crypto: add encryption policy checking
On Mon, Apr 06, 2015 at 03:31:49PM -0600, Andreas Dilger wrote:
> > +/**
> > + * ext4_to_hex() - Converts to hexadecimal characters
> > + * @dst: Buffer to take hex character representation of contents of
> > + * src. Must be at least of size (src_size * 2).
> > + * @src: Buffer to be converted to a hex string respresentation.
> > + * @src_size: Number of bytes to convert.
> > + */
> > +void ext4_to_hex(char *dst, char *src, size_t src_size)
> > +{
> > + int x;
> > +
> > + for (x = 0; x < src_size; x++)
> > + sprintf(&dst[x * 2], "%.2x", (unsigned char)src[x]);
> > +}
>
> I think there is already some code in printk() to handle this? Looking
> at vsnprintf->hex_string() it looks like "%*ph" would print out up to 64
> bytes as hex.
As it turns out we're not even using ext4_to_hex() any more, so we can
even more simply just delete this whole function. :-)
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists