* [PATCH] Staging: speakup: buffers: Fixed a return value coding style issue. @ 2014-02-27 16:26 Reza Snowdon 2014-02-27 16:40 ` Greg KH 2014-02-27 16:47 ` Dan Carpenter 0 siblings, 2 replies; 5+ messages in thread From: Reza Snowdon @ 2014-02-27 16:26 UTC (permalink / raw) To: gregkh; +Cc: speakup, devel, linux-kernel, Reza Snowdon Fixed a coding style issue. Signed-off-by: Reza Snowdon <rs@mage.me.uk> --- drivers/staging/speakup/buffers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/speakup/buffers.c b/drivers/staging/speakup/buffers.c index 382973e..8d7caa7 100644 --- a/drivers/staging/speakup/buffers.c +++ b/drivers/staging/speakup/buffers.c @@ -55,7 +55,8 @@ static int synth_buffer_free(void) int synth_buffer_empty(void) { - return (buff_in == buff_out); + int buff_comparison = (buff_in == buff_out); + return buff_comparison; } EXPORT_SYMBOL_GPL(synth_buffer_empty); -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Staging: speakup: buffers: Fixed a return value coding style issue. 2014-02-27 16:26 [PATCH] Staging: speakup: buffers: Fixed a return value coding style issue Reza Snowdon @ 2014-02-27 16:40 ` Greg KH 2014-02-27 18:12 ` rs 2014-02-27 16:47 ` Dan Carpenter 1 sibling, 1 reply; 5+ messages in thread From: Greg KH @ 2014-02-27 16:40 UTC (permalink / raw) To: Reza Snowdon; +Cc: devel, speakup, linux-kernel On Thu, Feb 27, 2014 at 04:26:42PM +0000, Reza Snowdon wrote: > Fixed a coding style issue. > > Signed-off-by: Reza Snowdon <rs@mage.me.uk> > --- > drivers/staging/speakup/buffers.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/speakup/buffers.c b/drivers/staging/speakup/buffers.c > index 382973e..8d7caa7 100644 > --- a/drivers/staging/speakup/buffers.c > +++ b/drivers/staging/speakup/buffers.c > @@ -55,7 +55,8 @@ static int synth_buffer_free(void) > > int synth_buffer_empty(void) > { > - return (buff_in == buff_out); > + int buff_comparison = (buff_in == buff_out); > + return buff_comparison; What's wrong with the original code here? If anything, just drop the (), but really, it's fine, leave it alone, it's obvious what is happening is ok. thanks, greg k-h ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Staging: speakup: buffers: Fixed a return value coding style issue. 2014-02-27 16:40 ` Greg KH @ 2014-02-27 18:12 ` rs 2014-02-27 19:10 ` Greg KH 0 siblings, 1 reply; 5+ messages in thread From: rs @ 2014-02-27 18:12 UTC (permalink / raw) To: Greg KH; +Cc: devel, speakup, linux-kernel [-- Attachment #1: Type: text/plain, Size: 1249 bytes --] When checking buffers.c with checkpatch.pl it throws the following error: drivers/staging/speakup/buffers.c:58: ERROR: return is not a function, parentheses are not required I watched one of your talks, it's very informative and concise: http://www.youtube.com/watch?v=LLBrBBImJt4&feature=youtu.be Thanks, Reza Snowdon On 27/02/14 16:40, Greg KH wrote: > On Thu, Feb 27, 2014 at 04:26:42PM +0000, Reza Snowdon wrote: >> Fixed a coding style issue. >> >> Signed-off-by: Reza Snowdon <rs@mage.me.uk> >> --- >> drivers/staging/speakup/buffers.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/staging/speakup/buffers.c b/drivers/staging/speakup/buffers.c >> index 382973e..8d7caa7 100644 >> --- a/drivers/staging/speakup/buffers.c >> +++ b/drivers/staging/speakup/buffers.c >> @@ -55,7 +55,8 @@ static int synth_buffer_free(void) >> >> int synth_buffer_empty(void) >> { >> - return (buff_in == buff_out); >> + int buff_comparison = (buff_in == buff_out); >> + return buff_comparison; > > What's wrong with the original code here? If anything, just drop the > (), but really, it's fine, leave it alone, it's obvious what is > happening is ok. > > thanks, > > greg k-h > -- Regards, Reza Snowdon [-- Attachment #2: 0001-Staging-speakup-buffers-Fixed-a-return-coding-style-.patch --] [-- Type: text/x-patch, Size: 980 bytes --] >From a2dda399463c20f63306e31b743e0c9c3be2ca3a Mon Sep 17 00:00:00 2001 From: Reza Snowdon <rs@mage.me.uk> Date: Thu, 27 Feb 2014 17:57:59 +0000 Subject: [PATCH] Staging: speakup: buffers: Fixed a return coding style issue When checking buffers.c with checkpatch.pl it throws the following error: drivers/staging/speakup/buffers.c:58: ERROR: return is not a function, parentheses are not required Fixed error by removing parenthesis. Signed-off-by: Reza Snowdon <rs@mage.me.uk> --- drivers/staging/speakup/buffers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/speakup/buffers.c b/drivers/staging/speakup/buffers.c index 382973e..5e6ec13 100644 --- a/drivers/staging/speakup/buffers.c +++ b/drivers/staging/speakup/buffers.c @@ -55,7 +55,7 @@ static int synth_buffer_free(void) int synth_buffer_empty(void) { - return (buff_in == buff_out); + return buff_in == buff_out; } EXPORT_SYMBOL_GPL(synth_buffer_empty); -- 1.7.10.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] Staging: speakup: buffers: Fixed a return value coding style issue. 2014-02-27 18:12 ` rs @ 2014-02-27 19:10 ` Greg KH 0 siblings, 0 replies; 5+ messages in thread From: Greg KH @ 2014-02-27 19:10 UTC (permalink / raw) To: rs@mage.me.uk; +Cc: devel, speakup, linux-kernel On Thu, Feb 27, 2014 at 06:12:48PM +0000, rs@mage.me.uk wrote: > When checking buffers.c with checkpatch.pl it throws the following error: > drivers/staging/speakup/buffers.c:58: ERROR: return is not a function, > parentheses are not required Remember, checkpatch.pl is a "guide", not the "law". Use common sense when using the tool please. thanks, greg k-h ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Staging: speakup: buffers: Fixed a return value coding style issue. 2014-02-27 16:26 [PATCH] Staging: speakup: buffers: Fixed a return value coding style issue Reza Snowdon 2014-02-27 16:40 ` Greg KH @ 2014-02-27 16:47 ` Dan Carpenter 1 sibling, 0 replies; 5+ messages in thread From: Dan Carpenter @ 2014-02-27 16:47 UTC (permalink / raw) To: Reza Snowdon; +Cc: gregkh, devel, speakup, linux-kernel On Thu, Feb 27, 2014 at 04:26:42PM +0000, Reza Snowdon wrote: > Fixed a coding style issue. > > Signed-off-by: Reza Snowdon <rs@mage.me.uk> > --- > drivers/staging/speakup/buffers.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/staging/speakup/buffers.c b/drivers/staging/speakup/buffers.c > index 382973e..8d7caa7 100644 > --- a/drivers/staging/speakup/buffers.c > +++ b/drivers/staging/speakup/buffers.c > @@ -55,7 +55,8 @@ static int synth_buffer_free(void) > > int synth_buffer_empty(void) > { > - return (buff_in == buff_out); > + int buff_comparison = (buff_in == buff_out); > + return buff_comparison; This isn't simpler than the original code. Just do: int synth_buffer_empty(void) { return buff_in == buff_out; } regards, dan carpenter ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-02-27 19:08 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-02-27 16:26 [PATCH] Staging: speakup: buffers: Fixed a return value coding style issue Reza Snowdon 2014-02-27 16:40 ` Greg KH 2014-02-27 18:12 ` rs 2014-02-27 19:10 ` Greg KH 2014-02-27 16:47 ` Dan Carpenter
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox