[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130314003837.GA11886@core.coreip.homeip.net>
Date: Wed, 13 Mar 2013 17:38:37 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Benson Leung <bleung@...omium.org>
Cc: rydberg@...omail.se, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org, olofj@...omium.org,
djkurtz@...omium.org, dudl@...ress.com
Subject: Re: [PATCH 2/4] Input: cyapa - Firmware update via request firmware
On Wed, Mar 13, 2013 at 04:50:49PM -0700, Benson Leung wrote:
> +
> +#define BYTE_PER_LINE 8
> +void cyapa_dump_data(struct cyapa *cyapa, size_t length, const u8 *data)
> +{
> +#ifdef DEBUG
> + struct device *dev = &cyapa->client->dev;
> + int i;
> + char buf[BYTE_PER_LINE * 3 + 1];
> + char *s = buf;
> +
> + for (i = 0; i < length; i++) {
> + s += sprintf(s, " %02x", data[i]);
> + if ((i + 1) == length || ((i + 1) % BYTE_PER_LINE) == 0) {
> + dev_dbg(dev, "%s\n", buf);
> + s = buf;
> + }
> + }
> +#endif
> +}
> +#undef BYTE_PER_LINE
We have dev_dbg("%*ph\n", BYTES_PER_LINE, data[...]); for this.
Thanks.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists