[PATCH 13/14] drm/sun4i: Fix sparse warnings

2016-09-19 Thread Maxime Ripard
1;4402;0c
On Mon, Sep 19, 2016 at 04:33:54PM +0300, ville.syrjala at linux.intel.com 
wrote:
> From: Ville Syrjälä 
> 
> drm/sun4i/sun4i_tv.c:181:21: warning: symbol 'ntsc_video_levels' was not 
> declared. Should it be static?
> drm/sun4i/sun4i_tv.c:185:21: warning: symbol 'pal_video_levels' was not 
> declared. Should it be static?
> drm/sun4i/sun4i_tv.c:189:21: warning: symbol 'ntsc_burst_levels' was not 
> declared. Should it be static?
> drm/sun4i/sun4i_tv.c:193:21: warning: symbol 'pal_burst_levels' was not 
> declared. Should it be static?
> drm/sun4i/sun4i_tv.c:197:20: warning: symbol 'ntsc_color_gains' was not 
> declared. Should it be static?
> drm/sun4i/sun4i_tv.c:201:20: warning: symbol 'pal_color_gains' was not 
> declared. Should it be static?
> drm/sun4i/sun4i_tv.c:205:26: warning: symbol 'ntsc_resync_parameters' was not 
> declared. Should it be static?
> drm/sun4i/sun4i_tv.c:209:26: warning: symbol 'pal_resync_parameters' was not 
> declared. Should it be static?
> drm/sun4i/sun4i_tv.c:213:16: warning: symbol 'tv_modes' was not declared. 
> Should it be static?
> 
> Cc: Maxime Ripard 
> Signed-off-by: Ville Syrjälä 

Applied, thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-- next part --
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: 



[PATCH 13/14] drm/sun4i: Fix sparse warnings

2016-09-19 Thread ville.syrj...@linux.intel.com
From: Ville Syrjälä 

drm/sun4i/sun4i_tv.c:181:21: warning: symbol 'ntsc_video_levels' was not 
declared. Should it be static?
drm/sun4i/sun4i_tv.c:185:21: warning: symbol 'pal_video_levels' was not 
declared. Should it be static?
drm/sun4i/sun4i_tv.c:189:21: warning: symbol 'ntsc_burst_levels' was not 
declared. Should it be static?
drm/sun4i/sun4i_tv.c:193:21: warning: symbol 'pal_burst_levels' was not 
declared. Should it be static?
drm/sun4i/sun4i_tv.c:197:20: warning: symbol 'ntsc_color_gains' was not 
declared. Should it be static?
drm/sun4i/sun4i_tv.c:201:20: warning: symbol 'pal_color_gains' was not 
declared. Should it be static?
drm/sun4i/sun4i_tv.c:205:26: warning: symbol 'ntsc_resync_parameters' was not 
declared. Should it be static?
drm/sun4i/sun4i_tv.c:209:26: warning: symbol 'pal_resync_parameters' was not 
declared. Should it be static?
drm/sun4i/sun4i_tv.c:213:16: warning: symbol 'tv_modes' was not declared. 
Should it be static?

Cc: Maxime Ripard 
Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/sun4i/sun4i_tv.c | 38 +++---
 1 file changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c b/drivers/gpu/drm/sun4i/sun4i_tv.c
index b84147896294..3d69bd34f36c 100644
--- a/drivers/gpu/drm/sun4i/sun4i_tv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_tv.c
@@ -161,10 +161,10 @@ struct tv_mode {
booldac3_en;
booldac_bit25_en;

-   struct color_gains  *color_gains;
-   struct burst_levels *burst_levels;
-   struct video_levels *video_levels;
-   struct resync_parameters*resync_params;
+   const struct color_gains*color_gains;
+   const struct burst_levels   *burst_levels;
+   const struct video_levels   *video_levels;
+   const struct resync_parameters  *resync_params;
 };

 struct sun4i_tv {
@@ -178,39 +178,39 @@ struct sun4i_tv {
struct sun4i_drv*drv;
 };

-struct video_levels ntsc_video_levels = {
+static const struct video_levels ntsc_video_levels = {
.black = 282,   .blank = 240,
 };

-struct video_levels pal_video_levels = {
+static const struct video_levels pal_video_levels = {
.black = 252,   .blank = 252,
 };

-struct burst_levels ntsc_burst_levels = {
+static const struct burst_levels ntsc_burst_levels = {
.cb = 79,   .cr = 0,
 };

-struct burst_levels pal_burst_levels = {
+static const struct burst_levels pal_burst_levels = {
.cb = 40,   .cr = 40,
 };

-struct color_gains ntsc_color_gains = {
+static const struct color_gains ntsc_color_gains = {
.cb = 160,  .cr = 160,
 };

-struct color_gains pal_color_gains = {
+static const struct color_gains pal_color_gains = {
.cb = 224,  .cr = 224,
 };

-struct resync_parameters ntsc_resync_parameters = {
+static const struct resync_parameters ntsc_resync_parameters = {
.field = false, .line = 14, .pixel = 12,
 };

-struct resync_parameters pal_resync_parameters = {
+static const struct resync_parameters pal_resync_parameters = {
.field = true,  .line = 13, .pixel = 12,
 };

-struct tv_mode tv_modes[] = {
+static const struct tv_mode tv_modes[] = {
{
.name   = "NTSC",
.mode   = SUN4I_TVE_CFG0_RES_480i,
@@ -289,13 +289,13 @@ drm_connector_to_sun4i_tv(struct drm_connector *connector)
  * So far, it doesn't seem to be preserved when the mode is passed by
  * to mode_set for some reason.
  */
-static struct tv_mode *sun4i_tv_find_tv_by_mode(struct drm_display_mode *mode)
+static const struct tv_mode *sun4i_tv_find_tv_by_mode(const struct 
drm_display_mode *mode)
 {
int i;

/* First try to identify the mode by name */
for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
-   struct tv_mode *tv_mode = _modes[i];
+   const struct tv_mode *tv_mode = _modes[i];

DRM_DEBUG_DRIVER("Comparing mode %s vs %s",
 mode->name, tv_mode->name);
@@ -306,7 +306,7 @@ static struct tv_mode *sun4i_tv_find_tv_by_mode(struct 
drm_display_mode *mode)

/* Then by number of lines */
for (i = 0; i < ARRAY_SIZE(tv_modes); i++) {
-   struct tv_mode *tv_mode = _modes[i];
+   const struct tv_mode *tv_mode = _modes[i];

DRM_DEBUG_DRIVER("Comparing mode %s vs %s (X: %d vs %d)",
 mode->name, tv_mode->name,
@@ -319,7 +319,7 @@ static struct tv_mode *sun4i_tv_find_tv_by_mode(struct 
drm_display_mode *mode)
return NULL;
 }

-static void sun4i_tv_mode_to_drm_mode(struct tv_mode *tv_mode,
+static void sun4i_tv_mode_to_drm_mode(const struct tv_mode *tv_mode,
  struct drm_display_mode *mode)
 {
DRM_DEBUG_DRIVER("Creating mode %s\n", mode->name);
@@ -386,7 +386,7 @@ static void