Browse Source

Merge pull request #6844 from gebart/pr/scan-build-fixes

net: Fix two minor return value issues
pr/rotary
Martine Lenders 6 years ago committed by GitHub
parent
commit
dab3de5ea7
  1. 2
      drivers/at86rf2xx/at86rf2xx_netdev.c
  2. 2
      drivers/netdev_ieee802154/netdev_ieee802154.c

2
drivers/at86rf2xx/at86rf2xx_netdev.c

@ -304,7 +304,6 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
}
uint8_t old_state = at86rf2xx_get_status(dev);
res = 0;
/* temporarily wake up if sleeping */
if (old_state == AT86RF2XX_STATE_SLEEP) {
@ -339,6 +338,7 @@ static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
default:
res = -ENOTSUP;
break;
}
/* go back to sleep if were sleeping */

2
drivers/netdev_ieee802154/netdev_ieee802154.c

@ -165,6 +165,7 @@ int netdev_ieee802154_set(netdev_ieee802154_t *dev, netopt_t opt, void *value,
case NETOPT_ADDR_LEN:
case NETOPT_SRC_LEN:
assert(len == sizeof(uint16_t));
res = sizeof(uint16_t);
switch ((*(uint16_t *)value)) {
case IEEE802154_SHORT_ADDRESS_LEN:
dev->flags &= ~NETDEV_IEEE802154_SRC_MODE_LONG;
@ -176,7 +177,6 @@ int netdev_ieee802154_set(netdev_ieee802154_t *dev, netopt_t opt, void *value,
res = -EAFNOSUPPORT;
break;
}
res = sizeof(uint16_t);
break;
case NETOPT_NID:
assert(len == sizeof(dev->pan));

Loading…
Cancel
Save