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-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; ... return; /* Good

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 */ >

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:

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

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 ?

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 ?

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 the

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:

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 */ exit1:

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 j...@perches.com 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 Tue, 2014-06-17 at 08:46 +0530, Sachin Kamat wrote: On Tue, Jun 17, 2014 at 7:30 AM, Joe Perches j...@perches.com 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

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 j...@perches.com wrote: On Tue, 2014-06-17 at 08:46 +0530, Sachin Kamat wrote: On Tue, Jun 17, 2014 at 7:30 AM, Joe Perches j...@perches.com wrote: On Mon, 2014-06-16 at 17:44 -0700, Anish Bhatt wrote: My code has multiple exit lables: void

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

2014-06-02 Thread Joe Perches
void function lines that use a single tab then "return;" are generally unnecessary. Signed-off-by: Joe Perches --- scripts/checkpatch.pl | 7 +++ 1 file changed, 7 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7774025..f9bb12c 100755 ---

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

2014-06-02 Thread Joe Perches
void function lines that use a single tab then return; are generally unnecessary. Signed-off-by: Joe Perches j...@perches.com --- scripts/checkpatch.pl | 7 +++ 1 file changed, 7 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 7774025..f9bb12c 100755 ---