[riot-notifications] [RIOT-OS/RIOT] net stats: move layer 2 netstats from netdev driver to gnrc_netif (#9793)

Martine Lenders notifications at github.com
Tue Jan 29 10:45:42 CET 2019


miri64 commented on this pull request.



> @@ -356,7 +355,7 @@ int gnrc_gomach_send_preamble_ack(gnrc_netif_t *netif, gnrc_gomach_packet_info_t
      * This is to allow the preamble sender to deduce the exact phase of the receiver. */
     gomach_preamble_ack_hdr.phase_in_us = gnrc_gomach_phase_now(netif);
 
-    pkt = gnrc_pktbuf_add(NULL, &gomach_preamble_ack_hdr, sizeof(gomach_preamble_ack_hdr),
+    gnrc_pktsnip_t *pkt = gnrc_pktbuf_add(NULL, &gomach_preamble_ack_hdr, sizeof(gomach_preamble_ack_hdr),

I prefer variable definitions to be at the top of a block so one can have an overview and consider alignment (or rather more important: resulting padding i.e. waste from misalignment) on the stack, so I would prefer to just remove the `= NULL` above and keep this line as it was. E.g. I don't know the size of `gnrc_gomach_frame_preamble_ack_t` so I would prefer it to be defined / allocated last, so the padding "hole" is at the end.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/9793#discussion_r251757376
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190129/b83ea408/attachment.html>


More information about the notifications mailing list