summaryrefslogtreecommitdiff
path: root/drivers/net/ieee802154/fakelb.c
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-05-17 22:45:10 +0300
committerMarcel Holtmann <marcel@holtmann.org>2015-05-19 12:44:46 +0300
commit39572ab30feb92a8d49bf2a59c9a492ba858c008 (patch)
tree7c40b81efab5f5f8a48c64040c4c3a394311fc1e /drivers/net/ieee802154/fakelb.c
parenta09c07a8c89ee910f97d09577ec30b3084fb1d6a (diff)
downloadlinux-39572ab30feb92a8d49bf2a59c9a492ba858c008.tar.xz
fakelb: cleanup code
This patch just cleanups the code at several places. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/net/ieee802154/fakelb.c')
-rw-r--r--drivers/net/ieee802154/fakelb.c29
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index 8f37ea0fa1f5..9d0da4ec3e8c 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -45,8 +45,7 @@ struct fakelb_phy {
struct list_head list_ifup;
};
-static int
-fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
+static int fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
{
BUG_ON(!level);
*level = 0xbe;
@@ -54,8 +53,7 @@ fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
return 0;
}
-static int
-fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
+static int fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
{
struct fakelb_phy *phy = hw->priv;
@@ -66,11 +64,9 @@ fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
return 0;
}
-static int
-fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
+static int fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
{
- struct fakelb_phy *current_phy = hw->priv;
- struct fakelb_phy *phy;
+ struct fakelb_phy *current_phy = hw->priv, *phy;
read_lock_bh(&fakelb_ifup_phys_lock);
list_for_each_entry(phy, &fakelb_ifup_phys, list_ifup) {
@@ -91,8 +87,8 @@ fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
return 0;
}
-static int
-fakelb_hw_start(struct ieee802154_hw *hw) {
+static int fakelb_hw_start(struct ieee802154_hw *hw)
+{
struct fakelb_phy *phy = hw->priv;
write_lock_bh(&fakelb_ifup_phys_lock);
@@ -102,8 +98,8 @@ fakelb_hw_start(struct ieee802154_hw *hw) {
return 0;
}
-static void
-fakelb_hw_stop(struct ieee802154_hw *hw) {
+static void fakelb_hw_stop(struct ieee802154_hw *hw)
+{
struct fakelb_phy *phy = hw->priv;
write_lock_bh(&fakelb_ifup_phys_lock);
@@ -126,9 +122,9 @@ MODULE_PARM_DESC(numlbs, " number of pseudo devices");
static int fakelb_add_one(struct device *dev)
{
+ struct ieee802154_hw *hw;
struct fakelb_phy *phy;
int err;
- struct ieee802154_hw *hw;
hw = ieee802154_alloc_hw(sizeof(*phy), &fakelb_ops);
if (!hw)
@@ -201,8 +197,7 @@ static void fakelb_del(struct fakelb_phy *phy)
static int fakelb_probe(struct platform_device *pdev)
{
struct fakelb_phy *phy, *tmp;
- int err = -ENOMEM;
- int i;
+ int err, i;
for (i = 0; i < numlbs; i++) {
err = fakelb_add_one(&pdev->dev);
@@ -223,10 +218,10 @@ err_slave:
static int fakelb_remove(struct platform_device *pdev)
{
- struct fakelb_phy *phy, *temp;
+ struct fakelb_phy *phy, *tmp;
spin_lock(&fakelb_phys_lock);
- list_for_each_entry_safe(phy, temp, &fakelb_phys, list)
+ list_for_each_entry_safe(phy, tmp, &fakelb_phys, list)
fakelb_del(phy);
spin_unlock(&fakelb_phys_lock);
return 0;