From 941ac9a9d07bedb4062fd0c4d32eb2ef80a42359 Mon Sep 17 00:00:00 2001 From: Amulya Date: Tue, 28 Aug 2018 12:34:55 +0530 Subject: nvgpu: common: MISRA 10.1 boolean fixes Fix violations where a variable of type non-boolean is used as a boolean in gpu/nvgpu/common. JIRA NVGPU-646 Change-Id: I9773d863b715f83ae1772b75d5373f77244bc8ca Signed-off-by: Amulya Reviewed-on: https://git-master.nvidia.com/r/1807132 GVS: Gerrit_Virtual_Submit Tested-by: Amulya Murthyreddy Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/allocator.h | 16 ++++++++-------- drivers/gpu/nvgpu/include/nvgpu/vm.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers/gpu/nvgpu/include') diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h index 2bff0efd..d722673d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2018, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -83,7 +83,7 @@ struct nvgpu_allocator_ops { u64 (*base)(struct nvgpu_allocator *allocator); u64 (*length)(struct nvgpu_allocator *allocator); u64 (*end)(struct nvgpu_allocator *allocator); - int (*inited)(struct nvgpu_allocator *allocator); + bool (*inited)(struct nvgpu_allocator *allocator); u64 (*space)(struct nvgpu_allocator *allocator); /* Destructor. */ @@ -188,11 +188,11 @@ nvgpu_alloc_carveout_from_co_entry(struct nvgpu_list_node *node) * pointing to the allocation base (requires GPU_ALLOC_FORCE_CONTIG to be * set as well). */ -#define GPU_ALLOC_GVA_SPACE BIT(0) -#define GPU_ALLOC_NO_ALLOC_PAGE BIT(1) -#define GPU_ALLOC_4K_VIDMEM_PAGES BIT(2) -#define GPU_ALLOC_FORCE_CONTIG BIT(3) -#define GPU_ALLOC_NO_SCATTER_GATHER BIT(4) +#define GPU_ALLOC_GVA_SPACE BIT64(0) +#define GPU_ALLOC_NO_ALLOC_PAGE BIT64(1) +#define GPU_ALLOC_4K_VIDMEM_PAGES BIT64(2) +#define GPU_ALLOC_FORCE_CONTIG BIT64(3) +#define GPU_ALLOC_NO_SCATTER_GATHER BIT64(4) static inline void alloc_lock(struct nvgpu_allocator *a) { @@ -256,7 +256,7 @@ void nvgpu_alloc_release_carveout(struct nvgpu_allocator *a, u64 nvgpu_alloc_base(struct nvgpu_allocator *a); u64 nvgpu_alloc_length(struct nvgpu_allocator *a); u64 nvgpu_alloc_end(struct nvgpu_allocator *a); -u64 nvgpu_alloc_initialized(struct nvgpu_allocator *a); +bool nvgpu_alloc_initialized(struct nvgpu_allocator *a); u64 nvgpu_alloc_space(struct nvgpu_allocator *a); void nvgpu_alloc_destroy(struct nvgpu_allocator *allocator); diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h index b47d4ee0..23dac0ac 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/vm.h +++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -220,7 +220,7 @@ void nvgpu_vm_get(struct vm_gk20a *vm); void nvgpu_vm_put(struct vm_gk20a *vm); int vm_aspace_id(struct vm_gk20a *vm); -int nvgpu_big_pages_possible(struct vm_gk20a *vm, u64 base, u64 size); +bool nvgpu_big_pages_possible(struct vm_gk20a *vm, u64 base, u64 size); int nvgpu_vm_pde_coverage_bit_count(struct vm_gk20a *vm); -- cgit v1.2.2