drm: Constify TV mode names
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 31 Aug 2015 12:09:26 +0000 (15:09 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 8 Sep 2015 11:45:52 +0000 (13:45 +0200)
Make the mode names passed to drm_mode_create_tv_properties() const.

 drivers/gpu/drm/i2c/ch7006.ko:
-.rodata                       596
+.rodata                       664
-.data                        7064
+.data                        6992

 drivers/gpu/drm/nouveau/nouveau.ko:
-.rodata                      146808
+.rodata                      146904
-.data                        178624
+.data                        178528

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/i2c/ch7006_drv.c
drivers/gpu/drm/i2c/ch7006_mode.c
drivers/gpu/drm/i2c/ch7006_priv.h
drivers/gpu/drm/i915/intel_tv.c
drivers/gpu/drm/nouveau/dispnv04/tvmodesnv17.c
drivers/gpu/drm/nouveau/dispnv04/tvnv17.h
include/drm/drm_crtc.h

index 884690c8109427aa7764bc50143363ede71c00a7..474f328535a11d22e4d29471f4493cfee1b14861 100644 (file)
@@ -1519,7 +1519,7 @@ EXPORT_SYMBOL(drm_mode_create_dvi_i_properties);
  */
 int drm_mode_create_tv_properties(struct drm_device *dev,
                                  unsigned int num_modes,
-                                 char *modes[])
+                                 const char * const modes[])
 {
        struct drm_property *tv_selector;
        struct drm_property *tv_subconnector;
index 51fa323920299ebf5dc57c868054cde77955fcd0..d9a72c96e56cea529d404a92f21dfe0475f9dd2c 100644 (file)
@@ -119,8 +119,8 @@ static void ch7006_encoder_mode_set(struct drm_encoder *encoder,
        struct ch7006_encoder_params *params = &priv->params;
        struct ch7006_state *state = &priv->state;
        uint8_t *regs = state->regs;
-       struct ch7006_mode *mode = priv->mode;
-       struct ch7006_tv_norm_info *norm = &ch7006_tv_norms[priv->norm];
+       const struct ch7006_mode *mode = priv->mode;
+       const struct ch7006_tv_norm_info *norm = &ch7006_tv_norms[priv->norm];
        int start_active;
 
        ch7006_dbg(client, "\n");
@@ -226,7 +226,7 @@ static int ch7006_encoder_get_modes(struct drm_encoder *encoder,
                                    struct drm_connector *connector)
 {
        struct ch7006_priv *priv = to_ch7006_priv(encoder);
-       struct ch7006_mode *mode;
+       const struct ch7006_mode *mode;
        int n = 0;
 
        for (mode = ch7006_modes; mode->mode.clock; mode++) {
index 9b83574141a63243ba232b5c1ab0da0c1874e68f..f4dca53f57525107d8994361aad486f7a0ee97cd 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "ch7006_priv.h"
 
-char *ch7006_tv_norm_names[] = {
+const char * const ch7006_tv_norm_names[] = {
        [TV_NORM_PAL] = "PAL",
        [TV_NORM_PAL_M] = "PAL-M",
        [TV_NORM_PAL_N] = "PAL-N",
@@ -202,7 +202,7 @@ void ch7006_setup_levels(struct drm_encoder *encoder)
        struct i2c_client *client = drm_i2c_encoder_get_client(encoder);
        struct ch7006_priv *priv = to_ch7006_priv(encoder);
        uint8_t *regs = priv->state.regs;
-       struct ch7006_tv_norm_info *norm = &ch7006_tv_norms[priv->norm];
+       const struct ch7006_tv_norm_info *norm = &ch7006_tv_norms[priv->norm];
        int gain;
        int black_level;
 
index ce577841f9319850f2b87f06f8819955ceeeb371..cef6ce7c79d1726d0585d9c8f33f6aee617034a5 100644 (file)
@@ -106,7 +106,7 @@ extern int ch7006_debug;
 extern char *ch7006_tv_norm;
 extern int ch7006_scale;
 
-extern char *ch7006_tv_norm_names[];
+extern const char * const ch7006_tv_norm_names[];
 extern struct ch7006_tv_norm_info ch7006_tv_norms[];
 extern struct ch7006_mode ch7006_modes[];
 
index 0568ae6ec9dd2c945b0395a14305c281daf18be2..590ceabe2d5e320f66942dcd466f04e18c7b146b 100644 (file)
@@ -1579,7 +1579,7 @@ intel_tv_init(struct drm_device *dev)
        struct intel_encoder *intel_encoder;
        struct intel_connector *intel_connector;
        u32 tv_dac_on, tv_dac_off, save_tv_dac;
-       char *tv_format_names[ARRAY_SIZE(tv_modes)];
+       const char *tv_format_names[ARRAY_SIZE(tv_modes)];
        int i, initial_mode = 0;
 
        if ((I915_READ(TV_CTL) & TV_FUSE_STATE_MASK) == TV_FUSE_STATE_DISABLED)
@@ -1677,7 +1677,7 @@ intel_tv_init(struct drm_device *dev)
 
        /* Create TV properties then attach current values */
        for (i = 0; i < ARRAY_SIZE(tv_modes); i++)
-               tv_format_names[i] = (char *)tv_modes[i].name;
+               tv_format_names[i] = tv_modes[i].name;
        drm_mode_create_tv_properties(dev,
                                      ARRAY_SIZE(tv_modes),
                                      tv_format_names);
index 08c6f5e5061095f1d62f73676c7118c0e1ad4553..903c473d266ff5d32d71059abb6406bface455f0 100644 (file)
@@ -32,7 +32,7 @@
 #include "hw.h"
 #include "tvnv17.h"
 
-char *nv17_tv_norm_names[NUM_TV_NORMS] = {
+const char * const nv17_tv_norm_names[NUM_TV_NORMS] = {
        [TV_NORM_PAL] = "PAL",
        [TV_NORM_PAL_M] = "PAL-M",
        [TV_NORM_PAL_N] = "PAL-N",
index 459910b6bb3206980b4995e7685d657a5cd32d02..1b07521cde0de37ccfedd6114d66b7ad659770ee 100644 (file)
@@ -85,7 +85,7 @@ struct nv17_tv_encoder {
 #define to_tv_enc(x) container_of(nouveau_encoder(x),          \
                                  struct nv17_tv_encoder, base)
 
-extern char *nv17_tv_norm_names[NUM_TV_NORMS];
+extern const char * const nv17_tv_norm_names[NUM_TV_NORMS];
 
 extern struct nv17_tv_norm_params {
        enum {
index faaeff7db6847323a19b8112c64a9ccb3fcb5dfc..75f49c1ef8bb73c94f5d392a80aa5ffdebf8ae48 100644 (file)
@@ -1390,7 +1390,7 @@ extern int drm_property_add_enum(struct drm_property *property, int index,
 extern int drm_mode_create_dvi_i_properties(struct drm_device *dev);
 extern int drm_mode_create_tv_properties(struct drm_device *dev,
                                         unsigned int num_modes,
-                                        char *modes[]);
+                                        const char * const modes[]);
 extern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
 extern int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
 extern int drm_mode_create_dirty_info_property(struct drm_device *dev);