From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752861AbbI3PCF (ORCPT ); Wed, 30 Sep 2015 11:02:05 -0400 Received: from mga03.intel.com ([134.134.136.65]:42515 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751317AbbI3PCE (ORCPT ); Wed, 30 Sep 2015 11:02:04 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,612,1437462000"; d="scan'208";a="780984119" Message-ID: <1443625184.8361.310.camel@linux.intel.com> Subject: Re: [PATCH v1] OLPC: use %*ph specifier instead of passing direct values From: Andy Shevchenko To: Paul Fox , Darren Hart Cc: linux-kernel@vger.kernel.org, Andres Salomon , Andrew Morton Date: Wed, 30 Sep 2015 17:59:44 +0300 In-Reply-To: <20141229143210.C9C685180445@grass.foxharp.boston.ma.us> References: <1419856010-9528-1-git-send-email-andriy.shevchenko@linux.intel.com> (sfid-20141229_072643_678691_70512A7F) <20141229143210.C9C685180445@grass.foxharp.boston.ma.us> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2014-12-29 at 09:32 -0500, Paul Fox wrote: > change looks okay to me. > Acked-by: Paul Fox > 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 > > --- > > 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 Intel Finland Oy