diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-11-09 18:53:16 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-11-17 00:35:36 -0500 |
commit | d29afd2c9e990799b470bb95a97935cf5b5020db (patch) | |
tree | 48f14dffe90956e9b42b02a87b95fd7a1dfeef3e /drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h | |
parent | 5494e846c78dd0da74635905ead3abe45502375f (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/semaphore_gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h b/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h index d96037ce..c73d3c05 100644 --- a/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/semaphore_gk20a.h | |||
@@ -222,7 +222,7 @@ static inline bool gk20a_semaphore_is_released(struct gk20a_semaphore *s) | |||
222 | * the value of the semaphore then the semaphore has been signaled | 222 | * the value of the semaphore then the semaphore has been signaled |
223 | * (a.k.a. released). | 223 | * (a.k.a. released). |
224 | */ | 224 | */ |
225 | return sema_val >= atomic_read(&s->value); | 225 | return (int)sema_val >= atomic_read(&s->value); |
226 | } | 226 | } |
227 | 227 | ||
228 | static inline bool gk20a_semaphore_is_acquired(struct gk20a_semaphore *s) | 228 | static inline bool gk20a_semaphore_is_acquired(struct gk20a_semaphore *s) |
@@ -240,12 +240,12 @@ static inline u32 gk20a_semaphore_read(struct gk20a_semaphore *s) | |||
240 | 240 | ||
241 | static inline u32 gk20a_semaphore_get_value(struct gk20a_semaphore *s) | 241 | static inline u32 gk20a_semaphore_get_value(struct gk20a_semaphore *s) |
242 | { | 242 | { |
243 | return atomic_read(&s->value); | 243 | return (u32)atomic_read(&s->value); |
244 | } | 244 | } |
245 | 245 | ||
246 | static inline u32 gk20a_semaphore_next_value(struct gk20a_semaphore *s) | 246 | static inline u32 gk20a_semaphore_next_value(struct gk20a_semaphore *s) |
247 | { | 247 | { |
248 | return atomic_read(&s->hw_sema->next_value); | 248 | return (u32)atomic_read(&s->hw_sema->next_value); |
249 | } | 249 | } |
250 | 250 | ||
251 | /* | 251 | /* |