summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-11-09 18:53:16 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-17 00:35:36 -0500
commitd29afd2c9e990799b470bb95a97935cf5b5020db (patch)
tree48f14dffe90956e9b42b02a87b95fd7a1dfeef3e /drivers/gpu/nvgpu/gk20a/fence_gk20a.c
parent5494e846c78dd0da74635905ead3abe45502375f (diff)
gpu: nvgpu: Fix signed comparison bugs
Fix small problems related to signed versus unsigned comparisons throughout the driver. Bump up the warning level to prevent such problems from occuring in future. Change-Id: I8ff5efb419f664e8a2aedadd6515ae4d18502ae0 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1252068 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fence_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/fence_gk20a.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
index e046152d..323caa8f 100644
--- a/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/fence_gk20a.c
@@ -114,14 +114,14 @@ int gk20a_fence_install_fd(struct gk20a_fence *f)
114#endif 114#endif
115} 115}
116 116
117int gk20a_alloc_fence_pool(struct channel_gk20a *c, int count) 117int gk20a_alloc_fence_pool(struct channel_gk20a *c, unsigned int count)
118{ 118{
119 int err; 119 int err;
120 size_t size; 120 size_t size;
121 struct gk20a_fence *fence_pool = NULL; 121 struct gk20a_fence *fence_pool = NULL;
122 122
123 size = sizeof(struct gk20a_fence); 123 size = sizeof(struct gk20a_fence);
124 if (count <= ULONG_MAX / size) { 124 if (count <= UINT_MAX / size) {
125 size = count * size; 125 size = count * size;
126 fence_pool = vzalloc(size); 126 fence_pool = vzalloc(size);
127 } 127 }