We get some warnings when building kernel with W=1:
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c:222:1: warning: no previous
prototype for 'gf117_grctx_generate_main' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c:255:1: warning: no previous
prototype for 'nv50_grctx_fill' [-Wmissing-prototypes]
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c:265:1: warning: no previous
prototype for 'nv50_grctx_init' [-Wmissing-prototypes]
In fact, some functions are only used in the file in which they
are declared and don't need a declaration, but can be made static.
and others are declared in the header files, but need to add
missing header dependencies.
Signed-off-by: Baoyou Xie
---
drivers/gpu/drm/nouveau/dispnv04/overlay.c | 2 +-
drivers/gpu/drm/nouveau/nouveau_display.c | 2 +-
drivers/gpu/drm/nouveau/nv10_fence.c| 2 +-
drivers/gpu/drm/nouveau/nvkm/core/firmware.c| 1 +
drivers/gpu/drm/nouveau/nvkm/engine/device/user.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c | 8
drivers/gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chang84.c | 4 ++--
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgf117.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxgm107.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/engine/gr/ctxnv50.c| 2 ++
drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c | 4 ++--
drivers/gpu/drm/nouveau/nvkm/engine/gr/gm107.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/engine/pm/base.c | 4 ++--
drivers/gpu/drm/nouveau/nvkm/subdev/bios/fan.c | 4 ++--
drivers/gpu/drm/nouveau/nvkm/subdev/clk/gt215.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramgt215.c | 8
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr2.c | 1 +
drivers/gpu/drm/nouveau/nvkm/subdev/fb/sddr3.c | 1 +
drivers/gpu/drm/nouveau/nvkm/subdev/gpio/gk104.c| 2 +-
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm200.c | 2 +-
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gk104.c| 4 ++--
drivers/gpu/drm/nouveau/nvkm/subdev/volt/gpio.c | 2 ++
23 files changed, 36 insertions(+), 29 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv04/overlay.c
b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
index ec444ea..a79514d 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/overlay.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/overlay.c
@@ -33,7 +33,7 @@
#include "nouveau_connector.h"
#include "nouveau_display.h"
#include "nvreg.h"
-
+#include "disp.h"
struct nouveau_plane {
struct drm_plane base;
diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c
b/drivers/gpu/drm/nouveau/nouveau_display.c
index afbf557..b60ee21 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -92,7 +92,7 @@ calc(int blanks, int blanke, int total, int line)
return line;
}
-int
+static int
nouveau_display_scanoutpos_head(struct drm_crtc *crtc, int *vpos, int *hpos,
ktime_t *stime, ktime_t *etime)
{
diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c
b/drivers/gpu/drm/nouveau/nv10_fence.c
index 4e3de34..619f79d 100644
--- a/drivers/gpu/drm/nouveau/nv10_fence.c
+++ b/drivers/gpu/drm/nouveau/nv10_fence.c
@@ -66,7 +66,7 @@ nv10_fence_context_del(struct nouveau_channel *chan)
nouveau_fence_context_free(&fctx->base);
}
-int
+static int
nv10_fence_context_new(struct nouveau_channel *chan)
{
struct nv10_fence_chan *fctx;
diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
index 34ecd4a..058ff46 100644
--- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
+++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
#include
+#include
/**
* nvkm_firmware_get - load firmware from the official nvidia/chip/ directory
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
index 79a8f71..513ee6b 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/user.c
@@ -326,7 +326,7 @@ nvkm_udevice = {
.sclass = nvkm_udevice_child_get,
};
-int
+static int
nvkm_udevice_new(const struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
index dd2953b..26990d4 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/channv50.c
@@ -153,7 +153,7 @@ nv50_disp_chan_uevent = {
.fini = nv50_disp_chan_uevent_fini,
};
-int
+static int
nv50_disp_chan_rd32(struct nvkm_object *object, u64 addr, u32 *data)
{
struct nv50_disp_chan *chan = nv50_disp_chan(object);
@@ -163,7 +163,7 @@ nv50_disp_chan_rd32(struct nvkm_object *object, u64 addr,
u32 *data)