Skip to content

Commit cc9db2a

Browse files
committed
[componentss][net][lwip][port] 1.变量声明和赋值可以简化并提高可读性。
1 parent 6ba6878 commit cc9db2a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

components/net/lwip/port/ethernetif.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -856,8 +856,7 @@ rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up)
856856

857857
RT_ASSERT(dev != RT_NULL);
858858

859-
struct eth_device* enetif;
860-
enetif = (struct eth_device*)dev->netif->state;
859+
struct eth_device* enetif = (struct eth_device*)dev->netif->state;
861860
rt_device_t device = (rt_device_t)(&(enetif->parent));
862861

863862
level = rt_spin_lock_irqsave(&(dev->spinlock));
@@ -895,8 +894,7 @@ rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up)
895894
/* NOTE: please not use it in interrupt when no RxThread exist */
896895
rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up)
897896
{
898-
struct eth_device* enetif;
899-
enetif = (struct eth_device*)dev->netif->state;
897+
struct eth_device* enetif = (struct eth_device*)dev->netif->state;
900898
rt_device_t device = (rt_device_t)(&(enetif->parent));
901899

902900
if (up == RT_TRUE)

0 commit comments

Comments
 (0)