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] [day] [month] [year] [list]
Date:	Thu, 1 Dec 2011 18:10:26 +0300
From:	Dan Carpenter <dan.carpenter@...cle.com>
To:	Marcos Paulo de Souza <marcos.mage@...il.com>
Cc:	linux-kernel@...r.kernel.org, devel@...verdev.osuosl.org,
	Greg Kroah-Hartman <gregkh@...e.de>,
	Forest Bond <forest@...ttletooquiet.net>
Subject: Re: [PATCH 3/4] staging: vt6656: datarate.c: Remove unneeded comments

On Thu, Dec 01, 2011 at 12:31:57AM +0000, Marcos Paulo de Souza wrote:
> -    // clear statistic counter for auto_rate
> -    for (ii = 0; ii <= MAX_RATE; ii++) {
> -        psNodeDBTable->uTxOk[ii] = 0;
> -        psNodeDBTable->uTxFail[ii] = 0;
> -    }
> +	/* clear statistic counter for auto_rate */
> +	for (ii = 0; ii <= MAX_RATE; ii++)
> +		psNodeDBTable->uTxOk[ii] = psNodeDBTable->uTxFail[ii] = 0;
>  }
>  

Don't do that...  Better to have the assignments on separate lines.

If you wanted, you could use memset and get rid of the loop.

void s_vResetCounter(PKnownNodeDB psNodeDBTable)
{
	memset(psNodeDBTable->uTxOk, 0, sizeof(psNodeDBTable->uTxOk));
	memset(psNodeDBTable->uTxFail, 0, sizeof(psNodeDBTable->uTxFail));
}

regards,
dan carpenter

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ