Skip to contentSkip to conversation

irqdomain: fix compare_const_fl.cocci warnings

PATCH In review Julia Lawall 4 participants 7 messages Apr 20, 2016 – Apr 22, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irqdomain: fix compare_const_fl.cocci warnings

Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

---

Not a big deal, but the transformed code looks better to me.

 irqdomain.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/irqdomain.c +1 -1
@@ -618,7 +618,7 @@ unsigned int irq_create_fwspec_mapping(s
 		 * If the trigger type has not been set yet, then set
 		 * it now and return the interrupt number.
 		 */
-		if (IRQ_TYPE_NONE == irq_get_trigger_type(virq)) {
+		if (irq_get_trigger_type(virq) == IRQ_TYPE_NONE) {
 			irq_set_irq_type(virq, type);
 			return virq;
 		}
#4 lore raw
In reply to Julia Lawall
Quoted 16 lines · Julia Lawall

Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

---

Not a big deal, but the transformed code looks better to me.

 irqdomain.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

kernel/irq/irqdomain.c unsigned int irq_create_fwspec_mapping(s · line 624

Quoted 8 lines
kernel/irq/irqdomain.c +1 -1
@@ -618,7 +618,7 @@ unsigned int irq_create_fwspec_mapping(s
 		 * If the trigger type has not been set yet, then set
 		 * it now and return the interrupt number.
 		 */
-		if (IRQ_TYPE_NONE == irq_get_trigger_type(virq)) {
+		if (irq_get_trigger_type(virq) == IRQ_TYPE_NONE) {
 			irq_set_irq_type(virq, type);
 			return virq;
 		}

What branch is this from? Looks very familiar and related to some changes I have been working on, but in my latest version I already have this as shown above [0].

Cheers
Jon

[0] http://marc.info/?l=linux-tegra&m=146115064322071&w=2

#5 lore raw
Quoted 15 lines · Jon Hunter
Quoted 13 lines · Julia Lawall

Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

---

Not a big deal, but the transformed code looks better to me.

 irqdomain.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

kernel/irq/irqdomain.c unsigned int irq_create_fwspec_mapping(s · line 624

Quoted 11 lines
kernel/irq/irqdomain.c +1 -1
@@ -618,7 +618,7 @@ unsigned int irq_create_fwspec_mapping(s
 		 * If the trigger type has not been set yet, then set
 		 * it now and return the interrupt number.
 		 */
-		if (IRQ_TYPE_NONE == irq_get_trigger_type(virq)) {
+		if (irq_get_trigger_type(virq) == IRQ_TYPE_NONE) {
 			irq_set_irq_type(virq, type);
 			return virq;
 		}

What branch is this from? Looks very familiar and related to some changes I have been working on, but in my latest version I already have this as shown above [0].

Sorry, I didn't save that information. If it's done, it's done. Sorry for the noise.

julia

Quoted 6 lines

Cheers
Jon

[0] http://marc.info/?l=linux-tegra&m=146115064322071&w=2

#6 lore raw
Quoted 33 lines · Julia Lawall
Quoted 15 lines · Jon Hunter
Quoted 13 lines · Julia Lawall

Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

---

Not a big deal, but the transformed code looks better to me.

 irqdomain.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

kernel/irq/irqdomain.c unsigned int irq_create_fwspec_mapping(s · line 624

Quoted 11 lines
kernel/irq/irqdomain.c +1 -1
@@ -618,7 +618,7 @@ unsigned int irq_create_fwspec_mapping(s
 		 * If the trigger type has not been set yet, then set
 		 * it now and return the interrupt number.
 		 */
-		if (IRQ_TYPE_NONE == irq_get_trigger_type(virq)) {
+		if (irq_get_trigger_type(virq) == IRQ_TYPE_NONE) {
 			irq_set_irq_type(virq, type);
 			return virq;
 		}

What branch is this from? Looks very familiar and related to some changes I have been working on, but in my latest version I already have this as shown above [0].

Quoted 2 lines

Sorry, I didn't save that information. If it's done, it's done. Sorry for the noise.

No problem. I am wondering if this was based off an earlier branch on my github tree (as I know that kbuild is trawling these) and I have never posted a patch publicly with the above.

Cheers
Jon