1
0
Fork 0
forked from nuttx/nuttx-update

drivers/net: change netdev_lower_quota_load to macro.

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
This commit is contained in:
zhangyuan29 2024-12-04 21:11:12 +08:00 committed by Xiang Xiao
parent 79758c5150
commit 060fda032b
3 changed files with 5 additions and 22 deletions

View file

@ -1365,24 +1365,6 @@ void netdev_lower_txdone(FAR struct netdev_lowerhalf_s *dev)
#endif #endif
} }
/****************************************************************************
* Name: netdev_lower_quota_load
*
* Description:
* Fetch the quota, works like atomic_read.
*
* Input Parameters:
* dev - The lower half device driver structure
* type - Whether get quota for TX or RX
*
****************************************************************************/
int netdev_lower_quota_load(FAR struct netdev_lowerhalf_s *dev,
enum netpkt_type_e type)
{
return atomic_read(&dev->quota[type]);
}
/**************************************************************************** /****************************************************************************
* Name: netpkt_alloc * Name: netpkt_alloc
* *

View file

@ -320,8 +320,7 @@ void netdev_lower_txdone(FAR struct netdev_lowerhalf_s *dev);
* *
****************************************************************************/ ****************************************************************************/
int netdev_lower_quota_load(FAR struct netdev_lowerhalf_s *dev, #define netdev_lower_quota_load(dev, type) atomic_read(&dev->quota[type])
enum netpkt_type_e type);
/**************************************************************************** /****************************************************************************
* Name: netpkt_alloc * Name: netpkt_alloc

View file

@ -762,7 +762,8 @@ FAR struct bt_conn_s *bt_conn_addref(FAR struct bt_conn_s *conn)
{ {
bt_atomic_incr(&conn->ref); bt_atomic_incr(&conn->ref);
wlinfo("handle %u ref %u\n", conn->handle, bt_atomic_get(&conn->ref)); wlinfo("handle %u ref %" PRId32 "\n", conn->handle,
bt_atomic_get(&conn->ref));
return conn; return conn;
} }
@ -787,7 +788,8 @@ void bt_conn_release(FAR struct bt_conn_s *conn)
old_ref = bt_atomic_decr(&conn->ref); old_ref = bt_atomic_decr(&conn->ref);
wlinfo("handle %u ref %u\n", conn->handle, bt_atomic_get(&conn->ref)); wlinfo("handle %u ref %" PRId32 "\n", conn->handle,
bt_atomic_get(&conn->ref));
if (old_ref > 1) if (old_ref > 1)
{ {