[PATCH] drm/nouveau: silence warnings reported during builds with W=1

2016-09-04 Thread Ben Skeggs
On 08/31/2016 06:04 AM, Arnd Bergmann wrote:
> On Tuesday 30 August 2016, Baoyou Xie wrote:
>> 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 
> 
> The patch looks very good, and this is better than one patch per file. I 
> would personally
> do this as two patches, as you are touching a number of files and are doing 
> two separate
> things here. As a rule of thumb, when the changelog text mentions two or more 
> things
> that the patch does, the patch should be split up so that each part does one 
> thing.
> After you do that, it also becomes easier to write a good subject line like 
> "mark
> function as static" and "add missing includes", which tells you more about 
> the patch
> than "silence warnings".
> 
> It's quite likely that the nouveau maintainers are less picky than I am 
> though, so
> if they want to apply the patch as-is
> 
> Acked-by: Arnd Bergmann 
> 
> Otherwise please split and resend in a few days, in case there are other 
> comments
This patch does indeed look a lot better than the previous series.  I
would also prefer the patch to be split into two as suggested by Arnd.

Other than that, I'm very happy to take the patch.  Thank you for your work!

Ben.

> that need to be addressed.
> 
>   Arnd
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: 



[PATCH] drm/nouveau: silence warnings reported during builds with W=1

2016-08-31 Thread Baoyou Xie
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(>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)
return 

[PATCH] drm/nouveau: silence warnings reported during builds with W=1

2016-08-30 Thread Arnd Bergmann
On Tuesday 30 August 2016, Baoyou Xie wrote:
> 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 

The patch looks very good, and this is better than one patch per file. I would 
personally
do this as two patches, as you are touching a number of files and are doing two 
separate
things here. As a rule of thumb, when the changelog text mentions two or more 
things
that the patch does, the patch should be split up so that each part does one 
thing.
After you do that, it also becomes easier to write a good subject line like 
"mark
function as static" and "add missing includes", which tells you more about the 
patch
than "silence warnings".

It's quite likely that the nouveau maintainers are less picky than I am though, 
so
if they want to apply the patch as-is

Acked-by: Arnd Bergmann 

Otherwise please split and resend in a few days, in case there are other 
comments
that need to be addressed.

Arnd