Re: [PATCH] checkpatch: Warn on unnecessary void function return statements

2014-06-17 Thread Anish Bhatt
On 06/16/2014 07:00 PM, Joe Perches wrote: > On Mon, 2014-06-16 at 17:44 -0700, Anish Bhatt wrote: >> My code has multiple exit lables: >> void function(void) >> { >> ... >> >> if (err1) >> goto exit1; >> ... >> if (err2) >> goto exit2; >> >> ... >

Re: [PATCH] checkpatch: Warn on unnecessary void function return statements

2014-06-16 Thread Sachin Kamat
On Tue, Jun 17, 2014 at 8:55 AM, Joe Perches wrote: > On Tue, 2014-06-17 at 08:46 +0530, Sachin Kamat wrote: >> On Tue, Jun 17, 2014 at 7:30 AM, Joe Perches wrote: >> > On Mon, 2014-06-16 at 17:44 -0700, Anish Bhatt wrote: >> >> My code has multiple exit lables: >> >> void function(void) >> >> {

Re: [PATCH] checkpatch: Warn on unnecessary void function return statements

2014-06-16 Thread Joe Perches
On Tue, 2014-06-17 at 08:46 +0530, Sachin Kamat wrote: > On Tue, Jun 17, 2014 at 7:30 AM, Joe Perches wrote: > > On Mon, 2014-06-16 at 17:44 -0700, Anish Bhatt wrote: > >> My code has multiple exit lables: > >> void function(void) > >> { > >> ... > >> > >> if (err1) > >>

Re: [PATCH] checkpatch: Warn on unnecessary void function return statements

2014-06-16 Thread Sachin Kamat
On Tue, Jun 17, 2014 at 7:30 AM, Joe Perches wrote: > On Mon, 2014-06-16 at 17:44 -0700, Anish Bhatt wrote: >> My code has multiple exit lables: >> void function(void) >> { >> ... >> >> if (err1) >> goto exit1; >> ... >> if (err2) >> goto exit2;

Re: [PATCH] checkpatch: Warn on unnecessary void function return statements

2014-06-16 Thread Joe Perches
On Mon, 2014-06-16 at 17:44 -0700, Anish Bhatt wrote: > My code has multiple exit lables: > void function(void) > { > ... > > if (err1) > goto exit1; > ... > if (err2) > goto exit2; > > ... > return; /* Good return, no errors */ > ex

Re: [PATCH] checkpatch: Warn on unnecessary void function return statements

2014-06-16 Thread Anish Bhatt
My code has multiple exit lables: void function(void) { ... if (err1) goto exit1; ... if (err2) goto exit2; ... return; /* Good return, no errors */ exit1: printk(err1); return; exit2: printk(e

Re: [PATCH] checkpatch: Warn on unnecessary void function return statements

2014-06-16 Thread Joe Perches
On Mon, 2014-06-16 at 16:28 -0700, Anish Bhatt wrote: > This seems to ignore the ability to exit from void > return functions via a `return;` in case of an error > or similar. Any attempt to bail out generates warnings > with checkpathch.pl Perhaps it should check for returns > only at the end of t

Re: [PATCH] checkpatch: Warn on unnecessary void function return statements

2014-06-16 Thread Anish Bhatt
This seems to ignore the ability to exit from void return functions via a `return;` in case of an error or similar. Any attempt to bail out generates warnings with checkpathch.pl Perhaps it should check for returns only at the end of the function ? If not, is there a suggested way to do this ? g