public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: vme_user: Remove redundant parentheses
@ 2024-07-09 19:15 Tyler Taormina
  2024-07-10  6:01 ` Nam Cao
  2024-07-10  7:24 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Tyler Taormina @ 2024-07-09 19:15 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-staging

Adhere to Linux kernel coding style.

Reported by checkpatch:

CHECK: Unnecessary parentheses around (...)

Signed-off-by: Tyler Taormina <taormina.dev@gmail.com>
---
 drivers/staging/vme_user/vme.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c
index 0cd370ab1008..5c1d1c9b7b70 100644
--- a/drivers/staging/vme_user/vme.c
+++ b/drivers/staging/vme_user/vme.c
@@ -274,7 +274,7 @@ struct vme_resource *vme_slave_request(struct vme_dev *vdev, u32 address,
 		mutex_lock(&slave_image->mtx);
 		if (((slave_image->address_attr & address) == address) &&
 		    ((slave_image->cycle_attr & cycle) == cycle) &&
-		    (slave_image->locked == 0)) {
+		    slave_image->locked == 0) {
 			slave_image->locked = 1;
 			mutex_unlock(&slave_image->mtx);
 			allocated_image = slave_image;
@@ -473,7 +473,7 @@ struct vme_resource *vme_master_request(struct vme_dev *vdev, u32 address,
 		if (((master_image->address_attr & address) == address) &&
 		    ((master_image->cycle_attr & cycle) == cycle) &&
 		    ((master_image->width_attr & dwidth) == dwidth) &&
-		    (master_image->locked == 0)) {
+		    master_image->locked == 0) {
 			master_image->locked = 1;
 			spin_unlock(&master_image->lock);
 			allocated_image = master_image;
@@ -849,7 +849,7 @@ struct vme_resource *vme_dma_request(struct vme_dev *vdev, u32 route)
 		/* Find an unlocked and compatible controller */
 		mutex_lock(&dma_ctrlr->mtx);
 		if (((dma_ctrlr->route_attr & route) == route) &&
-		    (dma_ctrlr->locked == 0)) {
+		    dma_ctrlr->locked == 0) {
 			dma_ctrlr->locked = 1;
 			mutex_unlock(&dma_ctrlr->mtx);
 			allocated_ctrlr = dma_ctrlr;
@@ -1218,9 +1218,9 @@ void vme_bus_error_handler(struct vme_bridge *bridge,
 	u32 aspace = vme_get_aspace(am);
 
 	list_for_each_entry(handler, &bridge->vme_error_handlers, list) {
-		if ((aspace == handler->aspace) &&
-		    (address >= handler->start) &&
-		    (address < handler->end)) {
+		if (aspace == handler->aspace &&
+		    address >= handler->start &&
+		    address < handler->end) {
 			if (!handler->num_errors)
 				handler->first_error = address;
 			if (handler->num_errors != UINT_MAX)
@@ -1307,7 +1307,7 @@ int vme_irq_request(struct vme_dev *vdev, int level, int statid,
 		return -EINVAL;
 	}
 
-	if ((level < 1) || (level > 7)) {
+	if (level < 1 || level > 7) {
 		dev_err(bridge->parent, "Invalid interrupt level\n");
 		return -EINVAL;
 	}
@@ -1357,7 +1357,7 @@ void vme_irq_free(struct vme_dev *vdev, int level, int statid)
 		return;
 	}
 
-	if ((level < 1) || (level > 7)) {
+	if (level < 1 || level > 7) {
 		dev_err(bridge->parent, "Invalid interrupt level\n");
 		return;
 	}
@@ -1405,7 +1405,7 @@ int vme_irq_generate(struct vme_dev *vdev, int level, int statid)
 		return -EINVAL;
 	}
 
-	if ((level < 1) || (level > 7)) {
+	if (level < 1 || level > 7) {
 		dev_warn(bridge->parent, "Invalid interrupt level\n");
 		return -EINVAL;
 	}
-- 
2.39.2


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

* Re: [PATCH] staging: vme_user: Remove redundant parentheses
  2024-07-09 19:15 [PATCH] staging: vme_user: Remove redundant parentheses Tyler Taormina
@ 2024-07-10  6:01 ` Nam Cao
  2024-07-10  7:24 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Nam Cao @ 2024-07-10  6:01 UTC (permalink / raw)
  To: Tyler Taormina; +Cc: gregkh, linux-kernel, linux-staging

On Tue, Jul 09, 2024 at 12:15:26PM -0700, Tyler Taormina wrote:
> Adhere to Linux kernel coding style.
> 
> Reported by checkpatch:
> 
> CHECK: Unnecessary parentheses around (...)
> 
> Signed-off-by: Tyler Taormina <taormina.dev@gmail.com>

Staging tree's maintainer (Greg) disagrees with checkpatch.pl on this one
and prefers to keep these parentheses. So I would leave them be.

You can look up the staging mailing list for details.

Best regards,
Nam

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

* Re: [PATCH] staging: vme_user: Remove redundant parentheses
  2024-07-09 19:15 [PATCH] staging: vme_user: Remove redundant parentheses Tyler Taormina
  2024-07-10  6:01 ` Nam Cao
@ 2024-07-10  7:24 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2024-07-10  7:24 UTC (permalink / raw)
  To: Tyler Taormina; +Cc: linux-kernel, linux-staging

On Tue, Jul 09, 2024 at 12:15:26PM -0700, Tyler Taormina wrote:
> Adhere to Linux kernel coding style.
> 
> Reported by checkpatch:
> 
> CHECK: Unnecessary parentheses around (...)
> 
> Signed-off-by: Tyler Taormina <taormina.dev@gmail.com>
> ---
>  drivers/staging/vme_user/vme.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/staging/vme_user/vme.c b/drivers/staging/vme_user/vme.c
> index 0cd370ab1008..5c1d1c9b7b70 100644
> --- a/drivers/staging/vme_user/vme.c
> +++ b/drivers/staging/vme_user/vme.c
> @@ -274,7 +274,7 @@ struct vme_resource *vme_slave_request(struct vme_dev *vdev, u32 address,
>  		mutex_lock(&slave_image->mtx);
>  		if (((slave_image->address_attr & address) == address) &&
>  		    ((slave_image->cycle_attr & cycle) == cycle) &&
> -		    (slave_image->locked == 0)) {
> +		    slave_image->locked == 0) {
>  			slave_image->locked = 1;
>  			mutex_unlock(&slave_image->mtx);
>  			allocated_image = slave_image;
> @@ -473,7 +473,7 @@ struct vme_resource *vme_master_request(struct vme_dev *vdev, u32 address,
>  		if (((master_image->address_attr & address) == address) &&
>  		    ((master_image->cycle_attr & cycle) == cycle) &&
>  		    ((master_image->width_attr & dwidth) == dwidth) &&
> -		    (master_image->locked == 0)) {
> +		    master_image->locked == 0) {
>  			master_image->locked = 1;
>  			spin_unlock(&master_image->lock);
>  			allocated_image = master_image;
> @@ -849,7 +849,7 @@ struct vme_resource *vme_dma_request(struct vme_dev *vdev, u32 route)
>  		/* Find an unlocked and compatible controller */
>  		mutex_lock(&dma_ctrlr->mtx);
>  		if (((dma_ctrlr->route_attr & route) == route) &&
> -		    (dma_ctrlr->locked == 0)) {
> +		    dma_ctrlr->locked == 0) {
>  			dma_ctrlr->locked = 1;
>  			mutex_unlock(&dma_ctrlr->mtx);
>  			allocated_ctrlr = dma_ctrlr;
> @@ -1218,9 +1218,9 @@ void vme_bus_error_handler(struct vme_bridge *bridge,
>  	u32 aspace = vme_get_aspace(am);
>  
>  	list_for_each_entry(handler, &bridge->vme_error_handlers, list) {
> -		if ((aspace == handler->aspace) &&
> -		    (address >= handler->start) &&
> -		    (address < handler->end)) {
> +		if (aspace == handler->aspace &&
> +		    address >= handler->start &&
> +		    address < handler->end) {
>  			if (!handler->num_errors)
>  				handler->first_error = address;
>  			if (handler->num_errors != UINT_MAX)
> @@ -1307,7 +1307,7 @@ int vme_irq_request(struct vme_dev *vdev, int level, int statid,
>  		return -EINVAL;
>  	}
>  
> -	if ((level < 1) || (level > 7)) {
> +	if (level < 1 || level > 7) {
>  		dev_err(bridge->parent, "Invalid interrupt level\n");
>  		return -EINVAL;
>  	}
> @@ -1357,7 +1357,7 @@ void vme_irq_free(struct vme_dev *vdev, int level, int statid)
>  		return;
>  	}
>  
> -	if ((level < 1) || (level > 7)) {
> +	if (level < 1 || level > 7) {
>  		dev_err(bridge->parent, "Invalid interrupt level\n");
>  		return;
>  	}
> @@ -1405,7 +1405,7 @@ int vme_irq_generate(struct vme_dev *vdev, int level, int statid)
>  		return -EINVAL;
>  	}
>  
> -	if ((level < 1) || (level > 7)) {
> +	if (level < 1 || level > 7) {
>  		dev_warn(bridge->parent, "Invalid interrupt level\n");
>  		return -EINVAL;
>  	}
> -- 
> 2.39.2
> 
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You sent a patch that has been sent multiple times in the past, and is
  identical to ones that has been rejected.  Please always look at the
  mailing list traffic to determine if you are duplicating other
  people's work.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

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

end of thread, other threads:[~2024-07-10  7:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-09 19:15 [PATCH] staging: vme_user: Remove redundant parentheses Tyler Taormina
2024-07-10  6:01 ` Nam Cao
2024-07-10  7:24 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox