[riot-notifications] [RIOT-OS/RIOT] Do normal assignment instead of memcpy (#10728)

Sebastian Meiling notifications at github.com
Thu Jan 10 16:04:15 CET 2019


smlng requested changes on this pull request.

minor

> @@ -376,7 +376,7 @@ void *_recv_thread(void *arg)
 
 int main(void)
 {
-    memcpy(&sx127x.params, sx127x_params, sizeof(sx127x_params));
+    sx127x.params = *sx127x_params;

maybe use `sx127x.params = sx127x_params[0];` as the latter is an array defined in the included header file. This assignment is a bit different from the other driver init functions where only one element is passed in.

> @@ -376,7 +376,7 @@ void *_recv_thread(void *arg)
 
 int main(void)
 {
-    memcpy(&sx127x.params, sx127x_params, sizeof(sx127x_params));
+    sx127x.params = *sx127x_params;

at least that would be (more) consistent with the changes to usage of `phydat_t` (`res->val` vs. `res->val[0]`) in SAUL, see some of your other (merged) PRs.

-- 
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/10728#pullrequestreview-191247947
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190110/07db9dd8/attachment.html>


More information about the notifications mailing list