From: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>
To: Thomas Gleixner <tglx@linutronix.de>,
Gavin Shan <gwshan@linux.vnet.ibm.com>
Cc: linux-pci@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
linuxppc-dev@lists.ozlabs.org, Christoph Hellwig <hch@lst.de>,
gabriel@krisman.be, bsingharora@gmail.com
Subject: Re: [PATCH] genirq/affinity: fix node generation from cpumask
Date: Thu, 15 Dec 2016 10:38:33 -0200 [thread overview]
Message-ID: <58528EC9.3060009@linux.vnet.ibm.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1612151036340.3470@nanos>
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
next prev parent reply other threads:[~2016-12-15 16:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-14 18:01 [PATCH] genirq/affinity: fix node generation from cpumask Guilherme G. Piccoli
2016-12-14 23:24 ` Gavin Shan
2016-12-15 9:36 ` Thomas Gleixner
2016-12-15 12:38 ` Guilherme G. Piccoli [this message]
2016-12-15 1:05 ` Gabriel Krisman Bertazi
2016-12-15 8:54 ` Christoph Hellwig
2016-12-15 11:37 ` [tip:irq/urgent] genirq/affinity: Fix " tip-bot for Guilherme G. Piccoli
2016-12-15 12:34 ` [PATCH] genirq/affinity: fix " Balbir Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=58528EC9.3060009@linux.vnet.ibm.com \
--to=gpiccoli@linux.vnet.ibm.com \
--cc=bsingharora@gmail.com \
--cc=gabriel@krisman.be \
--cc=gwshan@linux.vnet.ibm.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.