diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2014-11-04 08:14:28 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:12:01 -0400 |
commit | b3f575074b66e8af1a9943874f9782b793fa7edc (patch) | |
tree | c4aaa1defc512cf5a896edc25445f169de184ece /drivers/gpu/nvgpu/gk20a/gk20a.c | |
parent | 797e4dd319bd2b9e13ce0e44a3bbbb75e4820330 (diff) |
gpu: nvgpu: fix sparse warnings
Fix below sparse warnings :
warning: Using plain integer as NULL pointer
warning: symbol <variable/funcion> was not declared. Should it be static?
warning: Initializer entry defined twice
Also, remove dead functions
Bug 1573254
Change-Id: I29d71ecc01c841233cf6b26c9088ca8874773469
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/593363
Reviewed-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index ad1a940d..276e5c3e 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -150,7 +150,6 @@ static const struct file_operations gk20a_prof_ops = { | |||
150 | .unlocked_ioctl = gk20a_dbg_gpu_dev_ioctl, | 150 | .unlocked_ioctl = gk20a_dbg_gpu_dev_ioctl, |
151 | /* .mmap = gk20a_prof_gpu_dev_mmap,*/ | 151 | /* .mmap = gk20a_prof_gpu_dev_mmap,*/ |
152 | /*int (*mmap) (struct file *, struct vm_area_struct *);*/ | 152 | /*int (*mmap) (struct file *, struct vm_area_struct *);*/ |
153 | .compat_ioctl = gk20a_dbg_gpu_dev_ioctl, | ||
154 | #ifdef CONFIG_COMPAT | 153 | #ifdef CONFIG_COMPAT |
155 | .compat_ioctl = gk20a_dbg_gpu_dev_ioctl, | 154 | .compat_ioctl = gk20a_dbg_gpu_dev_ioctl, |
156 | #endif | 155 | #endif |
@@ -206,11 +205,11 @@ static void kunmap_and_free_iopage(void **kvaddr, struct page **page) | |||
206 | { | 205 | { |
207 | if (*kvaddr) { | 206 | if (*kvaddr) { |
208 | kunmap(*kvaddr); | 207 | kunmap(*kvaddr); |
209 | *kvaddr = 0; | 208 | *kvaddr = NULL; |
210 | } | 209 | } |
211 | if (*page) { | 210 | if (*page) { |
212 | __free_page(*page); | 211 | __free_page(*page); |
213 | *page = 0; | 212 | *page = NULL; |
214 | } | 213 | } |
215 | } | 214 | } |
216 | 215 | ||
@@ -606,11 +605,11 @@ static void gk20a_remove_support(struct platform_device *dev) | |||
606 | 605 | ||
607 | if (g->regs) { | 606 | if (g->regs) { |
608 | iounmap(g->regs); | 607 | iounmap(g->regs); |
609 | g->regs = 0; | 608 | g->regs = NULL; |
610 | } | 609 | } |
611 | if (g->bar1) { | 610 | if (g->bar1) { |
612 | iounmap(g->bar1); | 611 | iounmap(g->bar1); |
613 | g->bar1 = 0; | 612 | g->bar1 = NULL; |
614 | } | 613 | } |
615 | } | 614 | } |
616 | 615 | ||
@@ -1063,11 +1062,11 @@ struct channel_gk20a *gk20a_get_channel_from_file(int fd) | |||
1063 | struct channel_gk20a *ch; | 1062 | struct channel_gk20a *ch; |
1064 | struct file *f = fget(fd); | 1063 | struct file *f = fget(fd); |
1065 | if (!f) | 1064 | if (!f) |
1066 | return 0; | 1065 | return NULL; |
1067 | 1066 | ||
1068 | if (f->f_op != &gk20a_channel_ops) { | 1067 | if (f->f_op != &gk20a_channel_ops) { |
1069 | fput(f); | 1068 | fput(f); |
1070 | return 0; | 1069 | return NULL; |
1071 | } | 1070 | } |
1072 | 1071 | ||
1073 | ch = (struct channel_gk20a *)f->private_data; | 1072 | ch = (struct channel_gk20a *)f->private_data; |
@@ -1119,7 +1118,7 @@ static void gk20a_pm_shutdown(struct platform_device *pdev) | |||
1119 | } | 1118 | } |
1120 | 1119 | ||
1121 | #ifdef CONFIG_PM | 1120 | #ifdef CONFIG_PM |
1122 | const struct dev_pm_ops gk20a_pm_ops = { | 1121 | static const struct dev_pm_ops gk20a_pm_ops = { |
1123 | #if defined(CONFIG_PM_RUNTIME) && !defined(CONFIG_PM_GENERIC_DOMAINS) | 1122 | #if defined(CONFIG_PM_RUNTIME) && !defined(CONFIG_PM_GENERIC_DOMAINS) |
1124 | .runtime_resume = gk20a_pm_enable_clk, | 1123 | .runtime_resume = gk20a_pm_enable_clk, |
1125 | .runtime_suspend = gk20a_pm_disable_clk, | 1124 | .runtime_suspend = gk20a_pm_disable_clk, |
@@ -1261,7 +1260,7 @@ static int gk20a_pm_init(struct platform_device *dev) | |||
1261 | return err; | 1260 | return err; |
1262 | } | 1261 | } |
1263 | 1262 | ||
1264 | int gk20a_secure_page_alloc(struct platform_device *pdev) | 1263 | static int gk20a_secure_page_alloc(struct platform_device *pdev) |
1265 | { | 1264 | { |
1266 | struct gk20a_platform *platform = platform_get_drvdata(pdev); | 1265 | struct gk20a_platform *platform = platform_get_drvdata(pdev); |
1267 | int err = 0; | 1266 | int err = 0; |
@@ -1466,13 +1465,15 @@ static int __exit gk20a_remove(struct platform_device *dev) | |||
1466 | 1465 | ||
1467 | gk20a_user_deinit(dev); | 1466 | gk20a_user_deinit(dev); |
1468 | 1467 | ||
1469 | set_gk20a(dev, 0); | 1468 | set_gk20a(dev, NULL); |
1470 | #ifdef CONFIG_DEBUG_FS | 1469 | #ifdef CONFIG_DEBUG_FS |
1471 | debugfs_remove(g->debugfs_ltc_enabled); | 1470 | debugfs_remove(g->debugfs_ltc_enabled); |
1472 | debugfs_remove(g->debugfs_gr_idle_timeout_default); | 1471 | debugfs_remove(g->debugfs_gr_idle_timeout_default); |
1473 | debugfs_remove(g->debugfs_timeouts_enabled); | 1472 | debugfs_remove(g->debugfs_timeouts_enabled); |
1474 | #endif | 1473 | #endif |
1475 | 1474 | ||
1475 | gk20a_remove_sysfs(&dev->dev); | ||
1476 | |||
1476 | kfree(g); | 1477 | kfree(g); |
1477 | 1478 | ||
1478 | #ifdef CONFIG_PM_RUNTIME | 1479 | #ifdef CONFIG_PM_RUNTIME |