Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1542577

Re: [PATCH] genirq/affinity: fix node generation from cpumask

From Thomas Gleixner <tglx@linutronix.de>
Newsgroups linux.kernel
Subject Re: [PATCH] genirq/affinity: fix node generation from cpumask
Date 2016-12-15 10:40 +0100
Message-ID <sOAG5-45w-1@gated-at.bofh.it> (permalink)
References <sOma6-1ze-31@gated-at.bofh.it> <sOr9M-6Gb-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] genirq/affinity: fix node generation from cpumask "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com> - 2016-12-14 19:10 +0100
  Re: [PATCH] genirq/affinity: fix node generation from cpumask Gavin Shan <gwshan@linux.vnet.ibm.com> - 2016-12-15 00:30 +0100
    Re: [PATCH] genirq/affinity: fix node generation from cpumask Thomas Gleixner <tglx@linutronix.de> - 2016-12-15 10:40 +0100
      Re: [PATCH] genirq/affinity: fix node generation from cpumask "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com> - 2016-12-15 15:00 +0100
  Re: [PATCH] genirq/affinity: fix node generation from cpumask Gabriel Krisman Bertazi <gabriel@krisman.be> - 2016-12-15 02:50 +0100
  Re: [PATCH] genirq/affinity: fix node generation from cpumask Christoph Hellwig <hch@lst.de> - 2016-12-15 10:00 +0100
  [tip:irq/urgent] genirq/affinity: Fix node generation from cpumask "tip-bot for Guilherme G. Piccoli" <tipbot@zytor.com> - 2016-12-15 12:40 +0100
  Re: [PATCH] genirq/affinity: fix node generation from cpumask Balbir Singh <bsingharora@gmail.com> - 2016-12-15 13:40 +0100

csiph-web