[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y/iaYtKk4VSokAFz@kroah.com>
Date: Fri, 24 Feb 2023 12:07:14 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Rohit Chavan <roheetchavan@...il.com>
Cc: Martyn Welch <martyn@...chs.me.uk>,
Manohar Vanga <manohar.vanga@...il.com>,
linux-kernel@...r.kernel.org, linux-staging@...ts.linux.dev
Subject: Re: [PATCH] staging: vme: remove unnecessary parentheses
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@...il.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
Powered by blists - more mailing lists