mac802154: cfg: remove test and set checks

This change “mac802154: cfg: remove test and set checks” in Linux kernel is authored by Alexander Aring <alex.aring [at] gmail.com> on Mon Aug 10 21:15:55 2015 +0200.

mac802154: cfg: remove test and set checks

This patch removes several checks if a value is really changed. This
makes only sense if we have another layer call e.g. calling the
driver_ops which is done by callbacks like "set_channel".

For MAC settings which need to be set by phy registers (if the phy
supports that handling) this is set by doing an interface up currently
and are not direct driver_ops calls, so we remove the checks from these
configuration callbacks.

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Suggested-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

This Linux change may have been applied to various maintained Linux releases and you can find Linux releases including commit 91f02b3.

There are 16 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 net/mac802154/cfg.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c
index f7ba51e..cecfcda 100644
--- a/net/mac802154/cfg.c
+++ b/net/mac802154/cfg.c
@@ -209,10 +209,6 @@ static int ieee802154_resume(struct wpan_phy *wpan_phy)
 {
 	ASSERT_RTNL();
 
-	if (wpan_dev->min_be == min_be &&
-	    wpan_dev->max_be == max_be)
-		return 0;
-
 	wpan_dev->min_be = min_be;
 	wpan_dev->max_be = max_be;
 	return 0;
@@ -224,9 +220,6 @@ static int ieee802154_resume(struct wpan_phy *wpan_phy)
 {
 	ASSERT_RTNL();
 
-	if (wpan_dev->short_addr == short_addr)
-		return 0;
-
 	wpan_dev->short_addr = short_addr;
 	return 0;
 }
@@ -238,9 +231,6 @@ static int ieee802154_resume(struct wpan_phy *wpan_phy)
 {
 	ASSERT_RTNL();
 
-	if (wpan_dev->csma_retries == max_csma_backoffs)
-		return 0;
-
 	wpan_dev->csma_retries = max_csma_backoffs;
 	return 0;
 }
@@ -252,9 +242,6 @@ static int ieee802154_resume(struct wpan_phy *wpan_phy)
 {
 	ASSERT_RTNL();
 
-	if (wpan_dev->frame_retries == max_frame_retries)
-		return 0;
-
 	wpan_dev->frame_retries = max_frame_retries;
 	return 0;
 }
@@ -265,9 +252,6 @@ static int ieee802154_resume(struct wpan_phy *wpan_phy)
 {
 	ASSERT_RTNL();
 
-	if (wpan_dev->lbt == mode)
-		return 0;
-
 	wpan_dev->lbt = mode;
 	return 0;
 }

The commit for this change in Linux stable tree is 91f02b3 (patch).

Leave a Reply

Your email address will not be published. Required fields are marked *