diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-11-08 16:48:56 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-11-11 11:21:20 -0500 |
commit | 6410739922a9896fc2c142964b7e87987c8e04d2 (patch) | |
tree | cca9b9956be6812214858ac9f0ea32acad089083 /drivers/gpu/nvgpu/gk20a | |
parent | 6855065d857b5ab248b0dc2f75b707ed44e4d460 (diff) |
gpu: nvgpu: Skip comparing u32 event_id against < 0
Skip checking of u32 event_id if it's smaller than zero.
Change-Id: I207c244eeff10f294c41a76b53f9393d50a84026
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1249967
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 16363cf1..53ed606d 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -3160,8 +3160,7 @@ static int gk20a_channel_event_id_ctrl(struct channel_gk20a *ch, | |||
3160 | int err = 0; | 3160 | int err = 0; |
3161 | int fd = -1; | 3161 | int fd = -1; |
3162 | 3162 | ||
3163 | if (args->event_id < 0 || | 3163 | if (args->event_id >= NVGPU_IOCTL_CHANNEL_EVENT_ID_MAX) |
3164 | args->event_id >= NVGPU_IOCTL_CHANNEL_EVENT_ID_MAX) | ||
3165 | return -EINVAL; | 3164 | return -EINVAL; |
3166 | 3165 | ||
3167 | if (gk20a_is_channel_marked_as_tsg(ch)) | 3166 | if (gk20a_is_channel_marked_as_tsg(ch)) |
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c index 716388ec..133b737e 100644 --- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | |||
@@ -314,8 +314,7 @@ static int gk20a_tsg_event_id_ctrl(struct gk20a *g, struct tsg_gk20a *tsg, | |||
314 | int err = 0; | 314 | int err = 0; |
315 | int fd = -1; | 315 | int fd = -1; |
316 | 316 | ||
317 | if (args->event_id < 0 || | 317 | if (args->event_id >= NVGPU_IOCTL_CHANNEL_EVENT_ID_MAX) |
318 | args->event_id >= NVGPU_IOCTL_CHANNEL_EVENT_ID_MAX) | ||
319 | return -EINVAL; | 318 | return -EINVAL; |
320 | 319 | ||
321 | switch (args->cmd) { | 320 | switch (args->cmd) { |