lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 05 Sep 2014 21:21:08 +0400
From:	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
	Samuel Ortiz <samuel@...tiz.org>, netdev@...r.kernel.org
Subject: Re: [PATCH] irda: vlsi_ir: use %*ph specifier

Hello.

On 09/05/2014 06:37 PM, Andy Shevchenko wrote:

> Instead of looping in the code let's use kernel extension to dump small
> buffers.

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>   drivers/net/irda/vlsi_ir.c | 11 +++--------
>   1 file changed, 3 insertions(+), 8 deletions(-)

> diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
> index a04af9d..0319eba 100644
> --- a/drivers/net/irda/vlsi_ir.c
> +++ b/drivers/net/irda/vlsi_ir.c
> @@ -323,14 +323,9 @@ static void vlsi_proc_ring(struct seq_file *seq, struct vlsi_ring *r)
>   		j = (unsigned) rd_get_count(rd);
>   		seq_printf(seq, "current: rd = %d / status = %02x / len = %u\n",
>   				h, (unsigned)rd_get_status(rd), j);
> -		if (j > 0) {
> -			seq_printf(seq, "   data:");
> -			if (j > 20)
> -				j = 20;
> -			for (i = 0; i < j; i++)
> -				seq_printf(seq, " %02x", (unsigned)((unsigned char *)rd->buf)[i]);
> -			seq_printf(seq, "\n");
> -		}
> +		if (j > 0)
> +			seq_printf(seq, "   data: %*ph\n", j > 20 ? 20 : j,

    Why not min(j, 20)?

> +				   rd->buf);
>   	}

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ