Skip to contentSkip to conversation

irq: chip: Optimize the irq_set_irq_type function code

PATCH In review Li zeming 2 participants 2 messages Jun 4, 2024 IRQ

lore
Share & tools
lore

Li zeming

author
#0 lore raw

PATCH 1/1 irq: chip: Optimize the irq_set_irq_type function code

Optimize the position of ret and remove initialization assignments, making the function look more aesthetically pleasing internally.

---
 kernel/irq/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/chip.c +1 -1
index dc94e0bf2c94..1ce3d29abc90 100644
@@ -64,9 +64,9 @@ EXPORT_SYMBOL(irq_set_chip);
  */
 int irq_set_irq_type(unsigned int irq, unsigned int type)
 {
+	int ret;
 	unsigned long flags;
 	struct irq_desc *desc = irq_get_desc_buslock(irq, &flags, IRQ_GET_DESC_CHECK_GLOBAL);
-	int ret = 0;
 
 	if (!desc)
 		return -EINVAL;
Signature · 1 line
2.18.2
#1 lore raw
Quoted 2 lines · Li zeming

Optimize the position of ret and remove initialization assignments, making the function look more aesthetically pleasing internally.

And thereby violating the coding style guide of the tip tree:
Documentation/processs/maintainers-tip.rst

Which also contains a guide how to select the subject prefix.

Thanks,

tglx