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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <58528EC9.3060009@linux.vnet.ibm.com>
Date:   Thu, 15 Dec 2016 10:38:33 -0200
From:   "Guilherme G. Piccoli" <gpiccoli@...ux.vnet.ibm.com>
To:     Thomas Gleixner <tglx@...utronix.de>,
        Gavin Shan <gwshan@...ux.vnet.ibm.com>
Cc:     linux-pci@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
        linuxppc-dev@...ts.ozlabs.org, Christoph Hellwig <hch@....de>,
        gabriel@...sman.be, bsingharora@...il.com
Subject: Re: [PATCH] genirq/affinity: fix node generation from cpumask

On 12/15/2016 07:36 AM, Thomas Gleixner wrote:
> On Thu, 15 Dec 2016, Gavin Shan wrote:
>>> static int get_nodes_in_cpumask(const struct cpumask *mask, nodemask_t *nodemsk)
>>> {
>>> -	int n, nodes;
>>> +	int n, nodes = 0;
>>>
>>> 	/* Calculate the number of nodes in the supplied affinity mask */
>>> -	for (n = 0, nodes = 0; n < num_online_nodes(); n++) {
>>> +	for_each_online_node(n)
>>> 		if (cpumask_intersects(mask, cpumask_of_node(n))) {
>>> 			node_set(n, *nodemsk);
>>> 			nodes++;
>>> 		}
>>> -	}
>>> +
>>
>> It'd better to keep the brackets so that we needn't add them when adding
>> more code into the block next time.
> 
> Removing the brackets is outright wrong. See:
>   https://marc.info/?l=linux-kernel&m=147351236615103
> 
> I'll fix that up when applying the patch.
> 
> Thanks,
> 
> 	tglx
> 

Thanks you all very much for the reviews and comments - lesson learned
about the brackets in multi-line if/for statements!

Thanks for fixing it Thomas.
Cheers,


Guilherme

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ