* [PATCH v1] OLPC: use %*ph specifier instead of passing direct values
@ 2014-12-29 12:26 Andy Shevchenko
2014-12-29 14:32 ` Paul Fox
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2014-12-29 12:26 UTC (permalink / raw)
To: linux-kernel, Andres Salomon, Paul Fox, Andrew Morton; +Cc: Andy Shevchenko
The %*ph specifier allows to dump small buffers in hex format. Let's use it
instead of passing direct values via stack.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/platform/olpc/olpc-ec.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c
index f911952..f99b183 100644
--- a/drivers/platform/olpc/olpc-ec.c
+++ b/drivers/platform/olpc/olpc-ec.c
@@ -192,18 +192,15 @@ static ssize_t ec_dbgfs_cmd_write(struct file *file, const char __user *buf,
for (i = 0; i <= ec_cmd_bytes; i++)
ec_cmd[i] = ec_cmd_int[i];
- pr_debug("olpc-ec: debugfs cmd 0x%02x with %d args %02x %02x %02x %02x %02x, want %d returns\n",
- ec_cmd[0], ec_cmd_bytes, ec_cmd[1], ec_cmd[2],
- ec_cmd[3], ec_cmd[4], ec_cmd[5], ec_dbgfs_resp_bytes);
+ pr_debug("olpc-ec: debugfs cmd 0x%02x with %d args %5ph, want %d returns\n",
+ ec_cmd[0], ec_cmd_bytes, ec_cmd + 1,
+ ec_dbgfs_resp_bytes);
olpc_ec_cmd(ec_cmd[0], (ec_cmd_bytes == 0) ? NULL : &ec_cmd[1],
ec_cmd_bytes, ec_dbgfs_resp, ec_dbgfs_resp_bytes);
- pr_debug("olpc-ec: response %02x %02x %02x %02x %02x %02x %02x %02x (%d bytes expected)\n",
- ec_dbgfs_resp[0], ec_dbgfs_resp[1], ec_dbgfs_resp[2],
- ec_dbgfs_resp[3], ec_dbgfs_resp[4], ec_dbgfs_resp[5],
- ec_dbgfs_resp[6], ec_dbgfs_resp[7],
- ec_dbgfs_resp_bytes);
+ pr_debug("olpc-ec: response %8ph (%d bytes expected)\n",
+ ec_dbgfs_resp, ec_dbgfs_resp_bytes);
out:
mutex_unlock(&ec_dbgfs_lock);
--
2.1.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] OLPC: use %*ph specifier instead of passing direct values
2014-12-29 12:26 [PATCH v1] OLPC: use %*ph specifier instead of passing direct values Andy Shevchenko
@ 2014-12-29 14:32 ` Paul Fox
2015-09-30 14:59 ` Andy Shevchenko
0 siblings, 1 reply; 4+ messages in thread
From: Paul Fox @ 2014-12-29 14:32 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-kernel, Andres Salomon, Andrew Morton
change looks okay to me.
Acked-by: Paul Fox <pgf@laptop.org>
paul
andy wrote:
> The %*ph specifier allows to dump small buffers in hex format. Let's use it
> instead of passing direct values via stack.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/platform/olpc/olpc-ec.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/platform/olpc/olpc-ec.c b/drivers/platform/olpc/olpc-ec.c
> index f911952..f99b183 100644
> --- a/drivers/platform/olpc/olpc-ec.c
> +++ b/drivers/platform/olpc/olpc-ec.c
> @@ -192,18 +192,15 @@ static ssize_t ec_dbgfs_cmd_write(struct file *file, const char __user *buf,
> for (i = 0; i <= ec_cmd_bytes; i++)
> ec_cmd[i] = ec_cmd_int[i];
>
> - pr_debug("olpc-ec: debugfs cmd 0x%02x with %d args %02x %02x %02x %02x %02x, want %d returns\n",
> - ec_cmd[0], ec_cmd_bytes, ec_cmd[1], ec_cmd[2],
> - ec_cmd[3], ec_cmd[4], ec_cmd[5], ec_dbgfs_resp_bytes);
> + pr_debug("olpc-ec: debugfs cmd 0x%02x with %d args %5ph, want %d returns\n",
> + ec_cmd[0], ec_cmd_bytes, ec_cmd + 1,
> + ec_dbgfs_resp_bytes);
>
> olpc_ec_cmd(ec_cmd[0], (ec_cmd_bytes == 0) ? NULL : &ec_cmd[1],
> ec_cmd_bytes, ec_dbgfs_resp, ec_dbgfs_resp_bytes);
>
> - pr_debug("olpc-ec: response %02x %02x %02x %02x %02x %02x %02x %02x (%d bytes expected)\n",
> - ec_dbgfs_resp[0], ec_dbgfs_resp[1], ec_dbgfs_resp[2],
> - ec_dbgfs_resp[3], ec_dbgfs_resp[4], ec_dbgfs_resp[5],
> - ec_dbgfs_resp[6], ec_dbgfs_resp[7],
> - ec_dbgfs_resp_bytes);
> + pr_debug("olpc-ec: response %8ph (%d bytes expected)\n",
> + ec_dbgfs_resp, ec_dbgfs_resp_bytes);
>
> out:
> mutex_unlock(&ec_dbgfs_lock);
> --
> 2.1.3
=---------------------
paul fox, pgf@laptop.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] OLPC: use %*ph specifier instead of passing direct values
2014-12-29 14:32 ` Paul Fox
@ 2015-09-30 14:59 ` Andy Shevchenko
2015-10-06 22:18 ` Darren Hart
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2015-09-30 14:59 UTC (permalink / raw)
To: Paul Fox, Darren Hart; +Cc: linux-kernel, Andres Salomon, Andrew Morton
On Mon, 2014-12-29 at 09:32 -0500, Paul Fox wrote:
> change looks okay to me.
> Acked-by: Paul Fox <pgf@laptop.org>
>
Darren, maybe you can apply this one? Seems OLPC is x86-based.
> paul
>
> andy wrote:
> > The %*ph specifier allows to dump small buffers in hex format.
> Let's use it
> > instead of passing direct values via stack.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > drivers/platform/olpc/olpc-ec.c | 13 +++++--------
> > 1 file changed, 5 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/platform/olpc/olpc-ec.c
> b/drivers/platform/olpc/olpc-ec.c
> > index f911952..f99b183 100644
> > --- a/drivers/platform/olpc/olpc-ec.c
> > +++ b/drivers/platform/olpc/olpc-ec.c
> > @@ -192,18 +192,15 @@ static ssize_t ec_dbgfs_cmd_write(struct
> file *file, const char __user *buf,
> > for (i = 0; i <= ec_cmd_bytes; i++)
> > ec_cmd[i] = ec_cmd_int[i];
> >
> > - pr_debug("olpc-ec: debugfs cmd 0x%02x with %d args %02x %02x
> %02x %02x %02x, want %d returns\n",
> > - ec_cmd[0], ec_cmd_bytes, ec_cmd[1],
> ec_cmd[2],
> > - ec_cmd[3], ec_cmd[4], ec_cmd[5],
> ec_dbgfs_resp_bytes);
> > + pr_debug("olpc-ec: debugfs cmd 0x%02x with %d args %5ph,
> want %d returns\n",
> > + ec_cmd[0], ec_cmd_bytes, ec_cmd + 1,
> > + ec_dbgfs_resp_bytes);
> >
> > olpc_ec_cmd(ec_cmd[0], (ec_cmd_bytes == 0) ? NULL :
> &ec_cmd[1],
> > ec_cmd_bytes, ec_dbgfs_resp,
> ec_dbgfs_resp_bytes);
> >
> > - pr_debug("olpc-ec: response %02x %02x %02x %02x %02x %02x
> %02x %02x (%d bytes expected)\n",
> > - ec_dbgfs_resp[0], ec_dbgfs_resp[1],
> ec_dbgfs_resp[2],
> > - ec_dbgfs_resp[3], ec_dbgfs_resp[4],
> ec_dbgfs_resp[5],
> > - ec_dbgfs_resp[6], ec_dbgfs_resp[7],
> > - ec_dbgfs_resp_bytes);
> > + pr_debug("olpc-ec: response %8ph (%d bytes expected)\n",
> > + ec_dbgfs_resp, ec_dbgfs_resp_bytes);
> >
> > out:
> > mutex_unlock(&ec_dbgfs_lock);
> > --
> > 2.1.3
>
> =---------------------
> paul fox, pgf@laptop.org
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] OLPC: use %*ph specifier instead of passing direct values
2015-09-30 14:59 ` Andy Shevchenko
@ 2015-10-06 22:18 ` Darren Hart
0 siblings, 0 replies; 4+ messages in thread
From: Darren Hart @ 2015-10-06 22:18 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Paul Fox, linux-kernel, Andres Salomon, Andrew Morton
On Wed, Sep 30, 2015 at 05:59:44PM +0300, Andy Shevchenko wrote:
> On Mon, 2014-12-29 at 09:32 -0500, Paul Fox wrote:
> > change looks okay to me.
> > Acked-by: Paul Fox <pgf@laptop.org>
> >
>
> Darren, maybe you can apply this one? Seems OLPC is x86-based.
Change is good, and olpc appears to be orphaned per MAINTAINERS. I'm OK
including it in my pull request along with an update to MAINTAINERS.
--
Darren Hart
Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-10-06 22:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-29 12:26 [PATCH v1] OLPC: use %*ph specifier instead of passing direct values Andy Shevchenko
2014-12-29 14:32 ` Paul Fox
2015-09-30 14:59 ` Andy Shevchenko
2015-10-06 22:18 ` Darren Hart
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox