summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gv11b/regops_gv11b.c
diff options
context:
space:
mode:
authorPhilip Elcan <pelcan@nvidia.com>2018-08-23 14:45:19 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-29 20:47:25 -0400
commit2d0149c9abd74fd6bb59e076cfd46f49097e5662 (patch)
tree3d14929f7721440b777abfc150a35abbb1b03f36 /drivers/gpu/nvgpu/gv11b/regops_gv11b.c
parent74639b444251d7adc222400625eb59a3d53d0c0a (diff)
gpu: nvgpu: resolve MISRA 10.3 violations
MISRA rule 10.3 prohibits implicit assigning of u64 to u32. The nvgpu was assigning the value returned by ARRAY_SIZE which is a u64 to a u32. This value was then returned in a function defined by gpu_ops. This patch changes the return type for these gpu_ops to u64 and updates the functions that implement the functions and lastly the saved value. This removes the violation in this instance. JIRA NVGPU-647 Change-Id: I2b93929633cf4809d8f65ee41f739f45d4c2cda7 Signed-off-by: Philip Elcan <pelcan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1805588 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gv11b/regops_gv11b.c')
-rw-r--r--drivers/gpu/nvgpu/gv11b/regops_gv11b.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/regops_gv11b.c b/drivers/gpu/nvgpu/gv11b/regops_gv11b.c
index f84b5066..768674fe 100644
--- a/drivers/gpu/nvgpu/gv11b/regops_gv11b.c
+++ b/drivers/gpu/nvgpu/gv11b/regops_gv11b.c
@@ -1441,7 +1441,7 @@ static const struct regop_offset_range gv11b_global_whitelist_ranges[] = {
1441}; 1441};
1442 1442
1443 1443
1444static const u32 gv11b_global_whitelist_ranges_count = 1444static const u64 gv11b_global_whitelist_ranges_count =
1445 ARRAY_SIZE(gv11b_global_whitelist_ranges); 1445 ARRAY_SIZE(gv11b_global_whitelist_ranges);
1446 1446
1447/* context */ 1447/* context */
@@ -1449,24 +1449,24 @@ static const u32 gv11b_global_whitelist_ranges_count =
1449/* runcontrol */ 1449/* runcontrol */
1450static const u32 gv11b_runcontrol_whitelist[] = { 1450static const u32 gv11b_runcontrol_whitelist[] = {
1451}; 1451};
1452static const u32 gv11b_runcontrol_whitelist_count = 1452static const u64 gv11b_runcontrol_whitelist_count =
1453 ARRAY_SIZE(gv11b_runcontrol_whitelist); 1453 ARRAY_SIZE(gv11b_runcontrol_whitelist);
1454 1454
1455static const struct regop_offset_range gv11b_runcontrol_whitelist_ranges[] = { 1455static const struct regop_offset_range gv11b_runcontrol_whitelist_ranges[] = {
1456}; 1456};
1457static const u32 gv11b_runcontrol_whitelist_ranges_count = 1457static const u64 gv11b_runcontrol_whitelist_ranges_count =
1458 ARRAY_SIZE(gv11b_runcontrol_whitelist_ranges); 1458 ARRAY_SIZE(gv11b_runcontrol_whitelist_ranges);
1459 1459
1460 1460
1461/* quad ctl */ 1461/* quad ctl */
1462static const u32 gv11b_qctl_whitelist[] = { 1462static const u32 gv11b_qctl_whitelist[] = {
1463}; 1463};
1464static const u32 gv11b_qctl_whitelist_count = 1464static const u64 gv11b_qctl_whitelist_count =
1465 ARRAY_SIZE(gv11b_qctl_whitelist); 1465 ARRAY_SIZE(gv11b_qctl_whitelist);
1466 1466
1467static const struct regop_offset_range gv11b_qctl_whitelist_ranges[] = { 1467static const struct regop_offset_range gv11b_qctl_whitelist_ranges[] = {
1468}; 1468};
1469static const u32 gv11b_qctl_whitelist_ranges_count = 1469static const u64 gv11b_qctl_whitelist_ranges_count =
1470 ARRAY_SIZE(gv11b_qctl_whitelist_ranges); 1470 ARRAY_SIZE(gv11b_qctl_whitelist_ranges);
1471 1471
1472const struct regop_offset_range *gv11b_get_global_whitelist_ranges(void) 1472const struct regop_offset_range *gv11b_get_global_whitelist_ranges(void)
@@ -1474,7 +1474,7 @@ const struct regop_offset_range *gv11b_get_global_whitelist_ranges(void)
1474 return gv11b_global_whitelist_ranges; 1474 return gv11b_global_whitelist_ranges;
1475} 1475}
1476 1476
1477int gv11b_get_global_whitelist_ranges_count(void) 1477u64 gv11b_get_global_whitelist_ranges_count(void)
1478{ 1478{
1479 return gv11b_global_whitelist_ranges_count; 1479 return gv11b_global_whitelist_ranges_count;
1480} 1480}
@@ -1484,7 +1484,7 @@ const struct regop_offset_range *gv11b_get_context_whitelist_ranges(void)
1484 return gv11b_global_whitelist_ranges; 1484 return gv11b_global_whitelist_ranges;
1485} 1485}
1486 1486
1487int gv11b_get_context_whitelist_ranges_count(void) 1487u64 gv11b_get_context_whitelist_ranges_count(void)
1488{ 1488{
1489 return gv11b_global_whitelist_ranges_count; 1489 return gv11b_global_whitelist_ranges_count;
1490} 1490}
@@ -1494,7 +1494,7 @@ const u32 *gv11b_get_runcontrol_whitelist(void)
1494 return gv11b_runcontrol_whitelist; 1494 return gv11b_runcontrol_whitelist;
1495} 1495}
1496 1496
1497int gv11b_get_runcontrol_whitelist_count(void) 1497u64 gv11b_get_runcontrol_whitelist_count(void)
1498{ 1498{
1499 return gv11b_runcontrol_whitelist_count; 1499 return gv11b_runcontrol_whitelist_count;
1500} 1500}
@@ -1504,7 +1504,7 @@ const struct regop_offset_range *gv11b_get_runcontrol_whitelist_ranges(void)
1504 return gv11b_runcontrol_whitelist_ranges; 1504 return gv11b_runcontrol_whitelist_ranges;
1505} 1505}
1506 1506
1507int gv11b_get_runcontrol_whitelist_ranges_count(void) 1507u64 gv11b_get_runcontrol_whitelist_ranges_count(void)
1508{ 1508{
1509 return gv11b_runcontrol_whitelist_ranges_count; 1509 return gv11b_runcontrol_whitelist_ranges_count;
1510} 1510}
@@ -1514,7 +1514,7 @@ const u32 *gv11b_get_qctl_whitelist(void)
1514 return gv11b_qctl_whitelist; 1514 return gv11b_qctl_whitelist;
1515} 1515}
1516 1516
1517int gv11b_get_qctl_whitelist_count(void) 1517u64 gv11b_get_qctl_whitelist_count(void)
1518{ 1518{
1519 return gv11b_qctl_whitelist_count; 1519 return gv11b_qctl_whitelist_count;
1520} 1520}
@@ -1524,7 +1524,7 @@ const struct regop_offset_range *gv11b_get_qctl_whitelist_ranges(void)
1524 return gv11b_qctl_whitelist_ranges; 1524 return gv11b_qctl_whitelist_ranges;
1525} 1525}
1526 1526
1527int gv11b_get_qctl_whitelist_ranges_count(void) 1527u64 gv11b_get_qctl_whitelist_ranges_count(void)
1528{ 1528{
1529 return gv11b_qctl_whitelist_ranges_count; 1529 return gv11b_qctl_whitelist_ranges_count;
1530} 1530}