xiaoxiang781216 commented on code in PR #7472: URL: https://github.com/apache/incubator-nuttx/pull/7472#discussion_r1011149572
########## arch/arm/src/sama5/sam_can.c: ########## @@ -1943,16 +1958,8 @@ struct can_dev_s *sam_caninitialize(int port) { /* Yes, then perform one time data initialization */ - memset(priv, 0, sizeof(struct sam_can_s)); - priv->config = config; - priv->freemb = CAN_ALL_MAILBOXES; Review Comment: Yes, since all field initialization in the same(definition) place ########## arch/arm/src/sama5/sam_can.c: ########## @@ -1943,16 +1958,8 @@ struct can_dev_s *sam_caninitialize(int port) { /* Yes, then perform one time data initialization */ - memset(priv, 0, sizeof(struct sam_can_s)); - priv->config = config; - priv->freemb = CAN_ALL_MAILBOXES; priv->initialized = true; - nxmutex_init(&priv->lock); - - dev->cd_ops = &g_canops; - dev->cd_priv = (void *)priv; Review Comment: Yes, since all field initialization in the same(definition) place ########## arch/arm/src/sama5/sam_dmac.c: ########## @@ -463,24 +469,6 @@ static struct sam_dmac_s g_dmac1 = * Private Functions ****************************************************************************/ -/**************************************************************************** - * Name: sam_takedsem() and sam_givedsem() - * - * Description: - * Used to wait for availability of descriptors in the descriptor table. - * - ****************************************************************************/ - -static int sam_takedsem(struct sam_dmac_s *dmac) -{ - return nxsem_wait_uninterruptible(&dmac->dsem); -} - -static inline void sam_givedsem(struct sam_dmac_s *dmac) -{ - nxsem_post(&dmac->dsem); -} - Review Comment: move to next patch -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org