drm: remove `const` attribute to hint at caller that they now own the memory
authorEric Engestrom <eric.engestrom@imgtec.com>
Mon, 15 Aug 2016 15:29:55 +0000 (16:29 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 16 Aug 2016 12:06:53 +0000 (14:06 +0200)
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
12 files changed:
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_fourcc.c
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/intel_atomic_plane.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/radeon/atombios_crtc.c
include/drm/drm_fourcc.h

index 0bf895920fbc275ec623d1302b358a6d9fe402f2..741da36cd8b6e6ef819cde0038e8c3d684929efb 100644 (file)
@@ -2071,7 +2071,7 @@ static int dce_v10_0_crtc_do_set_base(struct drm_crtc *crtc,
        u32 tmp, viewport_w, viewport_h;
        int r;
        bool bypass_lut = false;
-       const char *format_name;
+       char *format_name;
 
        /* no fb bound */
        if (!atomic && !crtc->primary->fb) {
index 1558a974ad0049e03af325818a076dadc61d6dc9..2282eb60aba6ee04c0fdfdf5b4b4708c961c6625 100644 (file)
@@ -2046,7 +2046,7 @@ static int dce_v11_0_crtc_do_set_base(struct drm_crtc *crtc,
        u32 tmp, viewport_w, viewport_h;
        int r;
        bool bypass_lut = false;
-       const char *format_name;
+       char *format_name;
 
        /* no fb bound */
        if (!atomic && !crtc->primary->fb) {
index 71a037546daed46e17114aa51895d953b700d49b..8b7ad345771f67b2c8d05b8b717703b524b41145 100644 (file)
@@ -1952,7 +1952,7 @@ static int dce_v8_0_crtc_do_set_base(struct drm_crtc *crtc,
        u32 viewport_w, viewport_h;
        int r;
        bool bypass_lut = false;
-       const char *format_name;
+       char *format_name;
 
        /* no fb bound */
        if (!atomic && !crtc->primary->fb) {
index 087391f08a69ac0d2048e1157284b4a8c10ee7b5..5cb2e22d5d55e406dc011fefbe6c29d8dcf52d0a 100644 (file)
@@ -837,7 +837,7 @@ static int drm_atomic_plane_check(struct drm_plane *plane,
        /* Check whether this plane supports the fb pixel format. */
        ret = drm_plane_check_pixel_format(plane, state->fb->pixel_format);
        if (ret) {
-               const char *format_name = drm_get_format_name(state->fb->pixel_format);
+               char *format_name = drm_get_format_name(state->fb->pixel_format);
                DRM_DEBUG_ATOMIC("Invalid pixel format %s\n", format_name);
                kfree(format_name);
                return ret;
index f4e3ebebe79acec5e6a9356bebb0f905080ca344..93ea5ddd1e49b4e9699520c04e321b90540727d9 100644 (file)
@@ -2592,7 +2592,7 @@ static int __setplane_internal(struct drm_plane *plane,
        /* Check whether this plane supports the fb pixel format. */
        ret = drm_plane_check_pixel_format(plane, fb->pixel_format);
        if (ret) {
-               const char *format_name = drm_get_format_name(fb->pixel_format);
+               char *format_name = drm_get_format_name(fb->pixel_format);
                DRM_DEBUG_KMS("Invalid pixel format %s\n", format_name);
                kfree(format_name);
                goto out;
@@ -2903,7 +2903,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
                        ret = drm_plane_check_pixel_format(crtc->primary,
                                                           fb->pixel_format);
                        if (ret) {
-                               const char *format_name = drm_get_format_name(fb->pixel_format);
+                               char *format_name = drm_get_format_name(fb->pixel_format);
                                DRM_DEBUG_KMS("Invalid pixel format %s\n", format_name);
                                kfree(format_name);
                                goto out;
@@ -3281,7 +3281,7 @@ int drm_mode_addfb(struct drm_device *dev,
 static int format_check(const struct drm_mode_fb_cmd2 *r)
 {
        uint32_t format = r->pixel_format & ~DRM_FORMAT_BIG_ENDIAN;
-       const char *format_name;
+       char *format_name;
 
        switch (format) {
        case DRM_FORMAT_C8:
@@ -3359,7 +3359,7 @@ static int framebuffer_check(const struct drm_mode_fb_cmd2 *r)
 
        ret = format_check(r);
        if (ret) {
-               const char *format_name = drm_get_format_name(r->pixel_format);
+               char *format_name = drm_get_format_name(r->pixel_format);
                DRM_DEBUG_KMS("bad framebuffer format %s\n", format_name);
                kfree(format_name);
                return ret;
index d8f65c4fadf711cf3333ea7c0631d04b3be641b8..c81546c15c939a05f80ae62e4a07acd2fb08192b 100644 (file)
@@ -42,7 +42,7 @@ static char printable_char(int c)
  * Note that the buffer returned by this function is owned by the caller
  * and will need to be freed using kfree().
  */
-const char *drm_get_format_name(uint32_t format)
+char *drm_get_format_name(uint32_t format)
 {
        char *buf = kmalloc(32, GFP_KERNEL);
 
@@ -71,7 +71,7 @@ EXPORT_SYMBOL(drm_get_format_name);
 void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
                          int *bpp)
 {
-       const char *format_name;
+       char *format_name;
 
        switch (format) {
        case DRM_FORMAT_C8:
index ac7fa02b341f6cf8cd14d81918557198c3ddf91d..eaa3df75fc5c2de11f8dc07d1e9bd0a45b7db8d5 100644 (file)
@@ -608,7 +608,7 @@ static void ade_rdma_set(void __iomem *base, struct drm_framebuffer *fb,
                         u32 ch, u32 y, u32 in_h, u32 fmt)
 {
        struct drm_gem_cma_object *obj = drm_fb_cma_get_gem_obj(fb, 0);
-       const char *format_name;
+       char *format_name;
        u32 reg_ctrl, reg_addr, reg_size, reg_stride, reg_space, reg_en;
        u32 stride = fb->pitches[0];
        u32 addr = (u32)obj->paddr + y * stride;
index 120869e7622d3f7c5f09f53815738bb385889828..64e41cf74d11473b5121936bbc0342918dff6329 100644 (file)
@@ -3113,7 +3113,7 @@ static void intel_plane_info(struct seq_file *m, struct intel_crtc *intel_crtc)
        for_each_intel_plane_on_crtc(dev, intel_crtc, intel_plane) {
                struct drm_plane_state *state;
                struct drm_plane *plane = &intel_plane->base;
-               const char *format_name;
+               char *format_name;
 
                if (!plane->state) {
                        seq_puts(m, "plane->state is NULL!\n");
index 98288d87c2cec29ce64c3d7aa29b884a41ff685a..b82de3072d4f802653127e46a2e141871d2d0e94 100644 (file)
@@ -143,7 +143,7 @@ static int intel_plane_atomic_check(struct drm_plane *plane,
                crtc_state->base.enable ? crtc_state->pipe_src_h : 0;
 
        if (state->fb && intel_rotation_90_or_270(state->rotation)) {
-               const char *format_name;
+               char *format_name;
                if (!(state->fb->modifier[0] == I915_FORMAT_MOD_Y_TILED ||
                        state->fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED)) {
                        DRM_DEBUG_KMS("Y/Yf tiling required for 90/270!\n");
index acc1ba36c5faadd9ea90eb0dacdbc836cd18a26e..3902e57d9df5b275c2a6af8d168dde8dbe601a7d 100644 (file)
@@ -12258,7 +12258,7 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
 
        DRM_DEBUG_KMS("planes on this crtc\n");
        list_for_each_entry(plane, &dev->mode_config.plane_list, head) {
-               const char *format_name;
+               char *format_name;
                intel_plane = to_intel_plane(plane);
                if (intel_plane->pipe != crtc->pipe)
                        continue;
@@ -14915,7 +14915,7 @@ static int intel_framebuffer_init(struct drm_device *dev,
        unsigned int aligned_height;
        int ret;
        u32 pitch_limit, stride_alignment;
-       const char *format_name;
+       char *format_name;
 
        WARN_ON(!mutex_is_locked(&dev->struct_mutex));
 
index 981ca3f5842ebde8d266578034d75b1114330190..a89c4803aced8039cc53d7f60136ef990c899291 100644 (file)
@@ -1154,7 +1154,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
        u32 tmp, viewport_w, viewport_h;
        int r;
        bool bypass_lut = false;
-       const char *format_name;
+       char *format_name;
 
        /* no fb bound */
        if (!atomic && !crtc->primary->fb) {
@@ -1471,7 +1471,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
        u32 viewport_w, viewport_h;
        int r;
        bool bypass_lut = false;
-       const char *format_name;
+       char *format_name;
 
        /* no fb bound */
        if (!atomic && !crtc->primary->fb) {
index 030d22d3ed967375f457544d58ecefea2f96fc26..b106337de1bf0f7f18bece9dac660bb741cbcf27 100644 (file)
@@ -32,6 +32,6 @@ int drm_format_horz_chroma_subsampling(uint32_t format);
 int drm_format_vert_chroma_subsampling(uint32_t format);
 int drm_format_plane_width(int width, uint32_t format, int plane);
 int drm_format_plane_height(int height, uint32_t format, int plane);
-const char *drm_get_format_name(uint32_t format) __malloc;
+char *drm_get_format_name(uint32_t format) __malloc;
 
 #endif /* __DRM_FOURCC_H__ */