mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Harsha Sharma <harshasharmaiitr@gmail.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8723bs: Remove unused variable ret
Date: Thu, 14 Sep 2017 18:09:43 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1709141807561.3185@hadrien> (raw)
In-Reply-To: <1505404910-11548-1-git-send-email-harshasharmaiitr@gmail.com>



On Thu, 14 Sep 2017, Harsha Sharma wrote:

> Remove unused variable ret as it is not used anywhere.
> Remove multiple blank lines.
> Done using following coccinelle semantic patch
>
> @@
> type T;
> identifier i;
> constant C;
> @@
>
> (
> extern T i;
> |
> - T i;
>   <+... when != i
> - i = C;
>   ...+>
> )
>
> Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
> ---
>  drivers/staging/rtl8723bs/os_dep/ioctl_linux.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
> index ffbb35a..7935dc5 100644
> --- a/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
> +++ b/drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
> @@ -2337,10 +2337,6 @@ static int rtw_wx_read32(struct net_device *dev,
>  	u32 data32;
>  	u32 bytes;
>  	u8 *ptmp;
> -	int ret;
> -
> -
> -	ret = 0;
>  	padapter = (struct adapter *)rtw_netdev_priv(dev);
>  	p = &wrqu->data;
>  	len = p->length;
> @@ -2352,7 +2348,6 @@ static int rtw_wx_read32(struct net_device *dev,
>  		return -ENOMEM;
>
>  	if (copy_from_user(ptmp, p->pointer, len)) {
> -		ret = -EFAULT;
>  		goto exit;
>  	}
>
> @@ -2375,7 +2370,6 @@ static int rtw_wx_read32(struct net_device *dev,
>  			break;
>  		default:
>  			DBG_871X(KERN_INFO "%s: usage> read [bytes],[address(hex)]\n", __func__);
> -			ret = -EINVAL;
>  			goto exit;

One could have the impression that the function should instead return ret.
One would have to figure out where the function is called from and what
happens there to the return value.

julia

>  	}
>  	DBG_871X(KERN_INFO "%s: addr = 0x%08X data =%s\n", __func__, addr, extra);
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1505404910-11548-1-git-send-email-harshasharmaiitr%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>

  reply	other threads:[~2017-09-14 16:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14 16:01 Harsha Sharma
2017-09-14 16:09 ` Julia Lawall [this message]
     [not found]   ` <CANMOCy2qhAaEdwLGM3L7sJmFNkNTqeRnwoy4am5yFt6ie5QhOQ@mail.gmail.com>
2017-09-18  9:55     ` [Outreachy kernel] " Greg KH

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=alpine.DEB.2.20.1709141807561.3185@hadrien \
    --to=julia.lawall@lip6.fr \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=harshasharmaiitr@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=outreachy-kernel@googlegroups.com \
    /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®