From 0935bd53d2aa39a8c7ee69fa8049410c863e67f5 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 01/30] cpu/cc430: do normal assignment instead of memcpy --- cpu/cc430/periph/rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/cc430/periph/rtc.c b/cpu/cc430/periph/rtc.c index f1efc891f3..2be809ea82 100644 --- a/cpu/cc430/periph/rtc.c +++ b/cpu/cc430/periph/rtc.c @@ -60,7 +60,7 @@ int rtc_set_time(struct tm *localt) } /* copy time to be set */ - memcpy(&time_to_set, localt, sizeof(struct tm)); + time_to_set = *localt; set_time = 1; return 0; } From 2d04cdfb89e05151ec955d16b949dad7ac89c468 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 02/30] cpu/native: do normal assignment instead of memcpy --- cpu/native/periph/rtc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/native/periph/rtc.c b/cpu/native/periph/rtc.c index ea6259ac78..1c8cb51261 100644 --- a/cpu/native/periph/rtc.c +++ b/cpu/native/periph/rtc.c @@ -142,7 +142,7 @@ int rtc_set_alarm(struct tm *time, rtc_alarm_cb_t cb, void *arg) return -1; } - memcpy(&_native_rtc_alarm, time, sizeof(_native_rtc_alarm)); + _native_rtc_alarm = *time; warnx("rtc_set_alarm: not implemented"); @@ -162,7 +162,7 @@ int rtc_get_alarm(struct tm *time) return -1; } - memcpy(time, &_native_rtc_alarm, sizeof(_native_rtc_alarm)); + *time = _native_rtc_alarm; return 0; } From d50038f9d06903b88d846bd4f2ddcc049816a50c Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 03/30] drivers/apa102: do normal assignment instead of memcpy --- drivers/apa102/apa102.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/apa102/apa102.c b/drivers/apa102/apa102.c index f9cbacaf6f..1d529e47aa 100644 --- a/drivers/apa102/apa102.c +++ b/drivers/apa102/apa102.c @@ -49,7 +49,7 @@ void apa102_init(apa102_t *dev, const apa102_params_t *params) { assert(dev && params); - memcpy(dev, params, sizeof(apa102_params_t)); + *dev = *params; gpio_init(dev->data_pin, GPIO_OUT); gpio_init(dev->clk_pin, GPIO_OUT); From c82f9759a8333909b35607c53c136bfcc95d2d3d Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 04/30] drivers/at86rf2xx: do normal assignment instead of memcpy --- drivers/at86rf2xx/at86rf2xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/at86rf2xx/at86rf2xx.c b/drivers/at86rf2xx/at86rf2xx.c index 58cdf25714..c73151a16c 100644 --- a/drivers/at86rf2xx/at86rf2xx.c +++ b/drivers/at86rf2xx/at86rf2xx.c @@ -43,7 +43,7 @@ void at86rf2xx_setup(at86rf2xx_t *dev, const at86rf2xx_params_t *params) netdev->driver = &at86rf2xx_driver; /* initialize device descriptor */ - memcpy(&dev->params, params, sizeof(at86rf2xx_params_t)); + dev->params = *params; /* State to return after receiving or transmitting */ dev->idle_state = AT86RF2XX_STATE_TRX_OFF; /* radio state is P_ON when first powered-on */ From f8324c3bff4fea3cc75097422334154fc456e708 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 05/30] drivers/ata8520e: do normal assignment instead of memcpy --- drivers/ata8520e/ata8520e.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ata8520e/ata8520e.c b/drivers/ata8520e/ata8520e.c index c6168b6c93..c456dbe35e 100644 --- a/drivers/ata8520e/ata8520e.c +++ b/drivers/ata8520e/ata8520e.c @@ -239,7 +239,7 @@ static void _poweroff(const ata8520e_t *dev) int ata8520e_init(ata8520e_t *dev, const ata8520e_params_t *params) { /* write config params to device descriptor */ - memcpy(&dev->params, params, sizeof(ata8520e_params_t)); + dev->params = *params; /* Initialize pins*/ if (gpio_init_int(INTPIN, GPIO_IN_PD, From d0fc60a323d8b1d6e703390c2c8fa57e3caff64d Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 06/30] drivers/bmx055: do normal assignment instead of memcpy --- drivers/bmx055/bmx055.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bmx055/bmx055.c b/drivers/bmx055/bmx055.c index 2a8c17d5cd..244e0b5450 100644 --- a/drivers/bmx055/bmx055.c +++ b/drivers/bmx055/bmx055.c @@ -54,7 +54,7 @@ int bmx055_init(bmx055_t *dev, const bmx055_params_t *params) uint8_t tmp; - memcpy(&dev->p, params, sizeof(bmx055_params_t)); + dev->p = *params; /* bring magnetometer from suspend mode to sleep mode just in case * and try to read magnetometer id From d79350f2ab90e33cff234bbbbfeea93a75e7e016 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 07/30] drivers/cc2420: do normal assignment instead of memcpy --- drivers/cc2420/cc2420.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cc2420/cc2420.c b/drivers/cc2420/cc2420.c index 7fc5f01e3d..b6982e096f 100644 --- a/drivers/cc2420/cc2420.c +++ b/drivers/cc2420/cc2420.c @@ -38,7 +38,7 @@ void cc2420_setup(cc2420_t * dev, const cc2420_params_t *params) /* set pointer to the devices netdev functions */ dev->netdev.netdev.driver = &cc2420_driver; /* pull in device configuration parameters */ - memcpy(&dev->params, params, sizeof(cc2420_params_t)); + dev->params = *params; dev->state = CC2420_STATE_IDLE; /* reset device descriptor fields */ dev->options = 0; From 355c52ac46123d12842f96bd044a9d23d0124cb4 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 08/30] drivers/dht: do normal assignment instead of memcpy --- drivers/dht/dht.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dht/dht.c b/drivers/dht/dht.c index 8b81a3ef7d..c27f3a78d1 100644 --- a/drivers/dht/dht.c +++ b/drivers/dht/dht.c @@ -69,7 +69,7 @@ int dht_init(dht_t *dev, const dht_params_t *params) assert(dev && params && ((dev->type == DHT11) || (dev->type == DHT22) || (dev->type == DHT21))); - memcpy(dev, params, sizeof(dht_t)); + *dev = *params; gpio_init(dev->pin, GPIO_OUT); gpio_set(dev->pin); From 2918d06e9c8075466aa63ada7b5d14203262f032 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 09/30] drivers/hd44780: do normal assignment instead of memcpy --- drivers/hd44780/hd44780.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hd44780/hd44780.c b/drivers/hd44780/hd44780.c index 0cf3c16764..12347a16a1 100644 --- a/drivers/hd44780/hd44780.c +++ b/drivers/hd44780/hd44780.c @@ -101,7 +101,7 @@ static void _write_bits(const hd44780_t *dev, uint8_t bits, uint8_t value) int hd44780_init(hd44780_t *dev, const hd44780_params_t *params) { /* write config params to device descriptor */ - memcpy(&dev->p, params, sizeof(hd44780_params_t)); + dev->p = *params; /* verify cols and rows */ if ((dev->p.cols > HD44780_MAX_COLS) || (dev->p.rows > HD44780_MAX_ROWS) || (dev->p.rows * dev->p.cols > 80)) { From 5bb50ea6a580e8cc22f0ac8cc20fb816f5572c72 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 10/30] drivers/hdc1000: do normal assignment instead of memcpy --- drivers/hdc1000/hdc1000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hdc1000/hdc1000.c b/drivers/hdc1000/hdc1000.c index 400ecab6fa..8030e312f7 100644 --- a/drivers/hdc1000/hdc1000.c +++ b/drivers/hdc1000/hdc1000.c @@ -40,7 +40,7 @@ int hdc1000_init(hdc1000_t *dev, const hdc1000_params_t *params) uint16_t tmp; /* write device descriptor */ - memcpy(&dev->p, params, sizeof(hdc1000_params_t)); + dev->p = *params; /* try if we can interact with the device by reading its manufacturer ID */ i2c_acquire(dev->p.i2c); From 7a66106846bc312a0ba74ca0ef01b2e9d4226340 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 11/30] drivers/hts221: do normal assignment instead of memcpy --- drivers/hts221/hts221.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hts221/hts221.c b/drivers/hts221/hts221.c index 7ff9b79670..a22e057ba9 100644 --- a/drivers/hts221/hts221.c +++ b/drivers/hts221/hts221.c @@ -147,7 +147,7 @@ int hts221_init(hts221_t *dev, const hts221_params_t *params) { uint8_t reg; - memcpy(&dev->p, params, sizeof(hts221_params_t)); + dev->p = *params; i2c_acquire(BUS); /* try if we can interact with the device by reading its manufacturer ID */ From 7126b1deb2421f9910b47b162655ce90a4bd4d39 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 12/30] drivers/kw2xrf: do normal assignment instead of memcpy --- drivers/kw2xrf/kw2xrf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/kw2xrf/kw2xrf.c b/drivers/kw2xrf/kw2xrf.c index dc5cb1c040..456bf9d6ac 100644 --- a/drivers/kw2xrf/kw2xrf.c +++ b/drivers/kw2xrf/kw2xrf.c @@ -60,7 +60,7 @@ void kw2xrf_setup(kw2xrf_t *dev, const kw2xrf_params_t *params) netdev->driver = &kw2xrf_driver; /* initialize device descriptor */ - memcpy(&dev->params, params, sizeof(kw2xrf_params_t)); + dev->params = *params; dev->idle_state = XCVSEQ_RECEIVE; dev->state = 0; dev->pending_tx = 0; From 19a87dbf2d52819fb0ef573408c55e7634484936 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 13/30] drivers/lpd8808: do normal assignment instead of memcpy --- drivers/lpd8808/lpd8808.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lpd8808/lpd8808.c b/drivers/lpd8808/lpd8808.c index 0363af761b..6835139e27 100644 --- a/drivers/lpd8808/lpd8808.c +++ b/drivers/lpd8808/lpd8808.c @@ -56,7 +56,7 @@ static void flush(const lpd8808_t *dev) int lpd8808_init(lpd8808_t *dev, const lpd8808_params_t *params) { - memcpy(dev, params, sizeof(lpd8808_params_t)); + *dev = *params; /* initialize pins */ gpio_init(dev->pin_dat, GPIO_OUT); From 8e898576dc694ffaf13ebe0938fe3d515128dad2 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 14/30] drivers/mag3110: do normal assignment instead of memcpy --- drivers/mag3110/mag3110.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mag3110/mag3110.c b/drivers/mag3110/mag3110.c index dec5d24efe..6c57d10d72 100644 --- a/drivers/mag3110/mag3110.c +++ b/drivers/mag3110/mag3110.c @@ -46,7 +46,7 @@ int mag3110_init(mag3110_t *dev, const mag3110_params_t *params) assert(params); /* write device descriptor */ - memcpy(dev, params, sizeof(mag3110_params_t)); + dev->params = *params; i2c_acquire(BUS); /* test device */ From 885b123147a4bcf0224e4a5369852f6308d9c2bc Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 15/30] drivers/mma7660: do normal assignment instead of memcpy --- drivers/mma7660/mma7660.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mma7660/mma7660.c b/drivers/mma7660/mma7660.c index b9e98d3364..d0902fd86e 100644 --- a/drivers/mma7660/mma7660.c +++ b/drivers/mma7660/mma7660.c @@ -48,7 +48,7 @@ int mma7660_init(mma7660_t *dev, const mma7660_params_t *params) { /* write device descriptor */ - memcpy(&dev->params, params, sizeof(mma7660_params_t)); + dev->params = *params; if (mma7660_set_mode(dev, 0, 0, 0, 0) != MMA7660_OK) { DEBUG("mma7660_set_mode failed!\n"); From d5c4aa2a050efcdb3b9c24c0afa02cb6c02ff23a Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 16/30] drivers/mma8x5x: do normal assignment instead of memcpy --- drivers/mma8x5x/mma8x5x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mma8x5x/mma8x5x.c b/drivers/mma8x5x/mma8x5x.c index 3850d23453..d515cc1d45 100644 --- a/drivers/mma8x5x/mma8x5x.c +++ b/drivers/mma8x5x/mma8x5x.c @@ -44,7 +44,7 @@ int mma8x5x_init(mma8x5x_t *dev, const mma8x5x_params_t *params) assert(dev && params); /* write device descriptor */ - memcpy(dev, params, sizeof(mma8x5x_params_t)); + dev->params = *params; /* acquire the I2C bus */ i2c_acquire(BUS); From 363d6a3df3ba5f934646d0b8008cccdfeb44aa72 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 17/30] drivers/mpl3115a2: do normal assignment instead of memcpy --- drivers/mpl3115a2/mpl3115a2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mpl3115a2/mpl3115a2.c b/drivers/mpl3115a2/mpl3115a2.c index ac76a7f185..79e2a7381e 100644 --- a/drivers/mpl3115a2/mpl3115a2.c +++ b/drivers/mpl3115a2/mpl3115a2.c @@ -46,7 +46,7 @@ int mpl3115a2_init(mpl3115a2_t *dev, const mpl3115a2_params_t *params) assert(params); /* write device descriptor */ - memcpy(dev, params, sizeof(mpl3115a2_params_t)); + dev->params = *params; i2c_acquire(BUS); /* test device */ From 45a3d0055269610b82b755bb5c09722f0de20630 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 18/30] drivers/mrf24j40: do normal assignment instead of memcpy --- drivers/mrf24j40/mrf24j40.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mrf24j40/mrf24j40.c b/drivers/mrf24j40/mrf24j40.c index befd12e8b1..2e58731781 100644 --- a/drivers/mrf24j40/mrf24j40.c +++ b/drivers/mrf24j40/mrf24j40.c @@ -37,7 +37,7 @@ void mrf24j40_setup(mrf24j40_t *dev, const mrf24j40_params_t *params) netdev->driver = &mrf24j40_driver; /* initialize device descriptor */ - memcpy(&dev->params, params, sizeof(mrf24j40_params_t)); + dev->params = *params; } void mrf24j40_reset(mrf24j40_t *dev) From 287a0757511be5b628f1204cfcc00456254ebf80 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 19/30] drivers/my9221: do normal assignment instead of memcpy --- drivers/my9221/my9221.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/my9221/my9221.c b/drivers/my9221/my9221.c index 5060b05707..ce9e0ed8c7 100644 --- a/drivers/my9221/my9221.c +++ b/drivers/my9221/my9221.c @@ -96,7 +96,7 @@ int my9221_init(my9221_t *dev, const my9221_params_t *params) assert(dev); assert(params); /* write config params to device descriptor */ - memcpy(&dev->params, params, sizeof(my9221_params_t)); + dev->params = *params; /* init clock and data pins as output */ gpio_init(PIN_CLK, GPIO_OUT); gpio_init(PIN_DAT, GPIO_OUT); From 4f9df5cac9b986c1e7117281a0fd2b1223af8cc2 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 20/30] drivers/rn2xx3: do normal assignment instead of memcpy --- drivers/rn2xx3/rn2xx3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rn2xx3/rn2xx3.c b/drivers/rn2xx3/rn2xx3.c index faad12900d..28d0723213 100644 --- a/drivers/rn2xx3/rn2xx3.c +++ b/drivers/rn2xx3/rn2xx3.c @@ -141,7 +141,7 @@ void rn2xx3_setup(rn2xx3_t *dev, const rn2xx3_params_t *params) assert(dev && (params->uart < UART_NUMOF)); /* initialize device parameters */ - memcpy(&dev->p, params, sizeof(rn2xx3_params_t)); + dev->p = *params; /* initialize pins and perform hardware reset */ if (dev->p.pin_reset != GPIO_UNDEF) { From 23e2859528e383e3306933e47b4a5e93649c34e9 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 21/30] drivers/sdcard_spi: do normal assignment instead of memcpy --- drivers/sdcard_spi/sdcard_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sdcard_spi/sdcard_spi.c b/drivers/sdcard_spi/sdcard_spi.c index 435f0d0318..fe2b2dc409 100644 --- a/drivers/sdcard_spi/sdcard_spi.c +++ b/drivers/sdcard_spi/sdcard_spi.c @@ -62,7 +62,7 @@ static int (*_dyn_spi_rxtx_byte)(sdcard_spi_t *card, char out, char *in); int sdcard_spi_init(sdcard_spi_t *card, const sdcard_spi_params_t *params) { sd_init_fsm_state_t state = SD_INIT_START; - memcpy(&card->params, params, sizeof(sdcard_spi_params_t)); + card->params = *params; card->spi_clk = SD_CARD_SPI_SPEED_PREINIT; do { From 7be829c7e7549fd3c649542f5673ad66daea569b Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 22/30] drivers/si70xx: do normal assignment instead of memcpy --- drivers/si70xx/si70xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/si70xx/si70xx.c b/drivers/si70xx/si70xx.c index acb61fcb4a..f99e85dc31 100644 --- a/drivers/si70xx/si70xx.c +++ b/drivers/si70xx/si70xx.c @@ -148,7 +148,7 @@ static int _test_device(const si70xx_t *dev) int si70xx_init(si70xx_t *dev, const si70xx_params_t *params) { /* initialize the device descriptor */ - memcpy(&dev->params, params, sizeof(si70xx_params_t)); + dev->params = *params; /* setup the i2c bus */ i2c_acquire(SI70XX_I2C); From 7715c7cdc0bc37bad130d4f0390bd6dca3967612 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 23/30] drivers/slipdev: do normal assignment instead of memcpy --- drivers/slipdev/slipdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/slipdev/slipdev.c b/drivers/slipdev/slipdev.c index 430c26b241..7880008e15 100644 --- a/drivers/slipdev/slipdev.c +++ b/drivers/slipdev/slipdev.c @@ -200,7 +200,7 @@ static const netdev_driver_t slip_driver = { void slipdev_setup(slipdev_t *dev, const slipdev_params_t *params) { /* set device descriptor fields */ - memcpy(&dev->config, params, sizeof(dev->config)); + dev->config = *params; dev->inesc = 0U; dev->netdev.driver = &slip_driver; } From f1856887af855330c4dc698b33bf4893b39b0355 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 24/30] drivers/sx127x: do normal assignment instead of memcpy --- drivers/sx127x/sx127x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sx127x/sx127x.c b/drivers/sx127x/sx127x.c index 87dfa797cd..392d04e242 100644 --- a/drivers/sx127x/sx127x.c +++ b/drivers/sx127x/sx127x.c @@ -61,7 +61,7 @@ void sx127x_setup(sx127x_t *dev, const sx127x_params_t *params) { netdev_t *netdev = (netdev_t*) dev; netdev->driver = &sx127x_driver; - memcpy(&dev->params, params, sizeof(sx127x_params_t)); + dev->params = *params; } int sx127x_reset(const sx127x_t *dev) From e60715d2432b47064ba9e456498c4d7f91affd95 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 25/30] drivers/tcs37727: do normal assignment instead of memcpy --- drivers/tcs37727/tcs37727.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tcs37727/tcs37727.c b/drivers/tcs37727/tcs37727.c index 7977d2fe67..7aa244ccfb 100644 --- a/drivers/tcs37727/tcs37727.c +++ b/drivers/tcs37727/tcs37727.c @@ -44,7 +44,7 @@ int tcs37727_init(tcs37727_t *dev, const tcs37727_params_t *params) assert(dev && params); /* initialize the device descriptor */ - memcpy(&dev->p, params, sizeof(tcs37727_params_t)); + dev->p = *params; /* setup the I2C bus */ i2c_acquire(BUS); From 0cceb64ae95cd64905fdf9f83d69d7ec1e2e3c99 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 26/30] drivers/tmp006: do normal assignment instead of memcpy --- drivers/tmp006/tmp006.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tmp006/tmp006.c b/drivers/tmp006/tmp006.c index 03171541ff..350cd2c574 100644 --- a/drivers/tmp006/tmp006.c +++ b/drivers/tmp006/tmp006.c @@ -70,7 +70,7 @@ int tmp006_init(tmp006_t *dev, const tmp006_params_t *params) uint16_t tmp; /* initialize the device descriptor */ - memcpy(&dev->p, params, sizeof(tmp006_params_t)); + dev->p = *params; if (dev->p.rate > TMP006_CONFIG_CR_AS16) { LOG_ERROR("tmp006_init: invalid conversion rate!\n"); From 811cda15cbf0ccb67ab082a0c9851cb1b392f16b Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 27/30] drivers/w5100: do normal assignment instead of memcpy --- drivers/w5100/w5100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/w5100/w5100.c b/drivers/w5100/w5100.c index aec5ec2598..6759edafd3 100644 --- a/drivers/w5100/w5100.c +++ b/drivers/w5100/w5100.c @@ -118,7 +118,7 @@ void w5100_setup(w5100_t *dev, const w5100_params_t *params) dev->nd.context = dev; /* initialize the device descriptor */ - memcpy(&dev->p, params, sizeof(w5100_params_t)); + dev->p = *params; /* initialize the chip select pin and the external interrupt pin */ spi_init_cs(dev->p.spi, dev->p.cs); From b21399b25c7260fdd9bdde4f81b1b4860da7c08a Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 28/30] drivers/xbee: do normal assignment instead of memcpy --- drivers/xbee/xbee.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xbee/xbee.c b/drivers/xbee/xbee.c index fb9985896d..1b4b8843c7 100644 --- a/drivers/xbee/xbee.c +++ b/drivers/xbee/xbee.c @@ -483,7 +483,7 @@ void xbee_setup(xbee_t *dev, const xbee_params_t *params) dev->context = dev; /* set peripherals to use */ - memcpy(&dev->p, params, sizeof(xbee_params_t)); + dev->p = *params; /* initialize pins */ if (dev->p.pin_reset != GPIO_UNDEF) { From 01a170bf0ee9515585491c01e1d7bf249bbc8aab Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 29/30] examples/asymcute_mqttsn: do normal assignment instead of memcpy --- examples/asymcute_mqttsn/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/asymcute_mqttsn/main.c b/examples/asymcute_mqttsn/main.c index f0f58336e0..430a3dc81b 100644 --- a/examples/asymcute_mqttsn/main.c +++ b/examples/asymcute_mqttsn/main.c @@ -128,7 +128,7 @@ static int _topic_find(asymcute_topic_t *t, const char *name) if (asymcute_topic_is_reg(&_topics[i]) && (strncmp(name, _topics[i].name, sizeof(_topics[i].name)) == 0)) { if (t) { - memcpy(t, &_topics[i], sizeof(asymcute_topic_t)); + *t = _topics[i]; } return 0; } From c12db036d02e1da353e71c1b56362cfed0d26834 Mon Sep 17 00:00:00 2001 From: Kees Bakker Date: Sun, 6 Jan 2019 22:54:44 +0100 Subject: [PATCH 30/30] tests/driver_sx127x: do normal assignment instead of memcpy --- tests/driver_sx127x/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/driver_sx127x/main.c b/tests/driver_sx127x/main.c index ea293a017e..5261b869d2 100644 --- a/tests/driver_sx127x/main.c +++ b/tests/driver_sx127x/main.c @@ -376,7 +376,7 @@ void *_recv_thread(void *arg) int main(void) { - memcpy(&sx127x.params, sx127x_params, sizeof(sx127x_params)); + sx127x.params = sx127x_params[0]; netdev_t *netdev = (netdev_t*) &sx127x; netdev->driver = &sx127x_driver;