staging: vme: remove unnecessary parentheses
PATCH 1/1 staging: vme: remove unnecessary parentheses
This patch removes unnecessary parentheses in order to fix a checkpatch issue.
--- drivers/staging/vme_user/vme_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/vme_user/vme_user.c +1 -1
@@ -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 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerQuoted 12 lines · Rohit Chavan
This patch removes unnecessary parentheses in order to fix a checkpatch issue.
Signed-off-by Rohit Chavan <[email protected]>--- drivers/staging/vme_user/vme_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/vme_user/vme_user.c +0
-0
drivers/staging/vme_user/vme_user.c static int vme_user_match(struct vme_dev *vdev) · line 509
Quoted 5 lines
drivers/staging/vme_user/vme_user.c +1
-1@@ -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
Quoted 2 lines · Rohit Chavan
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