Linux IEEE 802.15.4 and 6LoWPAN development
 help / color / mirror / Atom feed
* [PATCH bluetooth-next 1/3] mac802154: cleanup concurrent check
@ 2015-03-26 11:46 Alexander Aring
  2015-03-26 11:46 ` [PATCH bluetooth-next 2/3] at86rf230: remove unnecessary spinlock Alexander Aring
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alexander Aring @ 2015-03-26 11:46 UTC (permalink / raw)
  To: linux-wpan; +Cc: kernel, mkl, Alexander Aring

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>
---
 net/mac802154/iface.c | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/net/mac802154/iface.c b/net/mac802154/iface.c
index 9b8e264..3f6a3fe 100644
--- a/net/mac802154/iface.c
+++ b/net/mac802154/iface.c
@@ -174,24 +174,16 @@ ieee802154_check_mac_settings(struct ieee802154_local *local,
 	}
 
 	if (local->hw.flags & IEEE802154_HW_AFILT) {
-		if (wpan_dev->pan_id != nwpan_dev->pan_id)
-			return -EBUSY;
-
-		if (wpan_dev->short_addr != nwpan_dev->short_addr)
-			return -EBUSY;
-
-		if (wpan_dev->extended_addr != nwpan_dev->extended_addr)
+		if (wpan_dev->pan_id != nwpan_dev->pan_id ||
+		    wpan_dev->short_addr != nwpan_dev->short_addr ||
+		    wpan_dev->extended_addr != nwpan_dev->extended_addr)
 			return -EBUSY;
 	}
 
 	if (local->hw.flags & IEEE802154_HW_CSMA_PARAMS) {
-		if (wpan_dev->min_be != nwpan_dev->min_be)
-			return -EBUSY;
-
-		if (wpan_dev->max_be != nwpan_dev->max_be)
-			return -EBUSY;
-
-		if (wpan_dev->csma_retries != nwpan_dev->csma_retries)
+		if (wpan_dev->min_be != nwpan_dev->min_be ||
+		    wpan_dev->max_be != nwpan_dev->max_be ||
+		    wpan_dev->csma_retries != nwpan_dev->csma_retries)
 			return -EBUSY;
 	}
 
-- 
2.3.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-03-27 18:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-26 11:46 [PATCH bluetooth-next 1/3] mac802154: cleanup concurrent check Alexander Aring
2015-03-26 11:46 ` [PATCH bluetooth-next 2/3] at86rf230: remove unnecessary spinlock Alexander Aring
2015-03-27 18:22   ` Marcel Holtmann
2015-03-26 11:46 ` [PATCH bluetooth-next 3/3] at86rf230: fix is_tx while error handling Alexander Aring
2015-03-26 11:54   ` Marc Kleine-Budde
2015-03-26 12:06     ` Alexander Aring
2015-03-26 15:01       ` Marcel Holtmann
2015-03-27 18:22   ` Marcel Holtmann
2015-03-27 18:22 ` [PATCH bluetooth-next 1/3] mac802154: cleanup concurrent check Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox