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

@@ -136,7 +136,7 @@ int nvgpu_css_enable_snapshot(struct channel_gk20a *ch,
data->hw_end = data->hw_snapshot +
snapshot_size / sizeof(struct gk20a_cs_snapshot_fifo_entry);
data->hw_get = data->hw_snapshot;
memset(data->hw_snapshot, 0xff, snapshot_size);
(void) memset(data->hw_snapshot, 0xff, snapshot_size);
g->ops.perf.membuf_reset_streaming(g);
g->ops.perf.enable_membuf(g, snapshot_size, data->hw_memdesc.gpu_va,
@@ -149,7 +149,7 @@ int nvgpu_css_enable_snapshot(struct channel_gk20a *ch,
failed_allocation:
if (data->hw_memdesc.size) {
nvgpu_dma_unmap_free(g->mm.pmu.vm, &data->hw_memdesc);
memset(&data->hw_memdesc, 0, sizeof(data->hw_memdesc));
(void) memset(&data->hw_memdesc, 0, sizeof(data->hw_memdesc));
}
data->hw_snapshot = NULL;
@@ -168,7 +168,7 @@ void nvgpu_css_disable_snapshot(struct gr_gk20a *gr)
g->ops.perf.disable_membuf(g);
nvgpu_dma_unmap_free(g->mm.pmu.vm, &data->hw_memdesc);
memset(&data->hw_memdesc, 0, sizeof(data->hw_memdesc));
(void) memset(&data->hw_memdesc, 0, sizeof(data->hw_memdesc));
data->hw_snapshot = NULL;
nvgpu_log_info(g, "cyclestats: buffer for hardware snapshots disabled\n");
@@ -320,11 +320,12 @@ next_hw_fifo_entry:
/* re-set HW buffer after processing taking wrapping into account */
if (css->hw_get < src) {
memset(css->hw_get, 0xff, (src - css->hw_get) * sizeof(*src));
(void) memset(css->hw_get, 0xff,
(src - css->hw_get) * sizeof(*src));
} else {
memset(css->hw_snapshot, 0xff,
(void) memset(css->hw_snapshot, 0xff,
(src - css->hw_snapshot) * sizeof(*src));
memset(css->hw_get, 0xff,
(void) memset(css->hw_get, 0xff,
(css->hw_end - css->hw_get) * sizeof(*src));
}
gr->cs_data->hw_get = src;
@@ -408,7 +409,7 @@ static int css_gr_create_client_data(struct gk20a *g,
* guest side
*/
if (cur->snapshot) {
memset(cur->snapshot, 0, sizeof(*cur->snapshot));
(void) memset(cur->snapshot, 0, sizeof(*cur->snapshot));
cur->snapshot->start = sizeof(*cur->snapshot);
/* we should be ensure that can fit all fifo entries here */
cur->snapshot->end =