Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac802154: cleanup concurrent check

This patch cleanups the checking of different mac phy depended values by
handling depended mac settings per hw support flag in one condition.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

authored by

Alexander Aring and committed by
Marcel Holtmann
8bf9538a fdf51784

+6 -14
+6 -14
net/mac802154/iface.c
··· 174 174 } 175 175 176 176 if (local->hw.flags & IEEE802154_HW_AFILT) { 177 - if (wpan_dev->pan_id != nwpan_dev->pan_id) 178 - return -EBUSY; 179 - 180 - if (wpan_dev->short_addr != nwpan_dev->short_addr) 181 - return -EBUSY; 182 - 183 - if (wpan_dev->extended_addr != nwpan_dev->extended_addr) 177 + if (wpan_dev->pan_id != nwpan_dev->pan_id || 178 + wpan_dev->short_addr != nwpan_dev->short_addr || 179 + wpan_dev->extended_addr != nwpan_dev->extended_addr) 184 180 return -EBUSY; 185 181 } 186 182 187 183 if (local->hw.flags & IEEE802154_HW_CSMA_PARAMS) { 188 - if (wpan_dev->min_be != nwpan_dev->min_be) 189 - return -EBUSY; 190 - 191 - if (wpan_dev->max_be != nwpan_dev->max_be) 192 - return -EBUSY; 193 - 194 - if (wpan_dev->csma_retries != nwpan_dev->csma_retries) 184 + if (wpan_dev->min_be != nwpan_dev->min_be || 185 + wpan_dev->max_be != nwpan_dev->max_be || 186 + wpan_dev->csma_retries != nwpan_dev->csma_retries) 195 187 return -EBUSY; 196 188 } 197 189