diff mbox

[dpdk-dev] lib: remove "extern" keyword for functions from header files

Message ID 1453716075-28150-1-git-send-email-ferruh.yigit@intel.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Ferruh Yigit Jan. 25, 2016, 10:01 a.m. UTC
Remove "extern" keywords in header files, the ones for function
prototypes

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 lib/librte_eal/common/include/rte_memory.h |   2 +-
 lib/librte_ether/rte_ethdev.h              | 136 ++++++++++++++---------------
 lib/librte_kni/rte_kni.h                   |  31 ++++---
 3 files changed, 82 insertions(+), 87 deletions(-)

Comments

Thomas Monjalon Jan. 27, 2016, 6:05 p.m. UTC | #1
2016-01-25 10:01, Ferruh Yigit:
> Remove "extern" keywords in header files, the ones for function
> prototypes

I've seen a lot of other extern keywords. Why not removing all?

> -extern int rte_eth_dev_configure(uint8_t port_id,
> -				 uint16_t nb_rx_queue,
> -				 uint16_t nb_tx_queue,
> -				 const struct rte_eth_conf *eth_conf);
> +int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue,
> +			  uint16_t nb_tx_queue,
> +			  const struct rte_eth_conf *eth_conf);

The indent is weird.
Why not follow the guideline with 2 tabs?
http://dpdk.org/doc/guides-2.2/contributing/coding_style.html#c-indentation
Thomas Monjalon Jan. 28, 2016, 1:39 p.m. UTC | #2
2016-01-28 10:11, Ferruh Yigit:
> On Wed, Jan 27, 2016 at 07:05:52PM +0100, Thomas Monjalon wrote:
> > 2016-01-25 10:01, Ferruh Yigit:
> > > Remove "extern" keywords in header files, the ones for function
> > > prototypes
> > 
> > I've seen a lot of other extern keywords. Why not removing all?
> > 
> Remaining one are Linux drivers in KNI, they are kind of internal headers, I doubt on touching them.
> Should I remove them all?
> Also there are more usage in "drivers" folder, I am not sure touching them too, what do you comment?
> 
> > > -extern int rte_eth_dev_configure(uint8_t port_id,
> > > -				 uint16_t nb_rx_queue,
> > > -				 uint16_t nb_tx_queue,
> > > -				 const struct rte_eth_conf *eth_conf);
> > > +int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue,
> > > +			  uint16_t nb_tx_queue,
> > > +			  const struct rte_eth_conf *eth_conf);
> > 
> > The indent is weird.
> > Why not follow the guideline with 2 tabs?
> > http://dpdk.org/doc/guides-2.2/contributing/coding_style.html#c-indentation
> 
> Intentionally kept them as original, to scope the patch just to remove a keyword.
> Do you want me fix the syntax wherever I touch for this patch?

Syntax? Do you mean to fix the indent?
Yes I think it is a good practice to fix the indent when modifying some code.
diff mbox

Patch

diff --git a/lib/librte_eal/common/include/rte_memory.h b/lib/librte_eal/common/include/rte_memory.h
index 9c9e40f..587a25d 100644
--- a/lib/librte_eal/common/include/rte_memory.h
+++ b/lib/librte_eal/common/include/rte_memory.h
@@ -184,7 +184,7 @@  unsigned rte_memory_get_nrank(void);
 #ifdef RTE_LIBRTE_XEN_DOM0
 
 /**< Internal use only - should DOM0 memory mapping be used */
-extern int rte_xen_dom0_supported(void);
+int rte_xen_dom0_supported(void);
 
 /**< Internal use only - phys to virt mapping for xen */
 phys_addr_t rte_xen_mem_phy2mch(uint32_t, const phys_addr_t);
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index bada8ad..3063681 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1637,7 +1637,7 @@  extern struct rte_eth_dev rte_eth_devices[];
  * @return
  *   - The total number of usable Ethernet devices.
  */
-extern uint8_t rte_eth_dev_count(void);
+uint8_t rte_eth_dev_count(void);
 
 /**
  * @internal
@@ -1648,7 +1648,7 @@  extern uint8_t rte_eth_dev_count(void);
  * @return
  *   - The pointer to the ethdev slot, on success. NULL on error
  */
-extern struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
+struct rte_eth_dev *rte_eth_dev_allocated(const char *name);
 
 /**
  * @internal
@@ -1784,7 +1784,7 @@  struct eth_driver {
  *   The pointer to the *eth_driver* structure associated with
  *   the Ethernet driver.
  */
-extern void rte_eth_driver_register(struct eth_driver *eth_drv);
+void rte_eth_driver_register(struct eth_driver *eth_drv);
 
 /**
  * Configure an Ethernet device.
@@ -1815,10 +1815,9 @@  extern void rte_eth_driver_register(struct eth_driver *eth_drv);
  *   - 0: Success, device configured.
  *   - <0: Error code returned by the driver configuration function.
  */
-extern int rte_eth_dev_configure(uint8_t port_id,
-				 uint16_t nb_rx_queue,
-				 uint16_t nb_tx_queue,
-				 const struct rte_eth_conf *eth_conf);
+int rte_eth_dev_configure(uint8_t port_id, uint16_t nb_rx_queue,
+			  uint16_t nb_tx_queue,
+			  const struct rte_eth_conf *eth_conf);
 
 /**
  * Allocate and set up a receive queue for an Ethernet device.
@@ -1859,10 +1858,10 @@  extern int rte_eth_dev_configure(uint8_t port_id,
  *      allocate network memory buffers from the memory pool when
  *      initializing receive descriptors.
  */
-extern int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
-				  uint16_t nb_rx_desc, unsigned int socket_id,
-				  const struct rte_eth_rxconf *rx_conf,
-				  struct rte_mempool *mb_pool);
+int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
+			   uint16_t nb_rx_desc, unsigned int socket_id,
+			   const struct rte_eth_rxconf *rx_conf,
+			   struct rte_mempool *mb_pool);
 
 /**
  * Allocate and set up a transmit queue for an Ethernet device.
@@ -1907,9 +1906,9 @@  extern int rte_eth_rx_queue_setup(uint8_t port_id, uint16_t rx_queue_id,
  *   - 0: Success, the transmit queue is correctly set up.
  *   - -ENOMEM: Unable to allocate the transmit ring descriptors.
  */
-extern int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
-				  uint16_t nb_tx_desc, unsigned int socket_id,
-				  const struct rte_eth_txconf *tx_conf);
+int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
+			   uint16_t nb_tx_desc, unsigned int socket_id,
+			   const struct rte_eth_txconf *tx_conf);
 
 /*
  * Return the NUMA socket to which an Ethernet device is connected
@@ -1921,7 +1920,7 @@  extern int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id,
  *   a default of zero if the socket could not be determined.
  *   -1 is returned is the port_id value is out of range.
  */
-extern int rte_eth_dev_socket_id(uint8_t port_id);
+int rte_eth_dev_socket_id(uint8_t port_id);
 
 /*
  * Check if port_id of device is attached
@@ -1932,7 +1931,7 @@  extern int rte_eth_dev_socket_id(uint8_t port_id);
  *   - 0 if port is out of range or not attached
  *   - 1 if device is attached
  */
-extern int rte_eth_dev_is_valid_port(uint8_t port_id);
+int rte_eth_dev_is_valid_port(uint8_t port_id);
 
 /*
  * Allocate mbuf from mempool, setup the DMA physical address
@@ -1950,7 +1949,7 @@  extern int rte_eth_dev_is_valid_port(uint8_t port_id);
  *   - -EINVAL: The port_id or the queue_id out of range.
  *   - -ENOTSUP: The function not supported in PMD driver.
  */
-extern int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id);
+int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id);
 
 /*
  * Stop specified RX queue of a port
@@ -1966,7 +1965,7 @@  extern int rte_eth_dev_rx_queue_start(uint8_t port_id, uint16_t rx_queue_id);
  *   - -EINVAL: The port_id or the queue_id out of range.
  *   - -ENOTSUP: The function not supported in PMD driver.
  */
-extern int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id);
+int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id);
 
 /*
  * Start TX for specified queue of a port. It is used when tx_deferred_start
@@ -1983,7 +1982,7 @@  extern int rte_eth_dev_rx_queue_stop(uint8_t port_id, uint16_t rx_queue_id);
  *   - -EINVAL: The port_id or the queue_id out of range.
  *   - -ENOTSUP: The function not supported in PMD driver.
  */
-extern int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id);
+int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id);
 
 /*
  * Stop specified TX queue of a port
@@ -1999,7 +1998,7 @@  extern int rte_eth_dev_tx_queue_start(uint8_t port_id, uint16_t tx_queue_id);
  *   - -EINVAL: The port_id or the queue_id out of range.
  *   - -ENOTSUP: The function not supported in PMD driver.
  */
-extern int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id);
+int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id);
 
 
 
@@ -2018,7 +2017,7 @@  extern int rte_eth_dev_tx_queue_stop(uint8_t port_id, uint16_t tx_queue_id);
  *   - 0: Success, Ethernet device started.
  *   - <0: Error code of the driver device start function.
  */
-extern int rte_eth_dev_start(uint8_t port_id);
+int rte_eth_dev_start(uint8_t port_id);
 
 /**
  * Stop an Ethernet device. The device can be restarted with a call to
@@ -2027,7 +2026,7 @@  extern int rte_eth_dev_start(uint8_t port_id);
  * @param port_id
  *   The port identifier of the Ethernet device.
  */
-extern void rte_eth_dev_stop(uint8_t port_id);
+void rte_eth_dev_stop(uint8_t port_id);
 
 
 /**
@@ -2042,7 +2041,7 @@  extern void rte_eth_dev_stop(uint8_t port_id);
  *   - 0: Success, Ethernet device linked up.
  *   - <0: Error code of the driver device link up function.
  */
-extern int rte_eth_dev_set_link_up(uint8_t port_id);
+int rte_eth_dev_set_link_up(uint8_t port_id);
 
 /**
  * Link down an Ethernet device.
@@ -2053,7 +2052,7 @@  extern int rte_eth_dev_set_link_up(uint8_t port_id);
  * @param port_id
  *   The port identifier of the Ethernet device.
  */
-extern int rte_eth_dev_set_link_down(uint8_t port_id);
+int rte_eth_dev_set_link_down(uint8_t port_id);
 
 /**
  * Close a stopped Ethernet device. The device cannot be restarted!
@@ -2063,7 +2062,7 @@  extern int rte_eth_dev_set_link_down(uint8_t port_id);
  * @param port_id
  *   The port identifier of the Ethernet device.
  */
-extern void rte_eth_dev_close(uint8_t port_id);
+void rte_eth_dev_close(uint8_t port_id);
 
 /**
  * Enable receipt in promiscuous mode for an Ethernet device.
@@ -2071,7 +2070,7 @@  extern void rte_eth_dev_close(uint8_t port_id);
  * @param port_id
  *   The port identifier of the Ethernet device.
  */
-extern void rte_eth_promiscuous_enable(uint8_t port_id);
+void rte_eth_promiscuous_enable(uint8_t port_id);
 
 /**
  * Disable receipt in promiscuous mode for an Ethernet device.
@@ -2079,7 +2078,7 @@  extern void rte_eth_promiscuous_enable(uint8_t port_id);
  * @param port_id
  *   The port identifier of the Ethernet device.
  */
-extern void rte_eth_promiscuous_disable(uint8_t port_id);
+void rte_eth_promiscuous_disable(uint8_t port_id);
 
 /**
  * Return the value of promiscuous mode for an Ethernet device.
@@ -2091,7 +2090,7 @@  extern void rte_eth_promiscuous_disable(uint8_t port_id);
  *   - (0) if promiscuous is disabled.
  *   - (-1) on error
  */
-extern int rte_eth_promiscuous_get(uint8_t port_id);
+int rte_eth_promiscuous_get(uint8_t port_id);
 
 /**
  * Enable the receipt of any multicast frame by an Ethernet device.
@@ -2099,7 +2098,7 @@  extern int rte_eth_promiscuous_get(uint8_t port_id);
  * @param port_id
  *   The port identifier of the Ethernet device.
  */
-extern void rte_eth_allmulticast_enable(uint8_t port_id);
+void rte_eth_allmulticast_enable(uint8_t port_id);
 
 /**
  * Disable the receipt of all multicast frames by an Ethernet device.
@@ -2107,7 +2106,7 @@  extern void rte_eth_allmulticast_enable(uint8_t port_id);
  * @param port_id
  *   The port identifier of the Ethernet device.
  */
-extern void rte_eth_allmulticast_disable(uint8_t port_id);
+void rte_eth_allmulticast_disable(uint8_t port_id);
 
 /**
  * Return the value of allmulticast mode for an Ethernet device.
@@ -2119,7 +2118,7 @@  extern void rte_eth_allmulticast_disable(uint8_t port_id);
  *   - (0) if allmulticast is disabled.
  *   - (-1) on error
  */
-extern int rte_eth_allmulticast_get(uint8_t port_id);
+int rte_eth_allmulticast_get(uint8_t port_id);
 
 /**
  * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX
@@ -2132,7 +2131,7 @@  extern int rte_eth_allmulticast_get(uint8_t port_id);
  *   A pointer to an *rte_eth_link* structure to be filled with
  *   the status, the speed and the mode of the Ethernet device link.
  */
-extern void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link);
+void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link);
 
 /**
  * Retrieve the status (ON/OFF), the speed (in Mbps) and the mode (HALF-DUPLEX
@@ -2145,8 +2144,7 @@  extern void rte_eth_link_get(uint8_t port_id, struct rte_eth_link *link);
  *   A pointer to an *rte_eth_link* structure to be filled with
  *   the status, the speed and the mode of the Ethernet device link.
  */
-extern void rte_eth_link_get_nowait(uint8_t port_id,
-				struct rte_eth_link *link);
+void rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *link);
 
 /**
  * Retrieve the general I/O statistics of an Ethernet device.
@@ -2165,7 +2163,7 @@  extern void rte_eth_link_get_nowait(uint8_t port_id,
  * @return
  *   Zero if successful. Non-zero otherwise.
  */
-extern int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
+int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
 
 /**
  * Reset the general I/O statistics of an Ethernet device.
@@ -2173,7 +2171,7 @@  extern int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);
  * @param port_id
  *   The port identifier of the Ethernet device.
  */
-extern void rte_eth_stats_reset(uint8_t port_id);
+void rte_eth_stats_reset(uint8_t port_id);
 
 /**
  * Retrieve extended statistics of an Ethernet device.
@@ -2196,8 +2194,8 @@  extern void rte_eth_stats_reset(uint8_t port_id);
  *     shall not be used by the caller.
  *   - negative value on error (invalid port id)
  */
-extern int rte_eth_xstats_get(uint8_t port_id,
-	struct rte_eth_xstats *xstats, unsigned n);
+int rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,
+		unsigned n);
 
 /**
  * Reset extended statistics of an Ethernet device.
@@ -2205,7 +2203,7 @@  extern int rte_eth_xstats_get(uint8_t port_id,
  * @param port_id
  *   The port identifier of the Ethernet device.
  */
-extern void rte_eth_xstats_reset(uint8_t port_id);
+void rte_eth_xstats_reset(uint8_t port_id);
 
 /**
  *  Set a mapping for the specified transmit queue to the specified per-queue
@@ -2224,9 +2222,9 @@  extern void rte_eth_xstats_reset(uint8_t port_id);
  * @return
  *   Zero if successful. Non-zero otherwise.
  */
-extern int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id,
-						  uint16_t tx_queue_id,
-						  uint8_t stat_idx);
+int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id,
+					   uint16_t tx_queue_id,
+					   uint8_t stat_idx);
 
 /**
  *  Set a mapping for the specified receive queue to the specified per-queue
@@ -2245,9 +2243,9 @@  extern int rte_eth_dev_set_tx_queue_stats_mapping(uint8_t port_id,
  * @return
  *   Zero if successful. Non-zero otherwise.
  */
-extern int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id,
-						  uint16_t rx_queue_id,
-						  uint8_t stat_idx);
+int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id,
+					   uint16_t rx_queue_id,
+					   uint8_t stat_idx);
 
 /**
  * Retrieve the Ethernet address of an Ethernet device.
@@ -2258,7 +2256,7 @@  extern int rte_eth_dev_set_rx_queue_stats_mapping(uint8_t port_id,
  *   A pointer to a structure of type *ether_addr* to be filled with
  *   the Ethernet address of the Ethernet device.
  */
-extern void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr);
+void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr);
 
 /**
  * Retrieve the contextual information of an Ethernet device.
@@ -2269,8 +2267,7 @@  extern void rte_eth_macaddr_get(uint8_t port_id, struct ether_addr *mac_addr);
  *   A pointer to a structure of type *rte_eth_dev_info* to be filled with
  *   the contextual information of the Ethernet device.
  */
-extern void rte_eth_dev_info_get(uint8_t port_id,
-				 struct rte_eth_dev_info *dev_info);
+void rte_eth_dev_info_get(uint8_t port_id, struct rte_eth_dev_info *dev_info);
 
 /**
  * Retrieve the MTU of an Ethernet device.
@@ -2283,7 +2280,7 @@  extern void rte_eth_dev_info_get(uint8_t port_id,
  *   - (0) if successful.
  *   - (-ENODEV) if *port_id* invalid.
  */
-extern int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu);
+int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu);
 
 /**
  * Change the MTU of an Ethernet device.
@@ -2298,7 +2295,7 @@  extern int rte_eth_dev_get_mtu(uint8_t port_id, uint16_t *mtu);
  *   - (-ENODEV) if *port_id* invalid.
  *   - (-EINVAL) if *mtu* invalid.
  */
-extern int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu);
+int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu);
 
 /**
  * Enable/Disable hardware filtering by an Ethernet device of received
@@ -2318,7 +2315,7 @@  extern int rte_eth_dev_set_mtu(uint8_t port_id, uint16_t mtu);
  *   - (-ENOSYS) if VLAN filtering on *port_id* disabled.
  *   - (-EINVAL) if *vlan_id* > 4095.
  */
-extern int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id , int on);
+int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id, int on);
 
 /**
  * Enable/Disable hardware VLAN Strip by a rx queue of an Ethernet device.
@@ -2339,8 +2336,8 @@  extern int rte_eth_dev_vlan_filter(uint8_t port_id, uint16_t vlan_id , int on);
  *   - (-ENODEV) if *port_id* invalid.
  *   - (-EINVAL) if *rx_queue_id* invalid.
  */
-extern int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id,
-		uint16_t rx_queue_id, int on);
+int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id, uint16_t rx_queue_id,
+		int on);
 
 /**
  * Set the Outer VLAN Ether Type by an Ethernet device, it can be inserted to
@@ -2356,7 +2353,7 @@  extern int rte_eth_dev_set_vlan_strip_on_queue(uint8_t port_id,
  *   - (-ENOSUP) if hardware-assisted VLAN TPID setup is not supported.
  *   - (-ENODEV) if *port_id* invalid.
  */
-extern int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, uint16_t tag_type);
+int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, uint16_t tag_type);
 
 /**
  * Set VLAN offload configuration on an Ethernet device
@@ -2378,7 +2375,7 @@  extern int rte_eth_dev_set_vlan_ether_type(uint8_t port_id, uint16_t tag_type);
  *   - (-ENOSUP) if hardware-assisted VLAN filtering not configured.
  *   - (-ENODEV) if *port_id* invalid.
  */
-extern int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask);
+int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask);
 
 /**
  * Read VLAN Offload configuration from an Ethernet device
@@ -2392,7 +2389,7 @@  extern int rte_eth_dev_set_vlan_offload(uint8_t port_id, int offload_mask);
  *       ETH_VLAN_EXTEND_OFFLOAD
  *   - (-ENODEV) if *port_id* invalid.
  */
-extern int rte_eth_dev_get_vlan_offload(uint8_t port_id);
+int rte_eth_dev_get_vlan_offload(uint8_t port_id);
 
 /**
  * Set port based TX VLAN insersion on or off.
@@ -2408,7 +2405,7 @@  extern int rte_eth_dev_get_vlan_offload(uint8_t port_id);
  *   - (0) if successful.
  *   - negative if failed.
  */
-extern int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on);
+int rte_eth_dev_set_vlan_pvid(uint8_t port_id, uint16_t pvid, int on);
 
 /**
  *
@@ -3742,7 +3739,7 @@  int rte_eth_dev_set_mc_addr_list(uint8_t port_id,
  *   - -ENODEV: The port ID is invalid.
  *   - -ENOTSUP: The function is not supported by the Ethernet driver.
  */
-extern int rte_eth_timesync_enable(uint8_t port_id);
+int rte_eth_timesync_enable(uint8_t port_id);
 
 /**
  * Disable IEEE1588/802.1AS timestamping for an Ethernet device.
@@ -3755,7 +3752,7 @@  extern int rte_eth_timesync_enable(uint8_t port_id);
  *   - -ENODEV: The port ID is invalid.
  *   - -ENOTSUP: The function is not supported by the Ethernet driver.
  */
-extern int rte_eth_timesync_disable(uint8_t port_id);
+int rte_eth_timesync_disable(uint8_t port_id);
 
 /**
  * Read an IEEE1588/802.1AS RX timestamp from an Ethernet device.
@@ -3774,9 +3771,9 @@  extern int rte_eth_timesync_disable(uint8_t port_id);
  *   - -ENODEV: The port ID is invalid.
  *   - -ENOTSUP: The function is not supported by the Ethernet driver.
  */
-extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
-					      struct timespec *timestamp,
-					      uint32_t flags);
+int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
+				       struct timespec *timestamp,
+				       uint32_t flags);
 
 /**
  * Read an IEEE1588/802.1AS TX timestamp from an Ethernet device.
@@ -3792,8 +3789,8 @@  extern int rte_eth_timesync_read_rx_timestamp(uint8_t port_id,
  *   - -ENODEV: The port ID is invalid.
  *   - -ENOTSUP: The function is not supported by the Ethernet driver.
  */
-extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
-					      struct timespec *timestamp);
+int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
+				       struct timespec *timestamp);
 
 /**
  * Adjust the timesync clock on an Ethernet device.
@@ -3811,7 +3808,7 @@  extern int rte_eth_timesync_read_tx_timestamp(uint8_t port_id,
  *   - -ENODEV: The port ID is invalid.
  *   - -ENOTSUP: The function is not supported by the Ethernet driver.
  */
-extern int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta);
+int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta);
 
 /**
  * Read the time from the timesync clock on an Ethernet device.
@@ -3827,7 +3824,7 @@  extern int rte_eth_timesync_adjust_time(uint8_t port_id, int64_t delta);
  * @return
  *   - 0: Success.
  */
-extern int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time);
+int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time);
 
 /**
  * Set the time of the timesync clock on an Ethernet device.
@@ -3846,8 +3843,7 @@  extern int rte_eth_timesync_read_time(uint8_t port_id, struct timespec *time);
  *   - -ENODEV: The port ID is invalid.
  *   - -ENOTSUP: The function is not supported by the Ethernet driver.
  */
-extern int rte_eth_timesync_write_time(uint8_t port_id,
-				       const struct timespec *time);
+int rte_eth_timesync_write_time(uint8_t port_id, const struct timespec *time);
 
 /**
  * Copy pci device info to the Ethernet device data.
@@ -3860,8 +3856,8 @@  extern int rte_eth_timesync_write_time(uint8_t port_id,
  * @return
  *   - 0 on success, negative on error
  */
-extern void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, struct rte_pci_device *pci_dev);
-
+void rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,
+		struct rte_pci_device *pci_dev);
 
 /**
  * Create memzone for HW rings.
diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h
index ef9faa9..8631721 100644
--- a/lib/librte_kni/rte_kni.h
+++ b/lib/librte_kni/rte_kni.h
@@ -101,7 +101,7 @@  struct rte_kni_conf {
  * @param max_kni_ifaces
  *  The maximum number of KNI interfaces that can coexist concurrently
  */
-extern void rte_kni_init(unsigned int max_kni_ifaces);
+void rte_kni_init(unsigned int max_kni_ifaces);
 
 
 /**
@@ -124,9 +124,9 @@  extern void rte_kni_init(unsigned int max_kni_ifaces);
  *  - The pointer to the context of a KNI interface.
  *  - NULL indicate error.
  */
-extern struct rte_kni *rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
-				     const struct rte_kni_conf *conf,
-				     struct rte_kni_ops *ops);
+struct rte_kni *rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
+			      const struct rte_kni_conf *conf,
+			      struct rte_kni_ops *ops);
 
 /**
  * Release KNI interface according to the context. It will also release the
@@ -142,7 +142,7 @@  extern struct rte_kni *rte_kni_alloc(struct rte_mempool *pktmbuf_pool,
  *  - 0 indicates success.
  *  - negative value indicates failure.
  */
-extern int rte_kni_release(struct rte_kni *kni);
+int rte_kni_release(struct rte_kni *kni);
 
 /**
  * It is used to handle the request mbufs sent from kernel space.
@@ -156,7 +156,7 @@  extern int rte_kni_release(struct rte_kni *kni);
  *  - 0
  *  - negative value indicates failure.
  */
-extern int rte_kni_handle_request(struct rte_kni *kni);
+int rte_kni_handle_request(struct rte_kni *kni);
 
 /**
  * Retrieve a burst of packets from a KNI interface. The retrieved packets are
@@ -174,8 +174,8 @@  extern int rte_kni_handle_request(struct rte_kni *kni);
  * @return
  *  The actual number of packets retrieved.
  */
-extern unsigned rte_kni_rx_burst(struct rte_kni *kni,
-		struct rte_mbuf **mbufs, unsigned num);
+unsigned rte_kni_rx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs,
+		unsigned num);
 
 /**
  * Send a burst of packets to a KNI interface. The packets to be sent out are
@@ -193,8 +193,8 @@  extern unsigned rte_kni_rx_burst(struct rte_kni *kni,
  * @return
  *  The actual number of packets sent.
  */
-extern unsigned rte_kni_tx_burst(struct rte_kni *kni,
-		struct rte_mbuf **mbufs, unsigned num);
+unsigned rte_kni_tx_burst(struct rte_kni *kni, struct rte_mbuf **mbufs,
+		unsigned num);
 
 /**
  * Get the KNI context of its name.
@@ -206,7 +206,7 @@  extern unsigned rte_kni_tx_burst(struct rte_kni *kni,
  *  On success: Pointer to KNI interface.
  *  On failure: NULL.
  */
-extern struct rte_kni *rte_kni_get(const char *name);
+struct rte_kni *rte_kni_get(const char *name);
 
 /**
  * Get the name given to a KNI device
@@ -216,7 +216,7 @@  extern struct rte_kni *rte_kni_get(const char *name);
  * @return
  *   The pointer to the KNI name
  */
-extern const char *rte_kni_get_name(const struct rte_kni *kni);
+const char *rte_kni_get_name(const struct rte_kni *kni);
 
 /**
  * Register KNI request handling for a specified port,and it can
@@ -231,8 +231,7 @@  extern const char *rte_kni_get_name(const struct rte_kni *kni);
  *  On success: 0
  *  On failure: -1
  */
-extern int rte_kni_register_handlers(struct rte_kni *kni,
-			struct rte_kni_ops *ops);
+int rte_kni_register_handlers(struct rte_kni *kni, struct rte_kni_ops *ops);
 
 /**
  *  Unregister KNI request handling for a specified port.
@@ -244,12 +243,12 @@  extern int rte_kni_register_handlers(struct rte_kni *kni,
  *   On success: 0
  *   On failure: -1
  */
-extern int rte_kni_unregister_handlers(struct rte_kni *kni);
+int rte_kni_unregister_handlers(struct rte_kni *kni);
 
 /**
  *  Close KNI device.
  */
-extern void rte_kni_close(void);
+void rte_kni_close(void);
 
 #ifdef __cplusplus
 }