Conversation
cladmi
left a comment
There was a problem hiding this comment.
Changes look good, murdock still builds correctly, ACK.
|
@cladmi if you haven't already: please do not merge |
|
according to #7919 there are lots more of these to fix, I'll try to append |
0e29aa8 to
ee2f085
Compare
Dismissed because of changes after ACK
cpu/atmega_common/periph/i2c.c
Outdated
| assert(dev < I2C_NUMOF); | ||
| mutex_lock(&lock); | ||
| return 0; | ||
| if (dev < I2C_NUMOF) { |
There was a problem hiding this comment.
Here and below: I think there is a reason why the author chose assert() over if (). Better use (void) dev instead.
There was a problem hiding this comment.
There seem to be the general consent that if () should be used instead of assert(), at least most platforms do, accept this and the nrf51. Maybe someone more into periph can give there opinion here, @gebart or @haukepetersen?
But if the change-over to if () should happen I would rather like to see it in a separate PR and also for nrf51 as well.
There was a problem hiding this comment.
the reason for that is, that the API requires to return an error for invalid device, so an assert is just not enough here
There was a problem hiding this comment.
shall I also factor this one out into a separate PR?
| #ifdef DXL_DIR_PIN | ||
| static void dir_init(uart_t uart) { | ||
| static void dir_init(uart_t uart) | ||
| { |
There was a problem hiding this comment.
Here and below: unrelated style fixes, but okay.
| PMC->PMC_PCER1 = (1 << (ID_DACC - 32)); | ||
| DACC->DACC_CHER = PMC_BIT; | ||
| DACC->DACC_CHER = (1 << line); | ||
| PMC->PMC_PCER1 = PMC_BIT; |
There was a problem hiding this comment.
Mhhhh this changes the functionality. From the surrounding lines I suspect this is correct, but I'm not sure. @haukepetersen can you confirm, please?
There was a problem hiding this comment.
It would make the review easier if this was a separate PR.
0d7d4a5 to
863352e
Compare
|
|
f791688 to
6af87dc
Compare
|
|
cladmi
left a comment
There was a problem hiding this comment.
For all cases where a parameter is only used when assert is enabled, you can enclose them with #ifdef NDEBUG.
I tried listing them all (sorry for the repeated boring copy-pasted message).
Either than that, it looks good and trust murdock.
| void i2c_poweron(i2c_t dev) | ||
| { | ||
| assert(dev < I2C_NUMOF); | ||
| (void) dev; |
There was a problem hiding this comment.
You could enclose the (void) dev; with #ifdef NDEBUG
There was a problem hiding this comment.
IMHO this will decrease readability and the compiler with optimise out one or the other anyway.
There was a problem hiding this comment.
I agree with @smlng. This would lead to very ugly code.
| void i2c_poweroff(i2c_t dev) | ||
| { | ||
| assert(dev < I2C_NUMOF); | ||
| (void) dev; |
There was a problem hiding this comment.
You could enclose the (void) dev; with #ifdef NDEBUG
|
|
||
| void eic_irq_configure(int irq_num) | ||
| { | ||
| (void)irq_num; |
There was a problem hiding this comment.
You could enclose the (void) irq_num with #ifdef NDEBUG
|
|
||
| void eic_irq_enable(int irq_num) | ||
| { | ||
| (void)irq_num; |
There was a problem hiding this comment.
You could enclose the (void) irq_num with #ifdef NDEBUG
|
|
||
| void eic_irq_disable(int irq_num) | ||
| { | ||
| (void)irq_num; |
There was a problem hiding this comment.
You could enclose the (void) irq_num with #ifdef NDEBUG
|
|
||
| uint8_t pwm_channels(pwm_t pwm) | ||
| { | ||
| (void)pwm; |
There was a problem hiding this comment.
You could enclose the (void) pwm with #ifdef NDEBUG
| */ | ||
| void pwm_set(pwm_t pwm, uint8_t channel, uint16_t value) | ||
| { | ||
| (void)pwm; |
There was a problem hiding this comment.
You could enclose the (void) pwm with #ifdef NDEBUG
|
|
||
| void pwm_poweron(pwm_t pwm) | ||
| { | ||
| (void)pwm; |
There was a problem hiding this comment.
You could enclose the (void) pwm with #ifdef NDEBUG
|
|
||
| void pwm_poweroff(pwm_t pwm) | ||
| { | ||
| (void)pwm; |
There was a problem hiding this comment.
You could enclose the (void) pwm with #ifdef NDEBUG
|
|
||
| static int _get_iid(netdev_ieee802154_t *dev, eui64_t *value, size_t max_len) | ||
| { | ||
| (void)max_len; |
There was a problem hiding this comment.
You could enclose the (void)max_len with #ifdef NDEBUG
Choosen that no need to enclose the (void)var with #ifdef NDEBUG when only used by assert.
6af87dc to
3bc3b96
Compare
|
rebased, may I squash? |
|
(yes, please squash) |
cpu, sam0_common: fix unused parameter in periph/spi
cpu, kinetis_common: fix unused parameter in periph/spi
cpu, cc2538: fix unused param in periph/i2c
cpu, cc2538: fix unused param in periph/spi
cpu, sam3: fix unused param in periph/spi
cpu, stm32_common: fix unused param in periph/pm
cpu, stm32f3: fix unused params in periph/i2c
cpu, nrf5x_common: fix unused param in periph/gpio
cpu, nrf5x_common: fix unused param in periph/spi
cpu, lpc2387: fix unused params in periph/spi
cpu, cc2538: fix unused params in radio/netdev
cpu, cc2650: fix unused params in periph/uart
cpu, lm4f120: fix unused param in periph/spi
cpu, lm4f120: fix unused params in periph/timer
cpu, lm4f120: fix unused params in periph/uart
cpu, stm32_common: fix unused params in periph/dac
cpu, stm32l0: fix unused params in periph/i2c
cpu, msp430fxyz: fix unused params in periph/uart
cpu, mips: fix unused params
cpu, cc430: fix unused-params in periph/timer
cpu, msp430fxyz: fix unused params in periph/spi
drivers, cc2420: fix unused param
cpu, mips32r2_common: fix unused params in periph/timer
cpu, cc2538: fix unused-param in periph/i2c
cpu, mips32r2_common: fix unused-param in periph/timer
cpu, msp430fxyz: fix unused params in periph/timer
cpu, atmega_common: fix unused params in periph/spi
driver, nrfmin: fix unused params
cpu, cc2538_rf: fix unused params
driver, netdev_ieee802514: fix unused param
cpu, mip_pic32m: fix unused params
cpu, lpc2387: fix unused params in periph/pwm
tests/driver_sdcard_spi: fix unused params
cpu, sam3: fix unused param in periph/pwm
tests/driver_dynamixel: fix unused params, and style issues
cpu, cc430: fix unused param in periph/rtc
cpu, atmega_common: fix unused params in periph/i2c
3bc3b96 to
7309171
Compare
|
squashed |
This RP is required to achieve #7919, it fixes several unused-params errors.