All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mfd: pcf50633: use sprintf directly
Date: Thu, 4 Sep 2014 11:05:03 +0100	[thread overview]
Message-ID: <20140904100503.GF1397@lee--X1> (raw)
In-Reply-To: <1409823132-12705-1-git-send-email-andriy.shevchenko@linux.intel.com>

On Thu, 04 Sep 2014, Andy Shevchenko wrote:

> When dump a content of the registers let's use snprintf() directly with %*ph
> specifier.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/mfd/pcf50633-core.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
> index c87f7a0..8401552 100644
> --- a/drivers/mfd/pcf50633-core.c
> +++ b/drivers/mfd/pcf50633-core.c
> @@ -106,10 +106,7 @@ static ssize_t show_dump_regs(struct device *dev, struct device_attribute *attr,
>  			} else
>  				dump[n1] = pcf50633_reg_read(pcf, n + n1);
>  
> -		hex_dump_to_buffer(dump, sizeof(dump), 16, 1, buf1, 128, 0);
> -		buf1 += strlen(buf1);
> -		*buf1++ = '\n';
> -		*buf1 = '\0';
> +		buf1 += sprintf(buf1, "%*ph\n", (int)sizeof(dump), dump);
>  	}
>  
>  	return buf1 - buf;

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

      reply	other threads:[~2014-09-04 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-04  9:32 [PATCH] mfd: pcf50633: use sprintf directly Andy Shevchenko
2014-09-04 10:05 ` Lee Jones [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=20140904100503.GF1397@lee--X1 \
    --to=lee.jones@linaro.org \
    --cc=andriy.shevchenko@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.