All of lore.kernel.org
 help / color / mirror / Atom feed
From: Supriya Karanth <iskaranth@gmail.com>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: outreachy-kernel@googlegroups.com
Subject: Re: [Outreachy kernel] [PATCH] staging: rtl8192u: remove return from end of void function
Date: Thu, 19 Mar 2015 12:55:13 +0900	[thread overview]
Message-ID: <20150319035511.GA6806@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1503150805370.2070@localhost6.localdomain6>

On Sun, Mar 15, 2015 at 08:07:56AM +0100, Julia Lawall wrote:
> 
> 
> On Sun, 15 Mar 2015, Supriya Karanth wrote:
> 
> > This patch removes the return statement at the end of a void
> > function as it is not necessary.
> > 
> > found by checkpatch.pl: WARNING: void function return statements
> > are not generally useful
> > 
> > changes made using coccinelle script:
> > 
> > @@
> > @@
> > 
> > ... when != if (...) return;
> >     when != if (...) { ... return;}
> > -return;
> 
> You can try
> 
> @@
> expression e;
> @@
> 
> ... when != true e
> - return;
> 
> You will still get false positives in loops and switces, but this should 
> let you get more results.  The != true means that you don't go through th 
> then branch of an if, ie no expression is ever considred to be true.
> 
> julia
> 
> 
OK, I didn't realize it was that simple.

It is not working on this file though and I am not able to understand why?
drivers/staging/lustre/lustre/libcfs/workitem.c

There are 2 void functions with return cfs_wi_exit & cfs_wi_schedule and
the script doesn't change it.

> >  
> >  static u8 rtl8192_getSupportedWireleeMode(struct net_device *dev)
> > @@ -2507,7 +2503,6 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
> >  	//we need init DIG RATR table here again.
> >  
> >  	RT_TRACE(COMP_EPROM, "<===========%s()\n", __func__);
> > -	return;
> >  }
> >  
> >  static short rtl8192_get_channel_map(struct net_device *dev)
> > -- 
> > 2.1.0
> > 
> > -- 
> > 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/1426390972-31372-1-git-send-email-iskaranth%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> > 


      reply	other threads:[~2015-03-19  3:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-15  3:42 [PATCH] staging: rtl8192u: remove return from end of void function Supriya Karanth
2015-03-15  7:07 ` [Outreachy kernel] " Julia Lawall
2015-03-19  3:55   ` Supriya Karanth [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=20150319035511.GA6806@gmail.com \
    --to=iskaranth@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --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 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.