diff mbox

[01/85] drivers: gpu: Include appropriate header file in drm_usb.c

Message ID b21c9d47bbb72f2134540b852c908a2080f1ed1d.1389018324.git.rashika.kheria@gmail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Rashika Jan. 6, 2014, 2:28 p.m. UTC
Include appropriate header file include/drm/drm_usb.h in drm/drm_usb.c
because functions drm_get_usb_dev(), drm_usb_init() and drm_usb_exit()
have their prototype declarations in the header file.

This eliminates the following warning in drm/drm_usb.c:
drivers/gpu/drm/drm_usb.c:5:5: warning: no previous prototype for
‘drm_get_usb_dev’ [-Wmissing-prototypes]
drivers/gpu/drm/drm_usb.c:61:5: warning: no previous prototype for
‘drm_usb_init’ [-Wmissing-prototypes]
drivers/gpu/drm/drm_usb.c:75:6: warning: no previous prototype for
‘drm_usb_exit’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
---
 drivers/gpu/drm/drm_usb.c |    1 +
 1 file changed, 1 insertion(+)

Comments

Maarten Lankhorst Jan. 6, 2014, 3:14 p.m. UTC | #1
op 06-01-14 16:11, Rashika Kheria schreef:
> Mark function nvd7_grctx_generate_main() as static in
> drm/nouveau/core/engine/graph/ctxnvd7.c because it is not used outside
> this file.
>
> This eliminates the following warning in
> drm/nouveau/core/engine/graph/ctxnvd7.c:
> drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c:215:1: warning: no previous prototype for ‘nvd7_grctx_generate_main’ [-Wmissing-prototypes]
>
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
>  .../gpu/drm/nouveau/core/engine/graph/ctxnvd7.c    |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c
> index c4740d5..0e126ce 100644
> --- a/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c
> +++ b/drivers/gpu/drm/nouveau/core/engine/graph/ctxnvd7.c
> @@ -211,7 +211,7 @@ nvd7_grctx_generate_mods(struct nvc0_graph_priv *priv, struct nvc0_grctx *info)
>  	mmio_list(0x17e91c, 0x03060609, 0, 0); /* different from kepler */
>  }
>  
> -void
> +static void
>  nvd7_grctx_generate_main(struct nvc0_graph_priv *priv, struct nvc0_grctx *info)
>  {
>  	struct nvc0_grctx_oclass *oclass = (void *)nv_engine(priv)->cclass;
Acked-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

Building with -Wmissing-prototypes? Good luck fixing radeon! it's a mess. :(
Deucher, Alexander Jan. 6, 2014, 3:43 p.m. UTC | #2
> -----Original Message-----

> From: Rashika Kheria [mailto:rashika.kheria@gmail.com]

> Sent: Monday, January 06, 2014 10:38 AM

> To: linux-kernel@vger.kernel.org

> Cc: David Airlie; Deucher, Alexander; Rashika Kheria; Daenzer, Michel;

> Koenig, Christian; Dave Airlie; Rafa? Mi?ecki; Damien Lespiau; dri-

> devel@lists.freedesktop.org; josh@joshtriplett.org

> Subject: [PATCH 32/85] drivers: gpu: Move prototype declarations to header

> file atombios.h

> 

> Move prototype declarations of functions radeon_atom_get_tv_timings()

> and radeon_atombios_connected_scratch_regs() to header file

> drm/radeon/atombios.h because they are used by more than one file.

> 

> Include the header file in atombios_encoders.c, radeon_atombios.c and

> radeon_connectors.c because they use the function whose prototype

> declarations are present in it.


It would be better to add these to radeon_mode.h for consistency with combios.

Alex

> 

> This eliminates the following warnings in drm/radeon/radeon_atombios.c:

> drivers/gpu/drm/radeon/radeon_atombios.c:1766:6: warning: no previous

> prototype for ‘radeon_atom_get_tv_timings’ [-Wmissing-prototypes]

> drivers/gpu/drm/radeon/radeon_atombios.c:4012:1: warning: no previous

> prototype for ‘radeon_atombios_connected_scratch_regs’ [-Wmissing-

> prototypes]

> 

> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>

> Reviewed-by: Josh Triplett <josh@joshtriplett.org>

> ---

>  drivers/gpu/drm/radeon/atombios.h          |    8 ++++++++

>  drivers/gpu/drm/radeon/atombios_encoders.c |    6 +-----

>  drivers/gpu/drm/radeon/radeon_atombios.c   |    1 +

>  drivers/gpu/drm/radeon/radeon_connectors.c |    5 +----

>  4 files changed, 11 insertions(+), 9 deletions(-)

> 

> diff --git a/drivers/gpu/drm/radeon/atombios.h

> b/drivers/gpu/drm/radeon/atombios.h

> index 92be50c..72a3aa7c 100644

> --- a/drivers/gpu/drm/radeon/atombios.h

> +++ b/drivers/gpu/drm/radeon/atombios.h

> @@ -193,6 +193,14 @@

>  #define	OFFSET_TO_GET_ATOMBIOS_STRINGS_NUMBER

> 	0x002f

>  #define	OFFSET_TO_GET_ATOMBIOS_STRINGS_START

> 	0x006e

> 

> +bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,

> +				struct drm_display_mode *mode);

> +void

> +radeon_atombios_connected_scratch_regs(struct drm_connector

> *connector,

> +				       struct drm_encoder *encoder,

> +				       bool connected);

> +

> +

>  /* Common header for all ROM Data tables.

>    Every table pointed  _ATOM_MASTER_DATA_TABLE has this common

> header.

>    And the pointer actually points to this header. */

> diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c

> b/drivers/gpu/drm/radeon/atombios_encoders.c

> index a42d615..641298d 100644

> --- a/drivers/gpu/drm/radeon/atombios_encoders.c

> +++ b/drivers/gpu/drm/radeon/atombios_encoders.c

> @@ -28,6 +28,7 @@

>  #include <drm/radeon_drm.h>

>  #include "radeon.h"

>  #include "atom.h"

> +#include "atombios.h"

>  #include <linux/backlight.h>

> 

>  extern int atom_debug;

> @@ -283,11 +284,6 @@ static void radeon_atom_backlight_exit(struct

> radeon_encoder *encoder)

> 

>  #endif

> 

> -/* evil but including atombios.h is much worse */

> -bool radeon_atom_get_tv_timings(struct radeon_device *rdev, int index,

> -				struct drm_display_mode *mode);

> -

> -

>  static inline bool radeon_encoder_is_digital(struct drm_encoder *encoder)

>  {

>  	struct radeon_encoder *radeon_encoder =

> to_radeon_encoder(encoder);

> diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c

> b/drivers/gpu/drm/radeon/radeon_atombios.c

> index 5c39bf7..39f1fd6 100644

> --- a/drivers/gpu/drm/radeon/radeon_atombios.c

> +++ b/drivers/gpu/drm/radeon/radeon_atombios.c

> @@ -28,6 +28,7 @@

>  #include "radeon.h"

> 

>  #include "atom.h"

> +#include "atombios.h"

>  #include "atom-bits.h"

> 

>  /* from radeon_encoder.c */

> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c

> b/drivers/gpu/drm/radeon/radeon_connectors.c

> index 20a768a..9070487 100644

> --- a/drivers/gpu/drm/radeon/radeon_connectors.c

> +++ b/drivers/gpu/drm/radeon/radeon_connectors.c

> @@ -30,6 +30,7 @@

>  #include <drm/radeon_drm.h>

>  #include "radeon.h"

>  #include "atom.h"

> +#include "atombios.h"

> 

>  #include <linux/pm_runtime.h>

> 

> @@ -37,10 +38,6 @@ extern void

>  radeon_combios_connected_scratch_regs(struct drm_connector

> *connector,

>  				      struct drm_encoder *encoder,

>  				      bool connected);

> -extern void

> -radeon_atombios_connected_scratch_regs(struct drm_connector

> *connector,

> -				       struct drm_encoder *encoder,

> -				       bool connected);

> 

>  void radeon_connector_hotplug(struct drm_connector *connector)

>  {

> --

> 1.7.9.5

>
Patrik Jakobsson Jan. 6, 2014, 4:17 p.m. UTC | #3
On Mon, Jan 6, 2014 at 4:02 PM, Rashika Kheria <rashika.kheria@gmail.com> wrote:
> Mark function cdv_intel_fixed_panel_mode() as static in
> drm/gma500/cdv_intel_dp.c because it is not used outside this file.
>
> This eliminates the following warning in drm/gma500/cdv_intel_dp.c:
> drivers/gpu/drm/gma500/cdv_intel_dp.c:680:6: warning: no previous prototype for ‘cdv_intel_fixed_panel_mode’ [-Wmissing-prototypes]
>
> Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
> Reviewed-by: Josh Triplett <josh@joshtriplett.org>
> ---
>  drivers/gpu/drm/gma500/cdv_intel_dp.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> index f88a181..36975bd 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> @@ -677,7 +677,7 @@ cdv_intel_dp_i2c_init(struct gma_connector *connector,
>         return ret;
>  }
>
> -void cdv_intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
> +static void cdv_intel_fixed_panel_mode(struct drm_display_mode *fixed_mode,
>         struct drm_display_mode *adjusted_mode)
>  {
>         adjusted_mode->hdisplay = fixed_mode->hdisplay;
> --
> 1.7.9.5
>

Pushed to gma500-next

Thanks
Patrik
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_usb.c b/drivers/gpu/drm/drm_usb.c
index b179b70..7b8068b 100644
--- a/drivers/gpu/drm/drm_usb.c
+++ b/drivers/gpu/drm/drm_usb.c
@@ -1,4 +1,5 @@ 
 #include <drm/drmP.h>
+#include <drm/drm_usb.h>
 #include <linux/usb.h>
 #include <linux/module.h>