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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to