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]
Message-ID: <1467028161.1847.101.camel@perches.com>
Date:	Mon, 27 Jun 2016 04:49:21 -0700
From:	Joe Perches <joe@...ches.com>
To:	Yisen Zhuang <Yisen.Zhuang@...wei.com>, davem@...emloft.net,
	salil.mehta@...wei.com, yankejian@...wei.com
Cc:	liguozhu@...wei.com, huangdaode@...ilicon.com, arnd@...db.de,
	andriy.shevchenko@...ux.intel.com, andrew@...n.ch,
	geliangtang@....com, ivecera@...hat.com, fengguang.wu@...el.com,
	charles.chenxin@...wei.com, netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linuxarm@...wei.com
Subject: Re: [PATCH net-next 6/9] net: hns: normalize two different loop

On Mon, 2016-06-27 at 17:54 +0800, Yisen Zhuang wrote:
> From: Daode Huang <huangdaode@...ilicon.com>
> 
> There are two approaches to assign data, one does 2 loops, another
> does 1 loop. This patch normalize the different methods to 1 loop.
[]
> diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
[]
> @@ -2567,15 +2567,15 @@ static char *hns_dsaf_get_node_stats_strings(char *data, int node,
>  	buff += ETH_GSTRING_LEN;
>  	if (node < DSAF_SERVICE_NW_NUM && !is_ver1) {
>  		for (i = 0; i < DSAF_PRIO_NR; i++) {
> -			snprintf(buff, ETH_GSTRING_LEN,
> -				 "inod%d_pfc_prio%d_pkts", node, i);
> -			buff += ETH_GSTRING_LEN;
> -		}
> -		for (i = 0; i < DSAF_PRIO_NR; i++) {
> -			snprintf(buff, ETH_GSTRING_LEN,
> -				 "onod%d_pfc_prio%d_pkts", node, i);
> +			snprintf(buff + 0 * ETH_GSTRING_LEN * DSAF_PRIO_NR,
> +				 ETH_GSTRING_LEN, "inod%d_pfc_prio%d_pkts",
> +				 node, i);
> +			snprintf(buff + 1 * ETH_GSTRING_LEN * DSAF_PRIO_NR,
> +				 ETH_GSTRING_LEN, "onod%d_pfc_prio%d_pkts",
> +				 node, i);
>  			buff += ETH_GSTRING_LEN;

This looks odd and likely incorrect.

>  		}
> +		buff += 1 * DSAF_PRIO_NR * ETH_GSTRING_LEN;
>  	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ