drm/qxl: make lots of things static.
authorDave Airlie <airlied@redhat.com>
Tue, 16 Apr 2013 03:24:25 +0000 (13:24 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 16 Apr 2013 03:33:36 +0000 (13:33 +1000)
/usr/lib/gcc/x86_64-linux-gnu/4.7/include/stddef.h:414:9: sparse: preprocessor token offsetof redefined
include/linux/stddef.h:17:9: this was the original definition
>> drivers/gpu/drm/qxl/qxl_drv.c:49:5: sparse: symbol 'qxl_modeset' was not declared. Should it be static?

Reported-by: kbuild test robot.
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/qxl/qxl_cmd.c
drivers/gpu/drm/qxl/qxl_display.c
drivers/gpu/drm/qxl/qxl_drv.c
drivers/gpu/drm/qxl/qxl_fb.c
drivers/gpu/drm/qxl/qxl_gem.c
drivers/gpu/drm/qxl/qxl_ioctl.c
drivers/gpu/drm/qxl/qxl_kms.c
drivers/gpu/drm/qxl/qxl_release.c
drivers/gpu/drm/qxl/qxl_ttm.c

index 804b411..736365e 100644 (file)
@@ -144,8 +144,8 @@ int qxl_ring_push(struct qxl_ring *ring,
        return 0;
 }
 
-bool qxl_ring_pop(struct qxl_ring *ring,
-                 void *element)
+static bool qxl_ring_pop(struct qxl_ring *ring,
+                        void *element)
 {
        volatile struct qxl_ring_header *header = &(ring->ring->header);
        volatile uint8_t *ring_elt;
@@ -169,23 +169,6 @@ bool qxl_ring_pop(struct qxl_ring *ring,
        return true;
 }
 
-void qxl_ring_wait_idle(struct qxl_ring *ring)
-{
-       struct qxl_ring_header *header = &(ring->ring->header);
-       unsigned long flags;
-
-       spin_lock_irqsave(&ring->lock, flags);
-       if (ring->ring->header.cons < ring->ring->header.prod) {
-               header->notify_on_cons = header->prod;
-               mb();
-               spin_unlock_irqrestore(&ring->lock, flags);
-               wait_event_interruptible(*ring->push_event,
-                                        qxl_check_idle(ring));
-               spin_lock_irqsave(&ring->lock, flags);
-       }
-       spin_unlock_irqrestore(&ring->lock, flags);
-}
-
 int
 qxl_push_command_ring_release(struct qxl_device *qdev, struct qxl_release *release,
                              uint32_t type, bool interruptible)
@@ -609,7 +592,7 @@ retry:
        return ret;
 }
 
-void qxl_surface_evict_locked(struct qxl_device *qdev, struct qxl_bo *surf, bool do_update_area)
+static void qxl_surface_evict_locked(struct qxl_device *qdev, struct qxl_bo *surf, bool do_update_area)
 {
        /* no need to update area if we are just freeing the surface normally */
        if (do_update_area)
index c80ddfe..567a532 100644 (file)
@@ -413,11 +413,11 @@ static void qxl_user_framebuffer_destroy(struct drm_framebuffer *fb)
        kfree(qxl_fb);
 }
 
-int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
-                                 struct drm_file *file_priv,
-                                 unsigned flags, unsigned color,
-                                 struct drm_clip_rect *clips,
-                                 unsigned num_clips)
+static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
+                                        struct drm_file *file_priv,
+                                        unsigned flags, unsigned color,
+                                        struct drm_clip_rect *clips,
+                                        unsigned num_clips)
 {
        /* TODO: vmwgfx where this was cribbed from had locking. Why? */
        struct qxl_framebuffer *qxl_fb = to_qxl_framebuffer(fb);
@@ -619,7 +619,7 @@ static void qxl_crtc_commit(struct drm_crtc *crtc)
        DRM_DEBUG("\n");
 }
 
-void qxl_crtc_load_lut(struct drm_crtc *crtc)
+static void qxl_crtc_load_lut(struct drm_crtc *crtc)
 {
        DRM_DEBUG("\n");
 }
@@ -633,7 +633,7 @@ static const struct drm_crtc_helper_funcs qxl_crtc_helper_funcs = {
        .load_lut = qxl_crtc_load_lut,
 };
 
-int qdev_crtc_init(struct drm_device *dev, int num_crtc)
+static int qdev_crtc_init(struct drm_device *dev, int num_crtc)
 {
        struct qxl_crtc *qxl_crtc;
 
@@ -764,7 +764,7 @@ static int qxl_conn_mode_valid(struct drm_connector *connector,
        return MODE_OK;
 }
 
-struct drm_encoder *qxl_best_encoder(struct drm_connector *connector)
+static struct drm_encoder *qxl_best_encoder(struct drm_connector *connector)
 {
        struct qxl_output *qxl_output =
                drm_connector_to_qxl_output(connector);
@@ -855,7 +855,7 @@ static const struct drm_encoder_funcs qxl_enc_funcs = {
        .destroy = qxl_enc_destroy,
 };
 
-int qdev_output_init(struct drm_device *dev, int num_output)
+static int qdev_output_init(struct drm_device *dev, int num_output)
 {
        struct qxl_output *qxl_output;
        struct drm_connector *connector;
index d337da0..aa291d8 100644 (file)
@@ -46,7 +46,7 @@ static DEFINE_PCI_DEVICE_TABLE(pciidlist) = {
 };
 MODULE_DEVICE_TABLE(pci, pciidlist);
 
-int qxl_modeset = -1;
+static int qxl_modeset = -1;
 
 MODULE_PARM_DESC(modeset, "Disable/Enable modesetting");
 module_param_named(modeset, qxl_modeset, int, 0400);
index 232b52b..b3c5127 100644 (file)
@@ -159,7 +159,7 @@ static void qxl_deferred_io(struct fb_info *info,
 };
 
 
-struct fb_deferred_io qxl_defio = {
+static struct fb_deferred_io qxl_defio = {
        .delay          = QXL_DIRTY_DELAY,
        .deferred_io    = qxl_deferred_io,
 };
index adc1ee2..a235693 100644 (file)
@@ -127,35 +127,6 @@ void qxl_gem_object_unpin(struct drm_gem_object *obj)
        }
 }
 
-int qxl_gem_set_domain(struct drm_gem_object *gobj,
-                         uint32_t rdomain, uint32_t wdomain)
-{
-       struct qxl_bo *qobj;
-       uint32_t domain;
-       int r;
-
-       /* FIXME: reeimplement */
-       qobj = gobj->driver_private;
-       /* work out where to validate the buffer to */
-       domain = wdomain;
-       if (!domain)
-               domain = rdomain;
-       if (!domain) {
-               /* Do nothings */
-               pr_warn("Set domain withou domain !\n");
-               return 0;
-       }
-       if (domain == QXL_GEM_DOMAIN_CPU) {
-               /* Asking for cpu access wait for object idle */
-               r = qxl_bo_wait(qobj, NULL, false);
-               if (r) {
-                       pr_err("Failed to wait for object !\n");
-                       return r;
-               }
-       }
-       return 0;
-}
-
 int qxl_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_priv)
 {
        return 0;
index 83ca4f7..cec6172 100644 (file)
@@ -30,8 +30,8 @@
  * TODO: allocating a new gem(in qxl_bo) for each request.
  * This is wasteful since bo's are page aligned.
  */
-int qxl_alloc_ioctl(struct drm_device *dev, void *data,
-                   struct drm_file *file_priv)
+static int qxl_alloc_ioctl(struct drm_device *dev, void *data,
+                          struct drm_file *file_priv)
 {
        struct qxl_device *qdev = dev->dev_private;
        struct drm_qxl_alloc *qxl_alloc = data;
@@ -58,8 +58,8 @@ int qxl_alloc_ioctl(struct drm_device *dev, void *data,
        return 0;
 }
 
-int qxl_map_ioctl(struct drm_device *dev, void *data,
-                 struct drm_file *file_priv)
+static int qxl_map_ioctl(struct drm_device *dev, void *data,
+                        struct drm_file *file_priv)
 {
        struct qxl_device *qdev = dev->dev_private;
        struct drm_qxl_map *qxl_map = data;
@@ -101,9 +101,9 @@ apply_surf_reloc(struct qxl_device *qdev, struct qxl_bo *dst, uint64_t dst_off,
 }
 
 /* return holding the reference to this object */
-struct qxl_bo *qxlhw_handle_to_bo(struct qxl_device *qdev,
-                                 struct drm_file *file_priv, uint64_t handle,
-                                 struct qxl_reloc_list *reloc_list)
+static struct qxl_bo *qxlhw_handle_to_bo(struct qxl_device *qdev,
+                                        struct drm_file *file_priv, uint64_t handle,
+                                        struct qxl_reloc_list *reloc_list)
 {
        struct drm_gem_object *gobj;
        struct qxl_bo *qobj;
@@ -129,8 +129,8 @@ struct qxl_bo *qxlhw_handle_to_bo(struct qxl_device *qdev,
  * However, the command as passed from user space must *not* contain the initial
  * QXLReleaseInfo struct (first XXX bytes)
  */
-int qxl_execbuffer_ioctl(struct drm_device *dev, void *data,
-                        struct drm_file *file_priv)
+static int qxl_execbuffer_ioctl(struct drm_device *dev, void *data,
+                               struct drm_file *file_priv)
 {
        struct qxl_device *qdev = dev->dev_private;
        struct drm_qxl_execbuffer *execbuffer = data;
@@ -266,8 +266,8 @@ int qxl_execbuffer_ioctl(struct drm_device *dev, void *data,
        return 0;
 }
 
-int qxl_update_area_ioctl(struct drm_device *dev, void *data,
-                         struct drm_file *file)
+static int qxl_update_area_ioctl(struct drm_device *dev, void *data,
+                                struct drm_file *file)
 {
        struct qxl_device *qdev = dev->dev_private;
        struct drm_qxl_update_area *update_area = data;
index 036e0de..85127ed 100644 (file)
@@ -230,7 +230,7 @@ int qxl_device_init(struct qxl_device *qdev,
        return 0;
 }
 
-void qxl_device_fini(struct qxl_device *qdev)
+static void qxl_device_fini(struct qxl_device *qdev)
 {
        if (qdev->current_release_bo[0])
                qxl_bo_unref(&qdev->current_release_bo[0]);
index 1600781..c4267c7 100644 (file)
@@ -117,8 +117,8 @@ qxl_release_add_res(struct qxl_device *qdev, struct qxl_release *release,
        release->bos[release->bo_count++] = qxl_bo_ref(bo);
 }
 
-int qxl_release_bo_alloc(struct qxl_device *qdev,
-                        struct qxl_bo **bo)
+static int qxl_release_bo_alloc(struct qxl_device *qdev,
+                               struct qxl_bo **bo)
 {
        int ret;
        ret = qxl_bo_create(qdev, PAGE_SIZE, false, QXL_GEM_DOMAIN_VRAM, NULL,
index aa9fb9a..1a86242 100644 (file)
@@ -315,9 +315,9 @@ static void qxl_ttm_tt_unpopulate(struct ttm_tt *ttm)
        ttm_pool_unpopulate(ttm);
 }
 
-struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev,
-                                unsigned long size, uint32_t page_flags,
-                                struct page *dummy_read_page)
+static struct ttm_tt *qxl_ttm_tt_create(struct ttm_bo_device *bdev,
+                                       unsigned long size, uint32_t page_flags,
+                                       struct page *dummy_read_page)
 {
        struct qxl_device *qdev;
        struct qxl_ttm_tt *gtt;