diff options
author | Sai Nikhil <snikhil@nvidia.com> | 2018-08-21 02:48:10 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-08-21 17:54:27 -0400 |
commit | 05f45bcfc390c46f000f4c6b46546eebed869df6 (patch) | |
tree | 0aca01cd8e4c41d453fce8757bf37e6aec976ff0 /drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |
parent | 9f5a464d289f22302c81409b08f5615da89a4502 (diff) |
gpu: nvgpu: MISRA 10.3 Conversions to/from char
MISRA Rule 10.3 states that the value of an expression shall not be
assigned to an object with a narrower essential type or of a
different essential type category.
We have cases where we are converting to/from char and non char types
and this fix 10.3 violations resulting from these conversions.
This also fix violations in conversions between s8 and non-s8 types
as s8 can be typedefed as char.
Jira NVGPU-1010
Change-Id: I150dd633eb7575de9ea2bedd598b7af74d1fcbd9
Signed-off-by: Sai Nikhil <snikhil@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1801613
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index dcaf11b1..9ec4c867 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | |||
@@ -96,7 +96,7 @@ static void print_pmu_trace(struct nvgpu_pmu *pmu) | |||
96 | if (k >= 40) | 96 | if (k >= 40) |
97 | break; | 97 | break; |
98 | strncpy(part_str, (trace+i+20+m), k); | 98 | strncpy(part_str, (trace+i+20+m), k); |
99 | part_str[k] = 0; | 99 | part_str[k] = '\0'; |
100 | count += scnprintf((buf + count), 0x40, "%s0x%x", | 100 | count += scnprintf((buf + count), 0x40, "%s0x%x", |
101 | part_str, trace1[(i / 4) + 1 + l]); | 101 | part_str, trace1[(i / 4) + 1 + l]); |
102 | l++; | 102 | l++; |