netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ieee802154: fix variable declaration and initializer
@ 2014-03-19  3:19 Jean Sacren
       [not found] ` <1395199198-14310-1-git-send-email-sakiwit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Jean Sacren @ 2014-03-19  3:19 UTC (permalink / raw)
  To: Alexander Smirnov, Dmitry Eremin-Solenikov
  Cc: linux-zigbee-devel, netdev, Phoebe Buckheister

The commit 84dda3c648fd ("ieee802154: add support for
listen-before-talk in wpan_phy") introduced the new function
phy_set_lbt() with some minor issues in declaration and
initialization:

1) Fix the variable declaration by changing the type specifier to
   bool as that is the argument type when phy->set_lbt() is called.

2) Fix the initializer by deleting the double logical negation
   operators as they don't serve any purpose.

Signed-off-by: Jean Sacren <sakiwit@gmail.com>
Cc: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
---
 net/ieee802154/nl-phy.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c
index 222310a07762..643dff07803b 100644
--- a/net/ieee802154/nl-phy.c
+++ b/net/ieee802154/nl-phy.c
@@ -379,9 +379,10 @@ static int phy_set_txpower(struct wpan_phy *phy, struct genl_info *info)
 
 static int phy_set_lbt(struct wpan_phy *phy, struct genl_info *info)
 {
-	u8 on = !!nla_get_u8(info->attrs[IEEE802154_ATTR_LBT_ENABLED]);
+	bool on;
 	int rc;
 
+	on = nla_get_u8(info->attrs[IEEE802154_ATTR_LBT_ENABLED]);
 	rc = phy->set_lbt(phy, on);
 	if (rc < 0)
 		return rc;

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

end of thread, other threads:[~2014-03-19  5:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-19  3:19 [PATCH net-next] ieee802154: fix variable declaration and initializer Jean Sacren
     [not found] ` <1395199198-14310-1-git-send-email-sakiwit-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-03-19  3:32   ` Eric Dumazet
2014-03-19  3:42     ` Joe Perches
2014-03-19  4:35       ` Eric Dumazet
2014-03-19  4:56         ` Jean Sacren
     [not found]           ` <20140319045634.GB1448-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-03-19  5:11             ` Joe Perches
2014-03-19  5:13           ` Eric Dumazet
2014-03-19  5:11         ` Joe Perches
2014-03-19  4:31     ` Jean Sacren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).