Thread (14 messages) 14 messages, 2 authors, 2016-09-05

Re: [PATCH v3 2/9] drivers: irqchip: Add STM32 external interrupts support

From: Alexandre Torgue <hidden>
Date: 2016-09-05 07:48:45
Also in: linux-arm-kernel, linux-gpio, lkml

Hi Thomas,

On 09/02/2016 08:57 PM, Thomas Gleixner wrote:
Alexandre,

On Fri, 2 Sep 2016, Alexandre TORGUE wrote:

This all looks very reasonable. The only complaint I have is your variable
declaration ordering or the lack thereof.

1)
quoted
+	struct irq_domain *domain = irq_desc_get_handler_data(desc);
+	struct irq_chip_generic *gc = domain->gc->gc[0];
+	struct irq_chip *chip = irq_desc_get_chip(desc);
+	unsigned long pending;
+	int n;
2)
quoted
+	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(data);
+	u32 rtsr, ftsr;
+	int pin = data->hwirq;
3)
quoted
+	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(data);
+	int pin = data->hwirq;
+	u32 emr;
4)
quoted
+	irq_hw_number_t hwirq;
+	struct irq_fwspec *fwspec = data;
+	struct irq_chip_generic *gc = d->gc->gc[0];
5)
quoted
+	int nr_irqs, nr_exti, ret, i;
+	unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
+	struct irq_domain *domain;
+	struct irq_chip_generic *gc;
+	void *base;
#1 and 3 have the ordering which is preferred in the irq code.

#2, #4 and #5 are three permutations which are way harder to read.
quoted
+	struct irq_chip_generic *gc = irq_data_get_irq_chip_data(data);
+	int pin = data->hwirq;
+	u32 rtsr, ftsr;
quoted
+	struct irq_chip_generic *gc = d->gc->gc[0];
+	struct irq_fwspec *fwspec = data;
+	irq_hw_number_t hwirq;
quoted
+	unsigned int clr = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN;
+	int nr_irqs, nr_exti, ret, i;
+	struct irq_chip_generic *gc;
+	struct irq_domain *domain;
+	void *base;
Can you spot the difference?
Thanks for review and for proposal. It Will be in next version.

Regards

Alex
Thanks,

	tglx


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help