gpu: nvgpu: Fix LibC MISRA 17.7 in common

MISRA Rule-17.7 requires the return value of all functions to be used.
Fix is either to use the return value or change the function to return
void. This patch contains fix for all 17.7 violations instandard C functions
in common code.

JIRA NVGPU-1036

Change-Id: Id6dea92df371e71b22b54cd7a521fc22812f9b69
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1929899
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Nicolas Benech
2018-10-18 10:50:29 -04:00
committed by mobile promotions
parent 27b47c20bd
commit cb2a05dd92
20 changed files with 97 additions and 88 deletions

View File

@@ -400,7 +400,8 @@ u32 nvgpu_bios_get_nvlink_config_data(struct gk20a *g)
return -EINVAL;
}
memcpy(&config, &g->bios.data[g->bios.nvlink_config_data_offset],
(void) memcpy(&config,
&g->bios.data[g->bios.nvlink_config_data_offset],
sizeof(config));
if (config.version != NVLINK_CONFIG_DATA_HDR_VER_10) {
@@ -475,7 +476,7 @@ static int nvgpu_bios_parse_appinfo_table(struct gk20a *g, int offset)
struct application_interface_table_hdr_v1 hdr;
int i;
memcpy((u8 *)&hdr, &g->bios.data[offset], sizeof(hdr));
nvgpu_memcpy((u8 *)&hdr, &g->bios.data[offset], sizeof(hdr));
nvgpu_log_fn(g, "appInfoHdr ver %d size %d entrySize %d entryCount %d",
hdr.version, hdr.header_size,
@@ -731,7 +732,7 @@ static void nvgpu_bios_parse_bit(struct gk20a *g, int offset)
int i;
nvgpu_log_fn(g, " ");
memcpy(&bit, &g->bios.data[offset], sizeof(bit));
(void) memcpy(&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",
@@ -739,7 +740,8 @@ static void nvgpu_bios_parse_bit(struct gk20a *g, int offset)
offset += bit.header_size;
for (i = 0; i < bit.token_entries; i++) {
memcpy(&bit_token, &g->bios.data[offset], sizeof(bit_token));
(void) memcpy(&bit_token, &g->bios.data[offset],
sizeof(bit_token));
nvgpu_log_info(g, "BIT token id %d ptr %d size %d ver %d",
bit_token.token_id, bit_token.data_ptr,