ecryptfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tyler Hicks <tyhicks@canonical.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: ecryptfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@pengutronix.de
Subject: Re: [PATCH] ecryptfs: use print_hex_dump_bytes for hexdump
Date: Wed, 19 Jun 2019 01:35:56 -0500	[thread overview]
Message-ID: <20190619063555.GC22021@lindsey> (raw)
In-Reply-To: <20190517104515.10371-1-s.hauer@pengutronix.de>

On 2019-05-17 12:45:15, Sascha Hauer wrote:
> The Kernel has nice hexdump facilities, use them rather a homebrew
> hexdump function.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Thanks! This is much nicer. I've pushed the commit to the eCryptfs next
branch.

Tyler

> ---
>  fs/ecryptfs/debug.c | 22 +++-------------------
>  1 file changed, 3 insertions(+), 19 deletions(-)
> 
> diff --git a/fs/ecryptfs/debug.c b/fs/ecryptfs/debug.c
> index 3d2bdf546ec6..ee9d8ac4a809 100644
> --- a/fs/ecryptfs/debug.c
> +++ b/fs/ecryptfs/debug.c
> @@ -97,25 +97,9 @@ void ecryptfs_dump_auth_tok(struct ecryptfs_auth_tok *auth_tok)
>   */
>  void ecryptfs_dump_hex(char *data, int bytes)
>  {
> -	int i = 0;
> -	int add_newline = 1;
> -
>  	if (ecryptfs_verbosity < 1)
>  		return;
> -	if (bytes != 0) {
> -		printk(KERN_DEBUG "0x%.2x.", (unsigned char)data[i]);
> -		i++;
> -	}
> -	while (i < bytes) {
> -		printk("0x%.2x.", (unsigned char)data[i]);
> -		i++;
> -		if (i % 16 == 0) {
> -			printk("\n");
> -			add_newline = 0;
> -		} else
> -			add_newline = 1;
> -	}
> -	if (add_newline)
> -		printk("\n");
> -}
>  
> +	print_hex_dump(KERN_DEBUG, "ecryptfs: ", DUMP_PREFIX_OFFSET, 16, 1,
> +		       data, bytes, false);
> +}
> -- 
> 2.20.1
> 

      reply	other threads:[~2019-06-19  6:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 10:45 [PATCH] ecryptfs: use print_hex_dump_bytes for hexdump Sascha Hauer
2019-06-19  6:35 ` Tyler Hicks [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=20190619063555.GC22021@lindsey \
    --to=tyhicks@canonical.com \
    --cc=ecryptfs@vger.kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).