From 6410739922a9896fc2c142964b7e87987c8e04d2 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 8 Nov 2016 13:48:56 -0800 Subject: 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 Reviewed-on: http://git-master/r/1249967 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 3 +-- drivers/gpu/nvgpu/gk20a/tsg_gk20a.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers') 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, int err = 0; int fd = -1; - if (args->event_id < 0 || - args->event_id >= NVGPU_IOCTL_CHANNEL_EVENT_ID_MAX) + if (args->event_id >= NVGPU_IOCTL_CHANNEL_EVENT_ID_MAX) return -EINVAL; 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, int err = 0; int fd = -1; - if (args->event_id < 0 || - args->event_id >= NVGPU_IOCTL_CHANNEL_EVENT_ID_MAX) + if (args->event_id >= NVGPU_IOCTL_CHANNEL_EVENT_ID_MAX) return -EINVAL; switch (args->cmd) { -- cgit v1.2.2