public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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 v2] platform/x86: silicom-platform: clean up a check
Date: Fri, 12 Jan 2024 10:29:43 +0200 (EET)	[thread overview]
Message-ID: <f066439f-57d1-7ccf-3d3c-546aa90a17bb@linux.intel.com> (raw)
In-Reply-To: <a58bffb7-0a8b-4195-b273-f65a188ace7b@moroto.mountain>

[-- Attachment #1: Type: text/plain, Size: 1192 bytes --]

On Fri, 12 Jan 2024, Dan Carpenter wrote:

> The error message in this code can't be reached because value is either
> zero or non-zero.  There isn't a third option.  Really, it's nicer to
> write this as a one liner.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
>  drivers/platform/x86/silicom-platform.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/platform/x86/silicom-platform.c b/drivers/platform/x86/silicom-platform.c
> index 6ce43ccb3112..c0910af16a3a 100644
> --- a/drivers/platform/x86/silicom-platform.c
> +++ b/drivers/platform/x86/silicom-platform.c
> @@ -256,12 +256,7 @@ static void silicom_gpio_set(struct gpio_chip *gc,
>  	if (direction == GPIO_LINE_DIRECTION_IN)
>  		return;
>  
> -	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, !value);
>  }
>  
>  static int silicom_gpio_direction_output(struct gpio_chip *gc,
> 

Thanks for the update,

Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

-- 
 i.

  reply	other threads:[~2024-01-12  8:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12  6:56 [PATCH v2] platform/x86: silicom-platform: clean up a check Dan Carpenter
2024-01-12  8:29 ` Ilpo Järvinen [this message]
2024-01-24 11:02 ` Ilpo Järvinen

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=f066439f-57d1-7ccf-3d3c-546aa90a17bb@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