mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: fix MISRA 21.3 mm nvgpu allocator
MISRA rule 21.3 forbids from using calloc, malloc, realloc and free identifiers for function or macro names. This patch renames nvgpu allocator free operator to free_alloc to follow rule 21.3. Jira NVGPU-3336 Change-Id: Ie9f48d567255a3e1dca70632fbe3d36b45023f3f Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2111365 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
2b165deba1
commit
778f6b2874
@@ -42,7 +42,7 @@
|
||||
static bool dummy_op_called[OP_NUMBER];
|
||||
static const char *ops_str[] = {
|
||||
"alloc",
|
||||
"free",
|
||||
"free_alloc",
|
||||
"alloc_pte",
|
||||
"alloc_fixed",
|
||||
"free fixed",
|
||||
@@ -135,7 +135,7 @@ static void dummy_fini(struct nvgpu_allocator *allocator)
|
||||
|
||||
static struct nvgpu_allocator_ops dummy_ops = {
|
||||
.alloc = dummy_alloc,
|
||||
.free = dummy_free,
|
||||
.free_alloc = dummy_free,
|
||||
.alloc_pte = dummy_alloc_pte,
|
||||
.alloc_fixed = dummy_alloc_fixed,
|
||||
.free_fixed = dummy_free_fixed,
|
||||
@@ -271,7 +271,7 @@ static int test_nvgpu_alloc_common_init(struct unit_module *m,
|
||||
unit_return_fail(m,
|
||||
"common_init passes despite missing free(),fini()\n");
|
||||
|
||||
ops.free = dummy_free;
|
||||
ops.free_alloc = dummy_free;
|
||||
if (nvgpu_alloc_common_init(&a, NULL, "test", NULL, false, &ops) == 0)
|
||||
unit_return_fail(m,
|
||||
"common_init passes despite missing fini()\n");
|
||||
@@ -305,7 +305,7 @@ static int test_nvgpu_alloc_destroy(struct unit_module *m,
|
||||
struct nvgpu_allocator zero_a = { };
|
||||
struct nvgpu_allocator_ops ops = {
|
||||
.alloc = dummy_alloc,
|
||||
.free = dummy_free,
|
||||
.free_alloc = dummy_free,
|
||||
.fini = dummy_fini,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user