summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2016-11-09 18:54:27 -0500
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:56:51 -0500
commitd8da1d64381bb1265e194d81cb02673efa6ca54c (patch)
treefb69a0716c36659fc48be6ed0ce9ccc7c3bf96f3 /drivers
parent6579c1ec6fbe9d8bbd0c5da5dfaa51c02402527b (diff)
gpu: nvgpu: Fix signed comparison bugs
Fix small problems related to signed versus unsigned comparisons throughout the driver. Bump up the warning level to prevent such problems from occuring in future. Change-Id: Ib7026728ef0e8c3c9e68956fc9794ec3a786a8a2 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1252069 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/clk/clk_mclk.c2
-rw-r--r--drivers/gpu/nvgpu/gp106/clk_gp106.c2
-rw-r--r--drivers/gpu/nvgpu/gp10b/fb_gp10b.c4
-rw-r--r--drivers/gpu/nvgpu/gp10b/ltc_gp10b.c2
-rw-r--r--drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_mclk.c b/drivers/gpu/nvgpu/clk/clk_mclk.c
index 7b15767b..ea238c15 100644
--- a/drivers/gpu/nvgpu/clk/clk_mclk.c
+++ b/drivers/gpu/nvgpu/clk/clk_mclk.c
@@ -2347,7 +2347,7 @@ int clk_mclkseq_change_mclk_gddr5(struct gk20a *g, enum gk20a_mclk_speed speed)
2347 mclk->switch_std = 0; 2347 mclk->switch_std = 0;
2348 } else { 2348 } else {
2349 s64 prev_avg; 2349 s64 prev_avg;
2350 u64 curr = (t1-t0)/1000; 2350 s64 curr = (t1-t0)/1000;
2351 2351
2352 mclk->switch_max = curr > mclk->switch_max ? 2352 mclk->switch_max = curr > mclk->switch_max ?
2353 curr : mclk->switch_max; 2353 curr : mclk->switch_max;
diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c
index 1dd3922a..39c308a3 100644
--- a/drivers/gpu/nvgpu/gp106/clk_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c
@@ -195,7 +195,7 @@ static int clk_gp106_debugfs_init(struct gk20a *g) {
195 struct dentry *gpu_root = platform->debugfs; 195 struct dentry *gpu_root = platform->debugfs;
196 struct dentry *clocks_root; 196 struct dentry *clocks_root;
197 struct dentry *d; 197 struct dentry *d;
198 int i; 198 unsigned int i;
199 199
200 if (NULL == (clocks_root = debugfs_create_dir("clocks", gpu_root))) 200 if (NULL == (clocks_root = debugfs_create_dir("clocks", gpu_root)))
201 return -ENOMEM; 201 return -ENOMEM;
diff --git a/drivers/gpu/nvgpu/gp10b/fb_gp10b.c b/drivers/gpu/nvgpu/gp10b/fb_gp10b.c
index 9c0bc992..5324b5ef 100644
--- a/drivers/gpu/nvgpu/gp10b/fb_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/fb_gp10b.c
@@ -87,12 +87,12 @@ static void gp10b_init_kind_attr(void)
87 } 87 }
88} 88}
89 89
90static int gp10b_fb_compression_page_size(struct gk20a *g) 90static unsigned int gp10b_fb_compression_page_size(struct gk20a *g)
91{ 91{
92 return SZ_64K; 92 return SZ_64K;
93} 93}
94 94
95static int gp10b_fb_compressible_page_size(struct gk20a *g) 95static unsigned int gp10b_fb_compressible_page_size(struct gk20a *g)
96{ 96{
97 return SZ_4K; 97 return SZ_4K;
98} 98}
diff --git a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
index 3e64d435..31c79aff 100644
--- a/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/ltc_gp10b.c
@@ -124,7 +124,7 @@ static int gp10b_ltc_init_comptags(struct gk20a *g, struct gr_gk20a *gr)
124static void gp10b_ltc_isr(struct gk20a *g) 124static void gp10b_ltc_isr(struct gk20a *g)
125{ 125{
126 u32 mc_intr, ltc_intr; 126 u32 mc_intr, ltc_intr;
127 int ltc, slice; 127 unsigned int ltc, slice;
128 u32 ltc_stride = nvgpu_get_litter_value(g, GPU_LIT_LTC_STRIDE); 128 u32 ltc_stride = nvgpu_get_litter_value(g, GPU_LIT_LTC_STRIDE);
129 u32 lts_stride = nvgpu_get_litter_value(g, GPU_LIT_LTS_STRIDE); 129 u32 lts_stride = nvgpu_get_litter_value(g, GPU_LIT_LTS_STRIDE);
130 130
diff --git a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
index db4f14dd..8cf6d5e8 100644
--- a/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
+++ b/drivers/gpu/nvgpu/gp10b/platform_gp10b_tegra.c
@@ -62,7 +62,7 @@ static void gr_gp10b_remove_sysfs(struct device *dev);
62static int gp10b_tegra_get_clocks(struct device *dev) 62static int gp10b_tegra_get_clocks(struct device *dev)
63{ 63{
64 struct gk20a_platform *platform = dev_get_drvdata(dev); 64 struct gk20a_platform *platform = dev_get_drvdata(dev);
65 int i; 65 unsigned int i;
66 66
67 if (platform->is_fmodel) 67 if (platform->is_fmodel)
68 return 0; 68 return 0;