From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Hans de Goede <hdegoede@redhat.com>,
Henry Shi <henryshi2018@gmail.com>,
platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] platform/x86: silicom-platform: clean up a check
Date: Thu, 11 Jan 2024 13:56:28 +0200 (EET) [thread overview]
Message-ID: <90c2576b-006d-36eb-1fac-c4c4a6eccb4a@linux.intel.com> (raw)
In-Reply-To: <0402e613-446a-40d1-b676-0422f6223aa8@moroto.mountain>
On Wed, 10 Jan 2024, Dan Carpenter wrote:
> "value" is either non-zero, or zero. There isn't a third option.
> Delete the unnecessary code.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/platform/x86/silicom-platform.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/silicom-platform.c b/drivers/platform/x86/silicom-platform.c
> index 6ce43ccb3112..5cac698bf98d 100644
> --- a/drivers/platform/x86/silicom-platform.c
> +++ b/drivers/platform/x86/silicom-platform.c
> @@ -258,10 +258,8 @@ static void silicom_gpio_set(struct gpio_chip *gc,
>
> if (value)
> silicom_mec_port_set(channel, 0);
> - else if (value == 0)
> - silicom_mec_port_set(channel, 1);
> else
> - pr_err("Wrong argument value: %d\n", value);
> + silicom_mec_port_set(channel, 1);
This covers both cases without if:
silicom_mec_port_set(channel, !value);
--
i.
next prev parent reply other threads:[~2024-01-11 11:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-10 18:53 [PATCH] platform/x86: silicom-platform: clean up a check Dan Carpenter
2024-01-11 11:56 ` Ilpo Järvinen [this message]
2024-01-11 12:34 ` Dan Carpenter
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=90c2576b-006d-36eb-1fac-c4c4a6eccb4a@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=dan.carpenter@linaro.org \
--cc=hdegoede@redhat.com \
--cc=henryshi2018@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox