mm/iob: iob members are initialized after allocate

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2022-12-15 22:51:14 +08:00
committed by Xiang Xiao
parent 0c21bc4e53
commit 01eb4d586b
8 changed files with 7 additions and 87 deletions
-10
View File
@@ -244,11 +244,6 @@ void mac802154_createdatareq(FAR struct ieee802154_privmac_s *priv,
iob = iob_alloc(false);
DEBUGASSERT(iob != NULL);
iob->io_flink = NULL;
iob->io_len = 0;
iob->io_offset = 0;
iob->io_pktlen = 0;
/* Set the frame control fields */
iob->io_data[0] = 0;
@@ -1534,11 +1529,6 @@ static void mac802154_rxdatareq(FAR struct ieee802154_privmac_s *priv,
iob = iob_alloc(false);
DEBUGASSERT(iob != NULL);
iob->io_flink = NULL;
iob->io_len = 0;
iob->io_offset = 0;
iob->io_pktlen = 0;
iob->io_len += 2;
/* Cast the first two bytes of the IOB to a uint16_t frame control field */
-10
View File
@@ -135,11 +135,6 @@ int mac802154_req_associate(MACHANDLE mac,
iob = iob_alloc(false);
DEBUGASSERT(iob != NULL);
iob->io_flink = NULL;
iob->io_len = 0;
iob->io_offset = 0;
iob->io_pktlen = 0;
/* Allocate the txdesc, waiting if necessary */
ret = mac802154_txdesc_alloc(priv, &txdesc);
@@ -327,11 +322,6 @@ int mac802154_resp_associate(MACHANDLE mac,
iob = iob_alloc(false);
DEBUGASSERT(iob != NULL);
iob->io_flink = NULL;
iob->io_len = 0;
iob->io_offset = 0;
iob->io_pktlen = 0;
/* The Destination Addressing Mode and Source Addressing Mode fields shall
* each be set to indicate extended addressing.
*
-5
View File
@@ -511,11 +511,6 @@ static ssize_t mac802154dev_write(FAR struct file *filep,
iob = iob_alloc(false);
DEBUGASSERT(iob != NULL);
iob->io_flink = NULL;
iob->io_len = 0;
iob->io_offset = 0;
iob->io_pktlen = 0;
/* Get the MAC header length */
ret = mac802154_get_mhrlen(dev->md_mac, &tx->meta);