diff options
author | Sai Nikhil <snikhil@nvidia.com> | 2018-08-17 01:20:17 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-29 11:59:31 -0400 |
commit | 2f97e683feed3c3ba3c8722c4f6ab7466bcef0c0 (patch) | |
tree | c0f90c3dc6909122cfde071efff8ff24d2b61471 /drivers/gpu/nvgpu/common/mm/buddy_allocator_priv.h | |
parent | 19cd7ffb5def933db323fe682ec4a263eb1923f9 (diff) |
gpu: nvgpu: common: fix MISRA Rule 10.4
MISRA Rule 10.4 only allows the usage of arithmetic operations on
operands of the same essential type category.
Adding "U" at the end of the integer literals to have same type of
operands when an arithmetic operation is performed.
This fix violations where an arithmetic operation is performed on
signed and unsigned int types.
In balloc_get_order_list() the argument "int order" has been changed to
a u64 because all callers of this function pass a u64 argument.
JIRA NVGPU-992
Change-Id: Ie2964f9f1dfb2865a9bd6e6cdd65e7cda6c1f638
Signed-off-by: Sai Nikhil <snikhil@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1784419
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/buddy_allocator_priv.h')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/buddy_allocator_priv.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/buddy_allocator_priv.h b/drivers/gpu/nvgpu/common/mm/buddy_allocator_priv.h index c9e332a5..fe3926b9 100644 --- a/drivers/gpu/nvgpu/common/mm/buddy_allocator_priv.h +++ b/drivers/gpu/nvgpu/common/mm/buddy_allocator_priv.h | |||
@@ -159,7 +159,7 @@ struct nvgpu_buddy_allocator { | |||
159 | /* | 159 | /* |
160 | * Impose an upper bound on the maximum order. | 160 | * Impose an upper bound on the maximum order. |
161 | */ | 161 | */ |
162 | #define GPU_BALLOC_ORDER_LIST_LEN (GPU_BALLOC_MAX_ORDER + 1) | 162 | #define GPU_BALLOC_ORDER_LIST_LEN (GPU_BALLOC_MAX_ORDER + 1U) |
163 | 163 | ||
164 | struct nvgpu_list_node buddy_list[GPU_BALLOC_ORDER_LIST_LEN]; | 164 | struct nvgpu_list_node buddy_list[GPU_BALLOC_ORDER_LIST_LEN]; |
165 | u64 buddy_list_len[GPU_BALLOC_ORDER_LIST_LEN]; | 165 | u64 buddy_list_len[GPU_BALLOC_ORDER_LIST_LEN]; |
@@ -190,7 +190,7 @@ static inline struct nvgpu_buddy_allocator *buddy_allocator( | |||
190 | } | 190 | } |
191 | 191 | ||
192 | static inline struct nvgpu_list_node *balloc_get_order_list( | 192 | static inline struct nvgpu_list_node *balloc_get_order_list( |
193 | struct nvgpu_buddy_allocator *a, int order) | 193 | struct nvgpu_buddy_allocator *a, u64 order) |
194 | { | 194 | { |
195 | return &a->buddy_list[order]; | 195 | return &a->buddy_list[order]; |
196 | } | 196 | } |