提交 92163873 编写于 作者: F Fabio Estevam 提交者: Joe Hershberger

include: net: Simplify the usage of __always_inline

Since commit de4d2e9e (" bitops: Add fls_long and __ffs64")
<linux/compiler.h> is included in include/linux/bitops.h,
which allows us to marking a function as 'always_inline' in a simpler
format.
Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
Acked-by: NJoe Hershberger <joe.hershberger@ni.com>
上级 bc393a79
...@@ -181,8 +181,7 @@ int eth_unregister(struct eth_device *dev);/* Remove network device */ ...@@ -181,8 +181,7 @@ int eth_unregister(struct eth_device *dev);/* Remove network device */
extern struct eth_device *eth_current; extern struct eth_device *eth_current;
static inline __attribute__((always_inline)) static __always_inline struct eth_device *eth_get_dev(void)
struct eth_device *eth_get_dev(void)
{ {
return eth_current; return eth_current;
} }
...@@ -200,14 +199,14 @@ static inline unsigned char *eth_get_ethaddr(void) ...@@ -200,14 +199,14 @@ static inline unsigned char *eth_get_ethaddr(void)
/* Used only when NetConsole is enabled */ /* Used only when NetConsole is enabled */
int eth_is_active(struct eth_device *dev); /* Test device for active state */ int eth_is_active(struct eth_device *dev); /* Test device for active state */
/* Set active state */ /* Set active state */
static inline __attribute__((always_inline)) int eth_init_state_only(void) static __always_inline int eth_init_state_only(void)
{ {
eth_get_dev()->state = ETH_STATE_ACTIVE; eth_get_dev()->state = ETH_STATE_ACTIVE;
return 0; return 0;
} }
/* Set passive state */ /* Set passive state */
static inline __attribute__((always_inline)) void eth_halt_state_only(void) static __always_inline void eth_halt_state_only(void)
{ {
eth_get_dev()->state = ETH_STATE_PASSIVE; eth_get_dev()->state = ETH_STATE_PASSIVE;
} }
...@@ -657,7 +656,7 @@ int nc_input_packet(uchar *pkt, struct in_addr src_ip, unsigned dest_port, ...@@ -657,7 +656,7 @@ int nc_input_packet(uchar *pkt, struct in_addr src_ip, unsigned dest_port,
unsigned src_port, unsigned len); unsigned src_port, unsigned len);
#endif #endif
static inline __attribute__((always_inline)) int eth_is_on_demand_init(void) static __always_inline int eth_is_on_demand_init(void)
{ {
#ifdef CONFIG_NETCONSOLE #ifdef CONFIG_NETCONSOLE
extern enum proto_t net_loop_last_protocol; extern enum proto_t net_loop_last_protocol;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册