[Intel-gfx] [PATCH 01/16] drm: drop extern from function decls

Daniel Vetter daniel.vetter at ffwll.ch
Wed Mar 22 08:36:02 UTC 2017


It's the default storage class for functions, entirely redundant. And
a lot of these headers are a bit inconsistent due to organically
grown.

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 include/drm/drm_crtc_helper.h | 38 +++++++++++++++++++-------------------
 include/drm/drm_drv.h         |  4 ++--
 include/drm/drm_global.h      |  8 ++++----
 include/drm/drm_hashtab.h     | 20 ++++++++++----------
 include/drm/drm_of.h          | 24 ++++++++++++------------
 include/drm/drm_pci.h         | 22 +++++++++++-----------
 include/drm/drm_plane.h       | 20 ++++++++++----------
 include/drm/drm_prime.h       | 30 +++++++++++++++---------------
 include/drm/drm_sysfs.h       |  4 ++--
 9 files changed, 85 insertions(+), 85 deletions(-)

diff --git a/include/drm/drm_crtc_helper.h b/include/drm/drm_crtc_helper.h
index d026f5017c33..7506a60df8b1 100644
--- a/include/drm/drm_crtc_helper.h
+++ b/include/drm/drm_crtc_helper.h
@@ -43,18 +43,18 @@
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_modeset_helper.h>
 
-extern void drm_helper_disable_unused_functions(struct drm_device *dev);
-extern int drm_crtc_helper_set_config(struct drm_mode_set *set);
-extern bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
-				     struct drm_display_mode *mode,
-				     int x, int y,
-				     struct drm_framebuffer *old_fb);
-extern bool drm_helper_crtc_in_use(struct drm_crtc *crtc);
-extern bool drm_helper_encoder_in_use(struct drm_encoder *encoder);
+void drm_helper_disable_unused_functions(struct drm_device *dev);
+int drm_crtc_helper_set_config(struct drm_mode_set *set);
+bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
+			      struct drm_display_mode *mode,
+			      int x, int y,
+			      struct drm_framebuffer *old_fb);
+bool drm_helper_crtc_in_use(struct drm_crtc *crtc);
+bool drm_helper_encoder_in_use(struct drm_encoder *encoder);
 
-extern int drm_helper_connector_dpms(struct drm_connector *connector, int mode);
+int drm_helper_connector_dpms(struct drm_connector *connector, int mode);
 
-extern void drm_helper_resume_force_mode(struct drm_device *dev);
+void drm_helper_resume_force_mode(struct drm_device *dev);
 
 int drm_helper_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
 			     struct drm_display_mode *adjusted_mode, int x, int y,
@@ -63,15 +63,15 @@ int drm_helper_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
 				  struct drm_framebuffer *old_fb);
 
 /* drm_probe_helper.c */
-extern int drm_helper_probe_single_connector_modes(struct drm_connector
-						   *connector, uint32_t maxX,
-						   uint32_t maxY);
-extern void drm_kms_helper_poll_init(struct drm_device *dev);
-extern void drm_kms_helper_poll_fini(struct drm_device *dev);
-extern bool drm_helper_hpd_irq_event(struct drm_device *dev);
-extern void drm_kms_helper_hotplug_event(struct drm_device *dev);
+int drm_helper_probe_single_connector_modes(struct drm_connector
+					    *connector, uint32_t maxX,
+					    uint32_t maxY);
+void drm_kms_helper_poll_init(struct drm_device *dev);
+void drm_kms_helper_poll_fini(struct drm_device *dev);
+bool drm_helper_hpd_irq_event(struct drm_device *dev);
+void drm_kms_helper_hotplug_event(struct drm_device *dev);
 
-extern void drm_kms_helper_poll_disable(struct drm_device *dev);
-extern void drm_kms_helper_poll_enable(struct drm_device *dev);
+void drm_kms_helper_poll_disable(struct drm_device *dev);
+void drm_kms_helper_poll_enable(struct drm_device *dev);
 
 #endif
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index fde343e0d581..d0b5f363bfa1 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -503,11 +503,11 @@ struct drm_driver {
 	int dev_priv_size;
 };
 
-extern __printf(6, 7)
+__printf(6, 7)
 void drm_dev_printk(const struct device *dev, const char *level,
 		    unsigned int category, const char *function_name,
 		    const char *prefix, const char *format, ...);
-extern __printf(3, 4)
+__printf(3, 4)
 void drm_printk(const char *level, unsigned int category,
 		const char *format, ...);
 extern unsigned int drm_debug;
diff --git a/include/drm/drm_global.h b/include/drm/drm_global.h
index a06805eaf649..3a830602a2e4 100644
--- a/include/drm/drm_global.h
+++ b/include/drm/drm_global.h
@@ -45,9 +45,9 @@ struct drm_global_reference {
 	void (*release) (struct drm_global_reference *);
 };
 
-extern void drm_global_init(void);
-extern void drm_global_release(void);
-extern int drm_global_item_ref(struct drm_global_reference *ref);
-extern void drm_global_item_unref(struct drm_global_reference *ref);
+void drm_global_init(void);
+void drm_global_release(void);
+int drm_global_item_ref(struct drm_global_reference *ref);
+void drm_global_item_unref(struct drm_global_reference *ref);
 
 #endif
diff --git a/include/drm/drm_hashtab.h b/include/drm/drm_hashtab.h
index fce2ef3fdfff..bb95ff011baf 100644
--- a/include/drm/drm_hashtab.h
+++ b/include/drm/drm_hashtab.h
@@ -49,17 +49,17 @@ struct drm_open_hash {
 	u8 order;
 };
 
-extern int drm_ht_create(struct drm_open_hash *ht, unsigned int order);
-extern int drm_ht_insert_item(struct drm_open_hash *ht, struct drm_hash_item *item);
-extern int drm_ht_just_insert_please(struct drm_open_hash *ht, struct drm_hash_item *item,
-				     unsigned long seed, int bits, int shift,
-				     unsigned long add);
-extern int drm_ht_find_item(struct drm_open_hash *ht, unsigned long key, struct drm_hash_item **item);
+int drm_ht_create(struct drm_open_hash *ht, unsigned int order);
+int drm_ht_insert_item(struct drm_open_hash *ht, struct drm_hash_item *item);
+int drm_ht_just_insert_please(struct drm_open_hash *ht, struct drm_hash_item *item,
+			      unsigned long seed, int bits, int shift,
+			      unsigned long add);
+int drm_ht_find_item(struct drm_open_hash *ht, unsigned long key, struct drm_hash_item **item);
 
-extern void drm_ht_verbose_list(struct drm_open_hash *ht, unsigned long key);
-extern int drm_ht_remove_key(struct drm_open_hash *ht, unsigned long key);
-extern int drm_ht_remove_item(struct drm_open_hash *ht, struct drm_hash_item *item);
-extern void drm_ht_remove(struct drm_open_hash *ht);
+void drm_ht_verbose_list(struct drm_open_hash *ht, unsigned long key);
+int drm_ht_remove_key(struct drm_open_hash *ht, unsigned long key);
+int drm_ht_remove_item(struct drm_open_hash *ht, struct drm_hash_item *item);
+void drm_ht_remove(struct drm_open_hash *ht);
 
 /*
  * RCU-safe interface
diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h
index 26a64805cc15..d1fc563f068a 100644
--- a/include/drm/drm_of.h
+++ b/include/drm/drm_of.h
@@ -11,18 +11,18 @@ struct drm_encoder;
 struct device_node;
 
 #ifdef CONFIG_OF
-extern uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
-					   struct device_node *port);
-extern void drm_of_component_match_add(struct device *master,
-				       struct component_match **matchptr,
-				       int (*compare)(struct device *, void *),
-				       struct device_node *node);
-extern int drm_of_component_probe(struct device *dev,
-				  int (*compare_of)(struct device *, void *),
-				  const struct component_master_ops *m_ops);
-extern int drm_of_encoder_active_endpoint(struct device_node *node,
-					  struct drm_encoder *encoder,
-					  struct of_endpoint *endpoint);
+uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
+				    struct device_node *port);
+void drm_of_component_match_add(struct device *master,
+				struct component_match **matchptr,
+				int (*compare)(struct device *, void *),
+				struct device_node *node);
+int drm_of_component_probe(struct device *dev,
+			   int (*compare_of)(struct device *, void *),
+			   const struct component_master_ops *m_ops);
+int drm_of_encoder_active_endpoint(struct device_node *node,
+				   struct drm_encoder *encoder,
+				   struct of_endpoint *endpoint);
 #else
 static inline uint32_t drm_of_find_possible_crtcs(struct drm_device *dev,
 						  struct device_node *port)
diff --git a/include/drm/drm_pci.h b/include/drm/drm_pci.h
index f5ebfcaf69e0..4579fac1080c 100644
--- a/include/drm/drm_pci.h
+++ b/include/drm/drm_pci.h
@@ -39,17 +39,17 @@ struct drm_device;
 struct drm_driver;
 struct drm_master;
 
-extern struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size,
-					    size_t align);
-extern void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah);
+struct drm_dma_handle *drm_pci_alloc(struct drm_device *dev, size_t size,
+				     size_t align);
+void drm_pci_free(struct drm_device *dev, struct drm_dma_handle * dmah);
 
-extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
-extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
+int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
+void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
 #ifdef CONFIG_PCI
-extern int drm_get_pci_dev(struct pci_dev *pdev,
-			   const struct pci_device_id *ent,
-			   struct drm_driver *driver);
-extern int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master);
+int drm_get_pci_dev(struct pci_dev *pdev,
+		    const struct pci_device_id *ent,
+		    struct drm_driver *driver);
+int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master);
 #else
 static inline int drm_get_pci_dev(struct pci_dev *pdev,
 				  const struct pci_device_id *ent,
@@ -69,7 +69,7 @@ static inline int drm_pci_set_busid(struct drm_device *dev,
 #define DRM_PCIE_SPEED_50 2
 #define DRM_PCIE_SPEED_80 4
 
-extern int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask);
-extern int drm_pcie_get_max_link_width(struct drm_device *dev, u32 *mlw);
+int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask);
+int drm_pcie_get_max_link_width(struct drm_device *dev, u32 *mlw);
 
 #endif /* _DRM_PCI_H_ */
diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h
index 20867b4371ab..31da9f0c4ad2 100644
--- a/include/drm/drm_plane.h
+++ b/include/drm/drm_plane.h
@@ -510,7 +510,7 @@ struct drm_plane {
 
 #define obj_to_plane(x) container_of(x, struct drm_plane, base)
 
-extern __printf(8, 9)
+__printf(8, 9)
 int drm_universal_plane_init(struct drm_device *dev,
 			     struct drm_plane *plane,
 			     uint32_t possible_crtcs,
@@ -519,13 +519,13 @@ int drm_universal_plane_init(struct drm_device *dev,
 			     unsigned int format_count,
 			     enum drm_plane_type type,
 			     const char *name, ...);
-extern int drm_plane_init(struct drm_device *dev,
-			  struct drm_plane *plane,
-			  uint32_t possible_crtcs,
-			  const struct drm_plane_funcs *funcs,
-			  const uint32_t *formats, unsigned int format_count,
-			  bool is_primary);
-extern void drm_plane_cleanup(struct drm_plane *plane);
+int drm_plane_init(struct drm_device *dev,
+		   struct drm_plane *plane,
+		   uint32_t possible_crtcs,
+		   const struct drm_plane_funcs *funcs,
+		   const uint32_t *formats, unsigned int format_count,
+		   bool is_primary);
+void drm_plane_cleanup(struct drm_plane *plane);
 
 /**
  * drm_plane_index - find the index of a registered plane
@@ -538,8 +538,8 @@ static inline unsigned int drm_plane_index(struct drm_plane *plane)
 {
 	return plane->index;
 }
-extern struct drm_plane * drm_plane_from_index(struct drm_device *dev, int idx);
-extern void drm_plane_force_disable(struct drm_plane *plane);
+struct drm_plane * drm_plane_from_index(struct drm_device *dev, int idx);
+void drm_plane_force_disable(struct drm_plane *plane);
 
 int drm_mode_plane_set_obj_prop(struct drm_plane *plane,
 				       struct drm_property *property,
diff --git a/include/drm/drm_prime.h b/include/drm/drm_prime.h
index d09563ecc4b7..0b2a235c4be0 100644
--- a/include/drm/drm_prime.h
+++ b/include/drm/drm_prime.h
@@ -57,24 +57,24 @@ struct drm_device;
 struct drm_gem_object;
 struct drm_file;
 
-extern struct dma_buf *drm_gem_prime_export(struct drm_device *dev,
-					    struct drm_gem_object *obj,
-					    int flags);
-extern int drm_gem_prime_handle_to_fd(struct drm_device *dev,
-		struct drm_file *file_priv, uint32_t handle, uint32_t flags,
-		int *prime_fd);
-extern struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev,
-		struct dma_buf *dma_buf);
-extern int drm_gem_prime_fd_to_handle(struct drm_device *dev,
-		struct drm_file *file_priv, int prime_fd, uint32_t *handle);
+struct dma_buf *drm_gem_prime_export(struct drm_device *dev,
+				     struct drm_gem_object *obj,
+				     int flags);
+int drm_gem_prime_handle_to_fd(struct drm_device *dev,
+			       struct drm_file *file_priv, uint32_t handle, uint32_t flags,
+			       int *prime_fd);
+struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev,
+					    struct dma_buf *dma_buf);
+int drm_gem_prime_fd_to_handle(struct drm_device *dev,
+			       struct drm_file *file_priv, int prime_fd, uint32_t *handle);
 struct dma_buf *drm_gem_dmabuf_export(struct drm_device *dev,
 				      struct dma_buf_export_info *exp_info);
-extern void drm_gem_dmabuf_release(struct dma_buf *dma_buf);
+void drm_gem_dmabuf_release(struct dma_buf *dma_buf);
 
-extern int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages,
-					    dma_addr_t *addrs, int max_pages);
-extern struct sg_table *drm_prime_pages_to_sg(struct page **pages, unsigned int nr_pages);
-extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg);
+int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages,
+				     dma_addr_t *addrs, int max_pages);
+struct sg_table *drm_prime_pages_to_sg(struct page **pages, unsigned int nr_pages);
+void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg);
 
 
 #endif /* __DRM_PRIME_H__ */
diff --git a/include/drm/drm_sysfs.h b/include/drm/drm_sysfs.h
index 1d8e033fde67..23418c1f10d1 100644
--- a/include/drm/drm_sysfs.h
+++ b/include/drm/drm_sysfs.h
@@ -6,7 +6,7 @@
  * don't want to include the full drmP.h file.
  */
 
-extern int drm_class_device_register(struct device *dev);
-extern void drm_class_device_unregister(struct device *dev);
+int drm_class_device_register(struct device *dev);
+void drm_class_device_unregister(struct device *dev);
 
 #endif
-- 
2.11.0



More information about the Intel-gfx mailing list