mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: fix MISRA issues common.mm.nvgpu_mem
MISRA Rule 16.x requires switch statements to be well-formed, with non-empty default clause and unconditional break statement for each clause. This patch fixes MISRA Rule violations in nvgpu.common.mm.nvgpu_mem. Jira NVGPU-3766 Change-Id: I0d19b26d1e6f801dadd25337fa56e6ee898c8da0 Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2147783 Reviewed-by: Philip Elcan <pelcan@nvidia.com> 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
4108e9e437
commit
e8df3f3907
@@ -151,22 +151,21 @@ nvgpu_mem_from_clear_list_entry(struct nvgpu_list_node *node)
|
||||
};
|
||||
#endif
|
||||
|
||||
static const char *aperture_name[APERTURE_MAX_ENUM + 1] = {
|
||||
[APERTURE_INVALID] = "INVAL",
|
||||
[APERTURE_SYSMEM] = "SYSTEM",
|
||||
[APERTURE_SYSMEM_COH] = "SYSCOH",
|
||||
[APERTURE_VIDMEM] = "VIDMEM",
|
||||
[APERTURE_MAX_ENUM] = "UNKNOWN",
|
||||
};
|
||||
|
||||
static inline const char *nvgpu_aperture_str(struct gk20a *g,
|
||||
enum nvgpu_aperture aperture)
|
||||
{
|
||||
switch (aperture) {
|
||||
case APERTURE_INVALID:
|
||||
return "INVAL";
|
||||
case APERTURE_SYSMEM:
|
||||
return "SYSMEM";
|
||||
case APERTURE_SYSMEM_COH:
|
||||
return "SYSCOH";
|
||||
case APERTURE_VIDMEM:
|
||||
return "VIDMEM";
|
||||
case APERTURE_MAX_ENUM:
|
||||
return "UNKNOWN";
|
||||
};
|
||||
return "UNKNOWN";
|
||||
if ((aperture < APERTURE_INVALID) || (aperture >= APERTURE_MAX_ENUM)) {
|
||||
return aperture_name[APERTURE_MAX_ENUM];
|
||||
}
|
||||
return aperture_name[aperture];
|
||||
}
|
||||
|
||||
bool nvgpu_aperture_is_sysmem(enum nvgpu_aperture ap);
|
||||
|
||||
Reference in New Issue
Block a user