From bace52ac7a5ee8683bedba23721900724e3de30a Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Wed, 3 Oct 2018 14:46:57 -0400 Subject: gpu: nvgpu: make tsgid a consistent type Different units were declaring tsgid as int or u32. This makes everyone use u32. This change resolves MISRA 10.3 violations for implicit assingment to different types. JIRA NVGPU-647 Change-Id: I78660e737acb0dad76dd538e5dd37f4527cf5acd Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/1918469 Signed-off-by: Debarshi Dutta (cherry picked from commit f5cac144a04a3ef83762ecb2e3f405196beffd68 in dev-kernel) Reviewed-on: https://git-master.nvidia.com/r/2008513 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/channel.h | 2 +- drivers/gpu/nvgpu/include/nvgpu/tsg.h | 4 ++-- drivers/gpu/nvgpu/include/nvgpu/types.h | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/channel.h b/drivers/gpu/nvgpu/include/nvgpu/channel.h index cd4fadf8..8d2d9b44 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/channel.h +++ b/drivers/gpu/nvgpu/include/nvgpu/channel.h @@ -243,7 +243,7 @@ struct channel_gk20a { nvgpu_atomic_t bound; int chid; - int tsgid; + u32 tsgid; pid_t pid; pid_t tgid; struct nvgpu_mutex ioctl_lock; diff --git a/drivers/gpu/nvgpu/include/nvgpu/tsg.h b/drivers/gpu/nvgpu/include/nvgpu/tsg.h index bed84986..e87be90d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/tsg.h +++ b/drivers/gpu/nvgpu/include/nvgpu/tsg.h @@ -28,7 +28,7 @@ #include "gk20a/gr_gk20a.h" -#define NVGPU_INVALID_TSG_ID (-1) +#define NVGPU_INVALID_TSG_ID (U32_MAX) struct channel_gk20a; @@ -68,7 +68,7 @@ struct tsg_gk20a { unsigned int timeslice_scale; u32 interleave_level; - int tsgid; + u32 tsgid; u32 runlist_id; pid_t tgid; diff --git a/drivers/gpu/nvgpu/include/nvgpu/types.h b/drivers/gpu/nvgpu/include/nvgpu/types.h index 3295af26..0cb847b6 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/types.h +++ b/drivers/gpu/nvgpu/include/nvgpu/types.h @@ -65,6 +65,7 @@ */ #if !defined(__KERNEL__) && !defined(U8_MAX) #define U8_MAX ((u8)255) +#define U32_MAX ((u32)~0U) #endif #endif /* NVGPU_TYPES_H */ -- cgit v1.2.2