linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: drivers: pcl818: Fixed a coding style error.
@ 2019-03-31 22:53 Will Cunningham
  2019-04-01  6:02 ` Greg KH
  2019-04-01  7:53 ` Mukesh Ojha
  0 siblings, 2 replies; 3+ messages in thread
From: Will Cunningham @ 2019-03-31 22:53 UTC (permalink / raw)
  To: abbotti; +Cc: hsweeten, gregkh, devel, linux-kernel

Removed unnecessary parentheses.`

Signed-off-by: Will Cunningham <wjcunningham7@gmail.com>
---
 drivers/staging/comedi/drivers/pcl818.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c
index 0af5315d4357..da5d53a288f7 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -1012,7 +1012,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		pcl818_alloc_dma(dev, it->options[2]);
 
 	/* use 1MHz or 10MHz oscilator */
-	if ((it->options[3] == 0) || (it->options[3] == 10))
+	if (it->options[3] == 0 || it->options[3] == 10)
 		osc_base = I8254_OSC_BASE_10MHZ;
 	else
 		osc_base = I8254_OSC_BASE_1MHZ;
@@ -1026,7 +1026,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	devpriv->ns_min = board->ns_min;
 	if (!board->is_818) {
 		/* extended PCL718 to 100kHz DAC */
-		if ((it->options[6] == 1) || (it->options[6] == 100))
+		if (it->options[6] == 1 || it->options[6] == 100)
 			devpriv->ns_min = 10000;
 	}
 
@@ -1067,12 +1067,12 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		s->maxdata	= 0x0fff;
 		s->range_table	= &range_unipolar5;
 		if (board->is_818) {
-			if ((it->options[4] == 1) || (it->options[4] == 10))
+			if (it->options[4] == 1 || it->options[4] == 10)
 				s->range_table = &range_unipolar10;
 			if (it->options[4] == 2)
 				s->range_table = &range_unknown;
 		} else {
-			if ((it->options[5] == 1) || (it->options[5] == 10))
+			if (it->options[5] == 1 || it->options[5] == 10)
 				s->range_table = &range_unipolar10;
 			if (it->options[5] == 2)
 				s->range_table = &range_unknown;
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Staging: comedi: drivers: pcl818: Fixed a coding style error.
  2019-03-31 22:53 [PATCH] Staging: comedi: drivers: pcl818: Fixed a coding style error Will Cunningham
@ 2019-04-01  6:02 ` Greg KH
  2019-04-01  7:53 ` Mukesh Ojha
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2019-04-01  6:02 UTC (permalink / raw)
  To: Will Cunningham; +Cc: abbotti, devel, linux-kernel

On Sun, Mar 31, 2019 at 06:53:36PM -0400, Will Cunningham wrote:
> Removed unnecessary parentheses.`

Odd trailing character :(

> 
> Signed-off-by: Will Cunningham <wjcunningham7@gmail.com>
> ---
>  drivers/staging/comedi/drivers/pcl818.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c
> index 0af5315d4357..da5d53a288f7 100644
> --- a/drivers/staging/comedi/drivers/pcl818.c
> +++ b/drivers/staging/comedi/drivers/pcl818.c
> @@ -1012,7 +1012,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>  		pcl818_alloc_dma(dev, it->options[2]);
>  
>  	/* use 1MHz or 10MHz oscilator */
> -	if ((it->options[3] == 0) || (it->options[3] == 10))
> +	if (it->options[3] == 0 || it->options[3] == 10)

No, please leave as-is.  () are there for humans to read, and having to
always remember the order of operations is not something you ever want
to do.

I _REALLY_ hate this option of checkpatch :(

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Staging: comedi: drivers: pcl818: Fixed a coding style error.
  2019-03-31 22:53 [PATCH] Staging: comedi: drivers: pcl818: Fixed a coding style error Will Cunningham
  2019-04-01  6:02 ` Greg KH
@ 2019-04-01  7:53 ` Mukesh Ojha
  1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2019-04-01  7:53 UTC (permalink / raw)
  To: Will Cunningham, abbotti; +Cc: hsweeten, gregkh, devel, linux-kernel


On 4/1/2019 4:23 AM, Will Cunningham wrote:
> Removed unnecessary parentheses.`
Remove the extra character at the end.

Fix the above thing then you can take.

Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>

Cheers,
-Mukesh

>
> Signed-off-by: Will Cunningham <wjcunningham7@gmail.com>
> ---
>   drivers/staging/comedi/drivers/pcl818.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c
> index 0af5315d4357..da5d53a288f7 100644
> --- a/drivers/staging/comedi/drivers/pcl818.c
> +++ b/drivers/staging/comedi/drivers/pcl818.c
> @@ -1012,7 +1012,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>   		pcl818_alloc_dma(dev, it->options[2]);
>   
>   	/* use 1MHz or 10MHz oscilator */
> -	if ((it->options[3] == 0) || (it->options[3] == 10))
> +	if (it->options[3] == 0 || it->options[3] == 10)
>   		osc_base = I8254_OSC_BASE_10MHZ;
>   	else
>   		osc_base = I8254_OSC_BASE_1MHZ;
> @@ -1026,7 +1026,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>   	devpriv->ns_min = board->ns_min;
>   	if (!board->is_818) {
>   		/* extended PCL718 to 100kHz DAC */
> -		if ((it->options[6] == 1) || (it->options[6] == 100))
> +		if (it->options[6] == 1 || it->options[6] == 100)
>   			devpriv->ns_min = 10000;
>   	}
>   
> @@ -1067,12 +1067,12 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
>   		s->maxdata	= 0x0fff;
>   		s->range_table	= &range_unipolar5;
>   		if (board->is_818) {
> -			if ((it->options[4] == 1) || (it->options[4] == 10))
> +			if (it->options[4] == 1 || it->options[4] == 10)
>   				s->range_table = &range_unipolar10;
>   			if (it->options[4] == 2)
>   				s->range_table = &range_unknown;
>   		} else {
> -			if ((it->options[5] == 1) || (it->options[5] == 10))
> +			if (it->options[5] == 1 || it->options[5] == 10)
>   				s->range_table = &range_unipolar10;
>   			if (it->options[5] == 2)
>   				s->range_table = &range_unknown;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-01  7:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-31 22:53 [PATCH] Staging: comedi: drivers: pcl818: Fixed a coding style error Will Cunningham
2019-04-01  6:02 ` Greg KH
2019-04-01  7:53 ` Mukesh Ojha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).