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

From: Arnd Bergmann
Date: Tue Aug 30 2016 - 16:10:55 EST


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 <baoyou.xie@xxxxxxxxxx>

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 <arnd@xxxxxxxx>

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

Arnd