mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: MISRA 21.15 fixes to vbios/acr code
MISRA Rule 21.15 prohibits use of memcpy() with incompatible ptrs to qualified/unqualified types. To circumvent this issue we've introduced a new MISRA-compliant nvgpu_memcpy() function. This change switches all remaining offending uses of memcpy() in acr/* and vbios/* over to use nvgpu_memcpy() with appropriate casts applied. JIRA NVGPU-849 Change-Id: I30ec9481c1418289a8664bdb4ef5be7833218179 Signed-off-by: Scott Long <scottl@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1941260 Reviewed-by: Philip Elcan <pelcan@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: svc-misra-checker <svc-misra-checker@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
0bceaf295a
commit
482d7e7ca2
@@ -400,7 +400,7 @@ u32 nvgpu_bios_get_nvlink_config_data(struct gk20a *g)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
(void) memcpy(&config,
|
||||
nvgpu_memcpy((u8 *)&config,
|
||||
&g->bios.data[g->bios.nvlink_config_data_offset],
|
||||
sizeof(config));
|
||||
|
||||
@@ -732,7 +732,7 @@ static void nvgpu_bios_parse_bit(struct gk20a *g, int offset)
|
||||
int i;
|
||||
|
||||
nvgpu_log_fn(g, " ");
|
||||
(void) memcpy(&bit, &g->bios.data[offset], sizeof(bit));
|
||||
nvgpu_memcpy((u8 *)&bit, &g->bios.data[offset], sizeof(bit));
|
||||
|
||||
nvgpu_log_info(g, "BIT header: %04x %08x", bit.id, bit.signature);
|
||||
nvgpu_log_info(g, "tokens: %d entries * %d bytes",
|
||||
@@ -740,7 +740,7 @@ static void nvgpu_bios_parse_bit(struct gk20a *g, int offset)
|
||||
|
||||
offset += bit.header_size;
|
||||
for (i = 0; i < bit.token_entries; i++) {
|
||||
(void) memcpy(&bit_token, &g->bios.data[offset],
|
||||
nvgpu_memcpy((u8 *)&bit_token, &g->bios.data[offset],
|
||||
sizeof(bit_token));
|
||||
|
||||
nvgpu_log_info(g, "BIT token id %d ptr %d size %d ver %d",
|
||||
|
||||
@@ -338,7 +338,7 @@ int gpccs_ucode_details(struct gk20a *g, struct flcn_ucode_img_v1 *p_img)
|
||||
err = -ENOMEM;
|
||||
goto rel_sig;
|
||||
}
|
||||
(void) memcpy(lsf_desc, (void *)gpccs_sig->data,
|
||||
nvgpu_memcpy((u8 *)lsf_desc, gpccs_sig->data,
|
||||
min_t(size_t, sizeof(*lsf_desc), gpccs_sig->size));
|
||||
lsf_desc->falcon_id = LSF_FALCON_ID_GPCCS;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user