From: Al Viro <viro@zeniv.linux.org.uk>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: kernel-janitors@vger.kernel.org, Lee Jones <lee.jones@linaro.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mfd: asic3: One function call less in asic3_irq_probe()
Date: Sun, 07 Jul 2019 00:52:53 +0000 [thread overview]
Message-ID: <20190707005251.GQ17978@ZenIV.linux.org.uk> (raw)
In-Reply-To: <01f6a8cd-0205-8d34-2aa3-e4b691e7eb95@web.de>
On Fri, Jul 05, 2019 at 08:30:08PM +0200, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 5 Jul 2019 20:22:26 +0200
>
> Avoid an extra function call by using a ternary operator instead of
> a conditional statement.
Which is a good thing, because...?
> This issue was detected by using the Coccinelle software.
Oh, I see - that answers all questions. "Software has detected an issue",
so of course an issue it is.
> - if (irq < asic->irq_base + ASIC3_NUM_GPIOS)
> - irq_set_chip(irq, &asic3_gpio_irq_chip);
> - else
> - irq_set_chip(irq, &asic3_irq_chip);
> -
> + irq_set_chip(irq,
> + (irq < asic->irq_base + ASIC3_NUM_GPIOS)
> + ? &asic3_gpio_irq_chip
> + : &asic3_irq_chip);
... except that the result is not objectively better by any real
criteria. It's not more readable, it conveys _less_ information
to reader (the fact that calls differ only by the last argument
had been visually obvious already, and logics used to be easier
to see), it (obviously) does not generate better (or different)
code. What the hell is the point?
May I politely inquire what makes you so determined to avoid any
not-entirely-mechanical activity?
WARNING: multiple messages have this Message-ID (diff)
From: Al Viro <viro@zeniv.linux.org.uk>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: kernel-janitors@vger.kernel.org, Lee Jones <lee.jones@linaro.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mfd: asic3: One function call less in asic3_irq_probe()
Date: Sun, 7 Jul 2019 01:52:53 +0100 [thread overview]
Message-ID: <20190707005251.GQ17978@ZenIV.linux.org.uk> (raw)
In-Reply-To: <01f6a8cd-0205-8d34-2aa3-e4b691e7eb95@web.de>
On Fri, Jul 05, 2019 at 08:30:08PM +0200, Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 5 Jul 2019 20:22:26 +0200
>
> Avoid an extra function call by using a ternary operator instead of
> a conditional statement.
Which is a good thing, because...?
> This issue was detected by using the Coccinelle software.
Oh, I see - that answers all questions. "Software has detected an issue",
so of course an issue it is.
> - if (irq < asic->irq_base + ASIC3_NUM_GPIOS)
> - irq_set_chip(irq, &asic3_gpio_irq_chip);
> - else
> - irq_set_chip(irq, &asic3_irq_chip);
> -
> + irq_set_chip(irq,
> + (irq < asic->irq_base + ASIC3_NUM_GPIOS)
> + ? &asic3_gpio_irq_chip
> + : &asic3_irq_chip);
... except that the result is not objectively better by any real
criteria. It's not more readable, it conveys _less_ information
to reader (the fact that calls differ only by the last argument
had been visually obvious already, and logics used to be easier
to see), it (obviously) does not generate better (or different)
code. What the hell is the point?
May I politely inquire what makes you so determined to avoid any
not-entirely-mechanical activity?
next prev parent reply other threads:[~2019-07-07 0:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-05 18:30 [PATCH] mfd: asic3: One function call less in asic3_irq_probe() Markus Elfring
2019-07-05 18:30 ` Markus Elfring
2019-07-05 18:30 ` Markus Elfring
2019-07-05 18:30 ` Markus Elfring
2019-07-07 0:52 ` Al Viro [this message]
2019-07-07 0:52 ` Al Viro
2019-07-07 7:56 ` Markus Elfring
2019-07-07 7:56 ` Markus Elfring
2019-07-08 10:18 ` Enrico Weigelt, metux IT consult
2019-07-08 10:18 ` Enrico Weigelt, metux IT consult
2019-07-08 11:50 ` Markus Elfring
2019-07-08 11:50 ` Markus Elfring
2019-07-08 14:38 ` Enrico Weigelt, metux IT consult
2019-07-08 14:38 ` Enrico Weigelt, metux IT consult
2019-07-08 6:36 ` [PATCH] " Lee Jones
2019-07-08 6:36 ` Lee Jones
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=20190707005251.GQ17978@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=Markus.Elfring@web.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
/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.