public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] staging: vme: remove unnecessary parentheses
@ 2023-02-24 10:50 Rohit Chavan
  2023-02-24 11:07 ` Greg Kroah-Hartman
  2023-02-24 11:09 ` Dan Carpenter
  0 siblings, 2 replies; 3+ messages in thread
From: Rohit Chavan @ 2023-02-24 10:50 UTC (permalink / raw)
  To: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, linux-kernel,
	linux-staging
  Cc: Rohit Chavan

This patch removes unnecessary parentheses in order to fix a checkpatch issue.

Signed-off-by: Rohit Chavan <roheetchavan@gmail.com>
---
 drivers/staging/vme_user/vme_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/vme_user/vme_user.c b/drivers/staging/vme_user/vme_user.c
index 4e533c0bfe6d..5027d91d7038 100644
--- a/drivers/staging/vme_user/vme_user.c
+++ b/drivers/staging/vme_user/vme_user.c
@@ -506,7 +506,7 @@ static int vme_user_match(struct vme_dev *vdev)
 	int cur_slot = vme_slot_num(vdev);
 
 	for (i = 0; i < bus_num; i++)
-		if ((cur_bus == bus[i]) && (cur_slot == vdev->num))
+		if (cur_bus == bus[i] && cur_slot == vdev->num)
 			return 1;
 
 	return 0;
-- 
2.30.2


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

* Re: [PATCH] staging: vme: remove unnecessary parentheses
  2023-02-24 10:50 [PATCH] staging: vme: remove unnecessary parentheses Rohit Chavan
@ 2023-02-24 11:07 ` Greg Kroah-Hartman
  2023-02-24 11:09 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2023-02-24 11:07 UTC (permalink / raw)
  To: Rohit Chavan; +Cc: Martyn Welch, Manohar Vanga, linux-kernel, linux-staging

On Fri, Feb 24, 2023 at 04:20:48PM +0530, Rohit Chavan wrote:
> This patch removes unnecessary parentheses in order to fix a checkpatch issue.
> 
> Signed-off-by: Rohit Chavan <roheetchavan@gmail.com>
> ---
>  drivers/staging/vme_user/vme_user.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vme_user/vme_user.c b/drivers/staging/vme_user/vme_user.c
> index 4e533c0bfe6d..5027d91d7038 100644
> --- a/drivers/staging/vme_user/vme_user.c
> +++ b/drivers/staging/vme_user/vme_user.c
> @@ -506,7 +506,7 @@ static int vme_user_match(struct vme_dev *vdev)
>  	int cur_slot = vme_slot_num(vdev);
>  
>  	for (i = 0; i < bus_num; i++)
> -		if ((cur_bus == bus[i]) && (cur_slot == vdev->num))
> +		if (cur_bus == bus[i] && cur_slot == vdev->num)

Then checkpatch is wrong, the original code is better as it is explicit
about what to do here.

Do you want to look up the order-of-operations every time to see if "&&"
is before or after "==" or the same?

sorry, but I will not take this, we write code for people first,
compilers second, and the original code is more obvious and explicit and
better in the long run.

thanks,

greg k-h

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

* Re: [PATCH] staging: vme: remove unnecessary parentheses
  2023-02-24 10:50 [PATCH] staging: vme: remove unnecessary parentheses Rohit Chavan
  2023-02-24 11:07 ` Greg Kroah-Hartman
@ 2023-02-24 11:09 ` Dan Carpenter
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2023-02-24 11:09 UTC (permalink / raw)
  To: Rohit Chavan
  Cc: Martyn Welch, Manohar Vanga, Greg Kroah-Hartman, linux-kernel,
	linux-staging

On Fri, Feb 24, 2023 at 04:20:48PM +0530, Rohit Chavan wrote:
> This patch removes unnecessary parentheses in order to fix a checkpatch issue.
> 

This line is too long.  Commit messages can only have 75 characters
per line.  Please run checkpatch.pl on your patches.

But also Greg doesn't like the "unnecessary parentheses" warning so just
ignore checkpatch for those warnings.

regards,
dan carpenter


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

end of thread, other threads:[~2023-02-24 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-24 10:50 [PATCH] staging: vme: remove unnecessary parentheses Rohit Chavan
2023-02-24 11:07 ` Greg Kroah-Hartman
2023-02-24 11:09 ` Dan Carpenter

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