summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAchal Verma <achalv@nvidia.com>2021-05-12 05:14:34 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2021-08-24 00:40:39 -0400
commit70896c585b95d84344d8c5ab9640b6abff015573 (patch)
tree673e989202c4e709b65ac094f9260cc4ffbdbbf2
parent73218645cb2c7a037e9e3f9ae4c0feccd67389b6 (diff)
nvhost: Fix comparison of unsigned against >= 0.
This fixes coverity issue: 3116774 Bug 200741055 Change-Id: I512d3cadc5c4312cf8885acd7b3c9d9b9a00d8b8 Signed-off-by: Achal Verma <achalv@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2528357 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Dmitry Pervushin <dpervushin@nvidia.com> Reviewed-by: Rahul Jain (SW-TEGRA) <rahuljain@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2575306 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Phoenix Jung <pjung@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/video/tegra/host/nvhost_syncpt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/tegra/host/nvhost_syncpt.c b/drivers/video/tegra/host/nvhost_syncpt.c
index 350496721..e7bc3efdf 100644
--- a/drivers/video/tegra/host/nvhost_syncpt.c
+++ b/drivers/video/tegra/host/nvhost_syncpt.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Tegra Graphics Host Syncpoints 4 * Tegra Graphics Host Syncpoints
5 * 5 *
6 * Copyright (c) 2010-2020, NVIDIA CORPORATION. All rights reserved. 6 * Copyright (c) 2010-2021, NVIDIA CORPORATION. All rights reserved.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify it 8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms and conditions of the GNU General Public License, 9 * under the terms and conditions of the GNU General Public License,
@@ -1349,7 +1349,7 @@ bool nvhost_syncpt_is_valid_hw_pt(struct nvhost_syncpt *sp, u32 id)
1349 1349
1350bool nvhost_syncpt_is_valid_hw_pt_nospec(struct nvhost_syncpt *sp, u32 *id) 1350bool nvhost_syncpt_is_valid_hw_pt_nospec(struct nvhost_syncpt *sp, u32 *id)
1351{ 1351{
1352 if (*id >= 0 && *id < nvhost_syncpt_nb_hw_pts(sp) && 1352 if (*id < nvhost_syncpt_nb_hw_pts(sp) &&
1353 *id != NVSYNCPT_INVALID) { 1353 *id != NVSYNCPT_INVALID) {
1354 *id = array_index_nospec(*id, nvhost_syncpt_nb_hw_pts(sp)); 1354 *id = array_index_nospec(*id, nvhost_syncpt_nb_hw_pts(sp));
1355 return true; 1355 return true;