mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: cgel.zte@gmail.com
Cc: ran.jianping@zte.com.cn, lee.jones@linaro.org,
	linux-kernel@vger.kernel.org, Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] pcmcia: remvoe unneeded variable
Date: Tue, 16 Nov 2021 09:32:13 +0100	[thread overview]
Message-ID: <YZNsjf0fMjEblbtj@owl.dominikbrodowski.net> (raw)
In-Reply-To: <20211116023310.154283-1-ran.jianping@zte.com.cn>

Am Tue, Nov 16, 2021 at 02:33:10AM +0000 schrieb cgel.zte@gmail.com:
> From: ran jianping <ran.jianping@zte.com.cn>
> 
> Fix the following coccicheck review:
> drivers/pcmcia/pcmcia_resource.c:396:5-8: Unneeded variable
> 
> Remove unneeded variable used to store return value.
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: ran jianping <ran.jianping@zte.com.cn>
> ---
>  drivers/pcmcia/pcmcia_resource.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
> index c1c197292111..d7e0f659d0a7 100644
> --- a/drivers/pcmcia/pcmcia_resource.c
> +++ b/drivers/pcmcia/pcmcia_resource.c
> @@ -393,7 +393,6 @@ int pcmcia_release_configuration(struct pcmcia_device *p_dev)
>  static int pcmcia_release_io(struct pcmcia_device *p_dev)
>  {
>  	struct pcmcia_socket *s = p_dev->socket;
> -	int ret = -EINVAL;
>  	config_t *c;
>  
>  	mutex_lock(&s->ops_mutex);
> @@ -413,7 +412,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev)
>  out:
>  	mutex_unlock(&s->ops_mutex);
>  
> -	return ret;
> +	return -EINVAL;
>  } /* pcmcia_release_io */

Thanks for your patch. It truly points out that the return value is unused,
and in fact, the sole caller does not check it. Therefore, it seems better
to remove the return value altogether, and convert it to type void.

Thanks,
	Dominik

      reply	other threads:[~2021-11-16  8:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16  2:33 cgel.zte
2021-11-16  8:32 ` Dominik Brodowski [this message]

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=YZNsjf0fMjEblbtj@owl.dominikbrodowski.net \
    --to=linux@dominikbrodowski.net \
    --cc=cgel.zte@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ran.jianping@zte.com.cn \
    --cc=zealci@zte.com.cn \
    /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

all inboxes | Powered by JetHome®