xiaoxiang781216 commented on code in PR #7472: URL: https://github.com/apache/incubator-nuttx/pull/7472#discussion_r1011149329
########## arch/arm/src/sama5/sam_can.c: ########## @@ -287,8 +287,17 @@ static const struct sam_config_s g_can0const = }, }; -static struct sam_can_s g_can0priv; -static struct can_dev_s g_can0dev; +static struct sam_can_s g_can0priv = +{ + .config = &g_can0const, + .freemb = CAN_ALL_MAILBOXES, + .lock = NXMUTEX_INITIALIZER, +}; +static struct can_dev_s g_can0dev = +{ + .cd_ops = &g_canops, + .cd_priv = &g_can0priv, +}; Review Comment: Yes, since all field initialization in the same(definition) place ########## arch/arm/src/sama5/sam_can.c: ########## @@ -287,8 +287,17 @@ static const struct sam_config_s g_can0const = }, }; -static struct sam_can_s g_can0priv; -static struct can_dev_s g_can0dev; +static struct sam_can_s g_can0priv = +{ + .config = &g_can0const, + .freemb = CAN_ALL_MAILBOXES, + .lock = NXMUTEX_INITIALIZER, +}; +static struct can_dev_s g_can0dev = +{ + .cd_ops = &g_canops, + .cd_priv = &g_can0priv, +}; Review Comment: Yes, since all field initialization in the same(definition) place ########## arch/arm/src/sama5/sam_can.c: ########## @@ -322,8 +331,17 @@ static const struct sam_config_s g_can1const = }, }; -static struct sam_can_s g_can1priv; -static struct can_dev_s g_can1dev; +static struct sam_can_s g_can1priv = +{ + .config = &g_can1const, + .freemb = CAN_ALL_MAILBOXES, + .lock = NXMUTEX_INITIALIZER, +}; +static struct can_dev_s g_can1dev = +{ + .cd_ops = &g_canops, + .cd_priv = &g_can1priv, +}; Review Comment: Yes, since all field initialization in the same(definition) place -- 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