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/channel_gk20a.c | |
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/channel_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 43a6df0e..8105de11 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -223,7 +223,7 @@ u32 channel_gk20a_pbdma_acquire_val(struct channel_gk20a *c) | |||
223 | { | 223 | { |
224 | u32 val, exp, man; | 224 | u32 val, exp, man; |
225 | u64 timeout; | 225 | u64 timeout; |
226 | int val_len; | 226 | unsigned int val_len; |
227 | 227 | ||
228 | val = pbdma_acquire_retry_man_2_f() | | 228 | val = pbdma_acquire_retry_man_2_f() | |
229 | pbdma_acquire_retry_exp_2_f(); | 229 | pbdma_acquire_retry_exp_2_f(); |
@@ -238,7 +238,7 @@ u32 channel_gk20a_pbdma_acquire_val(struct channel_gk20a *c) | |||
238 | val_len = fls(timeout >> 32) + 32; | 238 | val_len = fls(timeout >> 32) + 32; |
239 | if (val_len == 32) | 239 | if (val_len == 32) |
240 | val_len = fls(timeout); | 240 | val_len = fls(timeout); |
241 | if (val_len > 16 + pbdma_acquire_timeout_exp_max_v()) { /* man: 16bits */ | 241 | if (val_len > 16U + pbdma_acquire_timeout_exp_max_v()) { /* man: 16bits */ |
242 | exp = pbdma_acquire_timeout_exp_max_v(); | 242 | exp = pbdma_acquire_timeout_exp_max_v(); |
243 | man = pbdma_acquire_timeout_man_max_v(); | 243 | man = pbdma_acquire_timeout_man_max_v(); |
244 | } else if (val_len > 16) { | 244 | } else if (val_len > 16) { |
@@ -1618,7 +1618,8 @@ bool channel_gk20a_is_prealloc_enabled(struct channel_gk20a *c) | |||
1618 | static int channel_gk20a_prealloc_resources(struct channel_gk20a *c, | 1618 | static int channel_gk20a_prealloc_resources(struct channel_gk20a *c, |
1619 | unsigned int num_jobs) | 1619 | unsigned int num_jobs) |
1620 | { | 1620 | { |
1621 | int i, err; | 1621 | unsigned int i; |
1622 | int err; | ||
1622 | size_t size; | 1623 | size_t size; |
1623 | struct priv_cmd_entry *entries = NULL; | 1624 | struct priv_cmd_entry *entries = NULL; |
1624 | 1625 | ||
@@ -3044,7 +3045,7 @@ const struct file_operations gk20a_event_id_ops = { | |||
3044 | }; | 3045 | }; |
3045 | 3046 | ||
3046 | static int gk20a_channel_get_event_data_from_id(struct channel_gk20a *ch, | 3047 | static int gk20a_channel_get_event_data_from_id(struct channel_gk20a *ch, |
3047 | int event_id, | 3048 | u32 event_id, |
3048 | struct gk20a_event_id_data **event_id_data) | 3049 | struct gk20a_event_id_data **event_id_data) |
3049 | { | 3050 | { |
3050 | struct gk20a_event_id_data *local_event_id_data; | 3051 | struct gk20a_event_id_data *local_event_id_data; |
@@ -3069,7 +3070,7 @@ static int gk20a_channel_get_event_data_from_id(struct channel_gk20a *ch, | |||
3069 | } | 3070 | } |
3070 | 3071 | ||
3071 | void gk20a_channel_event_id_post_event(struct channel_gk20a *ch, | 3072 | void gk20a_channel_event_id_post_event(struct channel_gk20a *ch, |
3072 | int event_id) | 3073 | u32 event_id) |
3073 | { | 3074 | { |
3074 | struct gk20a_event_id_data *event_id_data; | 3075 | struct gk20a_event_id_data *event_id_data; |
3075 | int err = 0; | 3076 | int err = 0; |