From 7665421874e66f0b00d52a5f1db5210895a9ab7b Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 11 Apr 2017 11:39:21 -0700 Subject: gpu: nvgpu: Replace use of bitops.h and kernel.h Remove use of linux/kernel.h and linux/compiler.h. We don't use anything in those headers. Also replace use of linux/bitops.h with new wrapper nvgpu/bitops.h. JIRA NVGPU-13 Change-Id: Iefa6b4598d5a5e7fc386c0a7a554e778a87010d6 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1460777 Reviewed-by: Alex Waterman Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Deepak Nibade --- drivers/gpu/nvgpu/clk/clk_arb.c | 3 +-- drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 2 +- drivers/gpu/nvgpu/common/linux/kmem.c | 1 - drivers/gpu/nvgpu/common/mm/bitmap_allocator.c | 4 +--- drivers/gpu/nvgpu/common/mm/buddy_allocator.c | 2 -- drivers/gpu/nvgpu/common/mm/lockless_allocator.c | 1 - drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c | 2 -- drivers/gpu/nvgpu/common/mm/page_allocator.c | 3 +-- drivers/gpu/nvgpu/gk20a/bus_gk20a.h | 2 ++ drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c | 2 +- drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | 1 - drivers/gpu/nvgpu/gk20a/hal.h | 2 -- drivers/gpu/nvgpu/gk20a/hal_gk20a.h | 2 -- drivers/gpu/nvgpu/gk20a/kind_gk20a.c | 6 +----- drivers/gpu/nvgpu/gk20a/kind_gk20a.h | 1 + drivers/gpu/nvgpu/gk20a/ltc_gk20a.c | 2 -- drivers/gpu/nvgpu/gk20a/sync_gk20a.c | 1 - drivers/gpu/nvgpu/gp106/xve_gp106.c | 1 - drivers/gpu/nvgpu/include/nvgpu/bitops.h | 20 ++++++++++++++++++++ drivers/gpu/nvgpu/include/nvgpu/log.h | 3 +++ drivers/gpu/nvgpu/vgpu/css_vgpu.c | 2 -- drivers/gpu/nvgpu/vgpu/gk20a/vgpu_gr_gk20a.c | 2 -- drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c | 2 -- drivers/gpu/nvgpu/vgpu/sysfs_vgpu.c | 1 - drivers/gpu/nvgpu/vgpu/tsg_vgpu.c | 1 - 25 files changed, 32 insertions(+), 37 deletions(-) create mode 100644 drivers/gpu/nvgpu/include/nvgpu/bitops.h (limited to 'drivers/gpu/nvgpu') diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c index 85a5018d..3625706c 100644 --- a/drivers/gpu/nvgpu/clk/clk_arb.c +++ b/drivers/gpu/nvgpu/clk/clk_arb.c @@ -15,14 +15,13 @@ #include #include #include -#include -#include #include #include #include #include #include +#include #include #include diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index ce9a4176..c0976aa2 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c @@ -18,9 +18,9 @@ #include #include #include -#include #include +#include #include #include "ioctl_ctrl.h" diff --git a/drivers/gpu/nvgpu/common/linux/kmem.c b/drivers/gpu/nvgpu/common/linux/kmem.c index 86484888..87aeb184 100644 --- a/drivers/gpu/nvgpu/common/linux/kmem.c +++ b/drivers/gpu/nvgpu/common/linux/kmem.c @@ -14,7 +14,6 @@ * along with this program. If not, see . */ -#include #include #include #include diff --git a/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c b/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c index b32da945..88051b38 100644 --- a/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/bitmap_allocator.c @@ -14,9 +14,7 @@ * along with this program. If not, see . */ -#include -#include - +#include #include #include diff --git a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c index 06cd7911..81f82c60 100644 --- a/drivers/gpu/nvgpu/common/mm/buddy_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/buddy_allocator.c @@ -14,8 +14,6 @@ * along with this program. If not, see . */ -#include - #include #include diff --git a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c index ed9dadd3..93c870b5 100644 --- a/drivers/gpu/nvgpu/common/mm/lockless_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/lockless_allocator.c @@ -14,7 +14,6 @@ * along with this program. If not, see . */ -#include #include #include diff --git a/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c b/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c index b8e713eb..b84855b5 100644 --- a/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/nvgpu_allocator.c @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -#include - #include #include "gk20a/gk20a.h" diff --git a/drivers/gpu/nvgpu/common/mm/page_allocator.c b/drivers/gpu/nvgpu/common/mm/page_allocator.c index 1e5fae3d..41ce28a7 100644 --- a/drivers/gpu/nvgpu/common/mm/page_allocator.c +++ b/drivers/gpu/nvgpu/common/mm/page_allocator.c @@ -14,10 +14,9 @@ * along with this program. If not, see . */ -#include -#include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/bus_gk20a.h b/drivers/gpu/nvgpu/gk20a/bus_gk20a.h index b2f8f8c9..72710c35 100644 --- a/drivers/gpu/nvgpu/gk20a/bus_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/bus_gk20a.h @@ -16,6 +16,8 @@ #ifndef BUS_GK20A_H #define BUS_GK20A_H +#include + struct gk20a; struct gpu_ops; struct nvgpu_mem; diff --git a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c index 76237e03..48a60f5d 100644 --- a/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/css_gr_gk20a.c @@ -16,10 +16,10 @@ * along with this program. If not, see . */ -#include #include #include +#include #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c index 4b3bb83c..4d5854d4 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/hal.h b/drivers/gpu/nvgpu/gk20a/hal.h index da02cf5f..4203dbfa 100644 --- a/drivers/gpu/nvgpu/gk20a/hal.h +++ b/drivers/gpu/nvgpu/gk20a/hal.h @@ -16,8 +16,6 @@ #ifndef __HAL_GPU__ #define __HAL_GPU__ -#include - struct gk20a; int gpu_init_hal(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/gk20a/hal_gk20a.h b/drivers/gpu/nvgpu/gk20a/hal_gk20a.h index f214432a..f5475809 100644 --- a/drivers/gpu/nvgpu/gk20a/hal_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/hal_gk20a.h @@ -18,8 +18,6 @@ #ifndef __HAL_GK20A__ #define __HAL_GK20A__ -#include - struct gk20a; int gk20a_init_hal(struct gk20a *g); diff --git a/drivers/gpu/nvgpu/gk20a/kind_gk20a.c b/drivers/gpu/nvgpu/gk20a/kind_gk20a.c index 00e7a54c..4e9ebe4b 100644 --- a/drivers/gpu/nvgpu/gk20a/kind_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/kind_gk20a.c @@ -1,9 +1,7 @@ /* - * drivers/video/tegra/host/gk20a/kind_gk20a.c - * * GK20A memory kind management * - * Copyright (c) 2011-2014, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-2017, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -18,8 +16,6 @@ * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. */ -#include -#include #include "kind_gk20a.h" diff --git a/drivers/gpu/nvgpu/gk20a/kind_gk20a.h b/drivers/gpu/nvgpu/gk20a/kind_gk20a.h index 93f011d4..9dec84a5 100644 --- a/drivers/gpu/nvgpu/gk20a/kind_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/kind_gk20a.h @@ -21,6 +21,7 @@ #ifndef __KIND_GK20A_H__ #define __KIND_GK20A_H__ +#include void gk20a_init_uncompressed_kind_map(void); void gk20a_init_kind_attr(void); diff --git a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c index f8416d55..0d4d62b8 100644 --- a/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ltc_gk20a.c @@ -16,8 +16,6 @@ * along with this program. If not, see . */ -#include - #include #include #include diff --git a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c index ecc96a7b..b5619db7 100644 --- a/drivers/gpu/nvgpu/gk20a/sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/sync_gk20a.c @@ -14,7 +14,6 @@ */ #include -#include #include #include #include diff --git a/drivers/gpu/nvgpu/gp106/xve_gp106.c b/drivers/gpu/nvgpu/gp106/xve_gp106.c index 077409c5..b47097e2 100644 --- a/drivers/gpu/nvgpu/gp106/xve_gp106.c +++ b/drivers/gpu/nvgpu/gp106/xve_gp106.c @@ -15,7 +15,6 @@ */ #include -#include #include #include diff --git a/drivers/gpu/nvgpu/include/nvgpu/bitops.h b/drivers/gpu/nvgpu/include/nvgpu/bitops.h new file mode 100644 index 00000000..0cd297b6 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/bitops.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ +#ifndef __NVGPU_BITOPS_H__ +#define __NVGPU_BITOPS_H__ + +#ifdef __KERNEL__ +#include +#endif + +#endif diff --git a/drivers/gpu/nvgpu/include/nvgpu/log.h b/drivers/gpu/nvgpu/include/nvgpu/log.h index f42fbedc..e16aaa92 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/log.h +++ b/drivers/gpu/nvgpu/include/nvgpu/log.h @@ -17,6 +17,9 @@ #ifndef __NVGPU_DEBUGGING_H__ #define __NVGPU_DEBUGGING_H__ +#include +#include + struct gk20a; enum nvgpu_log_type { diff --git a/drivers/gpu/nvgpu/vgpu/css_vgpu.c b/drivers/gpu/nvgpu/vgpu/css_vgpu.c index 142d9ce1..cca8766b 100644 --- a/drivers/gpu/nvgpu/vgpu/css_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/css_vgpu.c @@ -15,8 +15,6 @@ */ #if defined(CONFIG_GK20A_CYCLE_STATS) -#include -#include #include #include diff --git a/drivers/gpu/nvgpu/vgpu/gk20a/vgpu_gr_gk20a.c b/drivers/gpu/nvgpu/vgpu/gk20a/vgpu_gr_gk20a.c index 0ba8db56..23da728e 100644 --- a/drivers/gpu/nvgpu/vgpu/gk20a/vgpu_gr_gk20a.c +++ b/drivers/gpu/nvgpu/vgpu/gk20a/vgpu_gr_gk20a.c @@ -11,8 +11,6 @@ * more details. */ -#include - #include "gk20a/gk20a.h" #include "vgpu_gr_gk20a.h" diff --git a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c b/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c index 8e44eda4..945e24fc 100644 --- a/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c +++ b/drivers/gpu/nvgpu/vgpu/gm20b/vgpu_gr_gm20b.c @@ -11,8 +11,6 @@ * more details. */ -#include - #include "gk20a/gk20a.h" #include "vgpu_gr_gm20b.h" diff --git a/drivers/gpu/nvgpu/vgpu/sysfs_vgpu.c b/drivers/gpu/nvgpu/vgpu/sysfs_vgpu.c index d43a34aa..5a9f1fee 100644 --- a/drivers/gpu/nvgpu/vgpu/sysfs_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/sysfs_vgpu.c @@ -12,7 +12,6 @@ */ #include -#include #include #include "vgpu/vgpu.h" diff --git a/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c b/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c index 8a0276f7..701be345 100644 --- a/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/tsg_vgpu.c @@ -14,7 +14,6 @@ * along with this program. If not, see . */ -#include #include #include "gk20a/gk20a.h" -- cgit v1.2.2