summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp106/regops_gp106.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/gp106/regops_gp106.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/gp106/regops_gp106.c')
-rw-r--r--drivers/gpu/nvgpu/gp106/regops_gp106.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/gpu/nvgpu/gp106/regops_gp106.c b/drivers/gpu/nvgpu/gp106/regops_gp106.c
index d9dadbac..25b88eeb 100644
--- a/drivers/gpu/nvgpu/gp106/regops_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/regops_gp106.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Tegra GP106 GPU Debugger Driver Register Ops 2 * Tegra GP106 GPU Debugger Driver Register Ops
3 * 3 *
4 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. 4 * Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
5 * 5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a 6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"), 7 * copy of this software and associated documentation files (the "Software"),
@@ -1686,7 +1686,7 @@ static const struct regop_offset_range gp106_global_whitelist_ranges[] = {
1686}; 1686};
1687 1687
1688 1688
1689static const u32 gp106_global_whitelist_ranges_count = 1689static const u64 gp106_global_whitelist_ranges_count =
1690 ARRAY_SIZE(gp106_global_whitelist_ranges); 1690 ARRAY_SIZE(gp106_global_whitelist_ranges);
1691 1691
1692/* context */ 1692/* context */
@@ -1694,24 +1694,24 @@ static const u32 gp106_global_whitelist_ranges_count =
1694/* runcontrol */ 1694/* runcontrol */
1695static const u32 gp106_runcontrol_whitelist[] = { 1695static const u32 gp106_runcontrol_whitelist[] = {
1696}; 1696};
1697static const u32 gp106_runcontrol_whitelist_count = 1697static const u64 gp106_runcontrol_whitelist_count =
1698 ARRAY_SIZE(gp106_runcontrol_whitelist); 1698 ARRAY_SIZE(gp106_runcontrol_whitelist);
1699 1699
1700static const struct regop_offset_range gp106_runcontrol_whitelist_ranges[] = { 1700static const struct regop_offset_range gp106_runcontrol_whitelist_ranges[] = {
1701}; 1701};
1702static const u32 gp106_runcontrol_whitelist_ranges_count = 1702static const u64 gp106_runcontrol_whitelist_ranges_count =
1703 ARRAY_SIZE(gp106_runcontrol_whitelist_ranges); 1703 ARRAY_SIZE(gp106_runcontrol_whitelist_ranges);
1704 1704
1705 1705
1706/* quad ctl */ 1706/* quad ctl */
1707static const u32 gp106_qctl_whitelist[] = { 1707static const u32 gp106_qctl_whitelist[] = {
1708}; 1708};
1709static const u32 gp106_qctl_whitelist_count = 1709static const u64 gp106_qctl_whitelist_count =
1710 ARRAY_SIZE(gp106_qctl_whitelist); 1710 ARRAY_SIZE(gp106_qctl_whitelist);
1711 1711
1712static const struct regop_offset_range gp106_qctl_whitelist_ranges[] = { 1712static const struct regop_offset_range gp106_qctl_whitelist_ranges[] = {
1713}; 1713};
1714static const u32 gp106_qctl_whitelist_ranges_count = 1714static const u64 gp106_qctl_whitelist_ranges_count =
1715 ARRAY_SIZE(gp106_qctl_whitelist_ranges); 1715 ARRAY_SIZE(gp106_qctl_whitelist_ranges);
1716 1716
1717const struct regop_offset_range *gp106_get_global_whitelist_ranges(void) 1717const struct regop_offset_range *gp106_get_global_whitelist_ranges(void)
@@ -1719,7 +1719,7 @@ const struct regop_offset_range *gp106_get_global_whitelist_ranges(void)
1719 return gp106_global_whitelist_ranges; 1719 return gp106_global_whitelist_ranges;
1720} 1720}
1721 1721
1722int gp106_get_global_whitelist_ranges_count(void) 1722u64 gp106_get_global_whitelist_ranges_count(void)
1723{ 1723{
1724 return gp106_global_whitelist_ranges_count; 1724 return gp106_global_whitelist_ranges_count;
1725} 1725}
@@ -1729,7 +1729,7 @@ const struct regop_offset_range *gp106_get_context_whitelist_ranges(void)
1729 return gp106_global_whitelist_ranges; 1729 return gp106_global_whitelist_ranges;
1730} 1730}
1731 1731
1732int gp106_get_context_whitelist_ranges_count(void) 1732u64 gp106_get_context_whitelist_ranges_count(void)
1733{ 1733{
1734 return gp106_global_whitelist_ranges_count; 1734 return gp106_global_whitelist_ranges_count;
1735} 1735}
@@ -1739,7 +1739,7 @@ const u32 *gp106_get_runcontrol_whitelist(void)
1739 return gp106_runcontrol_whitelist; 1739 return gp106_runcontrol_whitelist;
1740} 1740}
1741 1741
1742int gp106_get_runcontrol_whitelist_count(void) 1742u64 gp106_get_runcontrol_whitelist_count(void)
1743{ 1743{
1744 return gp106_runcontrol_whitelist_count; 1744 return gp106_runcontrol_whitelist_count;
1745} 1745}
@@ -1749,7 +1749,7 @@ const struct regop_offset_range *gp106_get_runcontrol_whitelist_ranges(void)
1749 return gp106_runcontrol_whitelist_ranges; 1749 return gp106_runcontrol_whitelist_ranges;
1750} 1750}
1751 1751
1752int gp106_get_runcontrol_whitelist_ranges_count(void) 1752u64 gp106_get_runcontrol_whitelist_ranges_count(void)
1753{ 1753{
1754 return gp106_runcontrol_whitelist_ranges_count; 1754 return gp106_runcontrol_whitelist_ranges_count;
1755} 1755}
@@ -1759,7 +1759,7 @@ const u32 *gp106_get_qctl_whitelist(void)
1759 return gp106_qctl_whitelist; 1759 return gp106_qctl_whitelist;
1760} 1760}
1761 1761
1762int gp106_get_qctl_whitelist_count(void) 1762u64 gp106_get_qctl_whitelist_count(void)
1763{ 1763{
1764 return gp106_qctl_whitelist_count; 1764 return gp106_qctl_whitelist_count;
1765} 1765}
@@ -1769,7 +1769,7 @@ const struct regop_offset_range *gp106_get_qctl_whitelist_ranges(void)
1769 return gp106_qctl_whitelist_ranges; 1769 return gp106_qctl_whitelist_ranges;
1770} 1770}
1771 1771
1772int gp106_get_qctl_whitelist_ranges_count(void) 1772u64 gp106_get_qctl_whitelist_ranges_count(void)
1773{ 1773{
1774 return gp106_qctl_whitelist_ranges_count; 1774 return gp106_qctl_whitelist_ranges_count;
1775} 1775}