Commit 39572ab3 authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann

fakelb: cleanup code

This patch just cleanups the code at several places.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent a09c07a8
...@@ -45,8 +45,7 @@ struct fakelb_phy { ...@@ -45,8 +45,7 @@ struct fakelb_phy {
struct list_head list_ifup; struct list_head list_ifup;
}; };
static int static int fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
{ {
BUG_ON(!level); BUG_ON(!level);
*level = 0xbe; *level = 0xbe;
...@@ -54,8 +53,7 @@ fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level) ...@@ -54,8 +53,7 @@ fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
return 0; return 0;
} }
static int static int fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
{ {
struct fakelb_phy *phy = hw->priv; struct fakelb_phy *phy = hw->priv;
...@@ -66,11 +64,9 @@ fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel) ...@@ -66,11 +64,9 @@ fakelb_hw_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
return 0; return 0;
} }
static int static int fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
{ {
struct fakelb_phy *current_phy = hw->priv; struct fakelb_phy *current_phy = hw->priv, *phy;
struct fakelb_phy *phy;
read_lock_bh(&fakelb_ifup_phys_lock); read_lock_bh(&fakelb_ifup_phys_lock);
list_for_each_entry(phy, &fakelb_ifup_phys, list_ifup) { 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) ...@@ -91,8 +87,8 @@ fakelb_hw_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
return 0; return 0;
} }
static int static int fakelb_hw_start(struct ieee802154_hw *hw)
fakelb_hw_start(struct ieee802154_hw *hw) { {
struct fakelb_phy *phy = hw->priv; struct fakelb_phy *phy = hw->priv;
write_lock_bh(&fakelb_ifup_phys_lock); write_lock_bh(&fakelb_ifup_phys_lock);
...@@ -102,8 +98,8 @@ fakelb_hw_start(struct ieee802154_hw *hw) { ...@@ -102,8 +98,8 @@ fakelb_hw_start(struct ieee802154_hw *hw) {
return 0; return 0;
} }
static void static void fakelb_hw_stop(struct ieee802154_hw *hw)
fakelb_hw_stop(struct ieee802154_hw *hw) { {
struct fakelb_phy *phy = hw->priv; struct fakelb_phy *phy = hw->priv;
write_lock_bh(&fakelb_ifup_phys_lock); write_lock_bh(&fakelb_ifup_phys_lock);
...@@ -126,9 +122,9 @@ MODULE_PARM_DESC(numlbs, " number of pseudo devices"); ...@@ -126,9 +122,9 @@ MODULE_PARM_DESC(numlbs, " number of pseudo devices");
static int fakelb_add_one(struct device *dev) static int fakelb_add_one(struct device *dev)
{ {
struct ieee802154_hw *hw;
struct fakelb_phy *phy; struct fakelb_phy *phy;
int err; int err;
struct ieee802154_hw *hw;
hw = ieee802154_alloc_hw(sizeof(*phy), &fakelb_ops); hw = ieee802154_alloc_hw(sizeof(*phy), &fakelb_ops);
if (!hw) if (!hw)
...@@ -201,8 +197,7 @@ static void fakelb_del(struct fakelb_phy *phy) ...@@ -201,8 +197,7 @@ static void fakelb_del(struct fakelb_phy *phy)
static int fakelb_probe(struct platform_device *pdev) static int fakelb_probe(struct platform_device *pdev)
{ {
struct fakelb_phy *phy, *tmp; struct fakelb_phy *phy, *tmp;
int err = -ENOMEM; int err, i;
int i;
for (i = 0; i < numlbs; i++) { for (i = 0; i < numlbs; i++) {
err = fakelb_add_one(&pdev->dev); err = fakelb_add_one(&pdev->dev);
...@@ -223,10 +218,10 @@ static int fakelb_probe(struct platform_device *pdev) ...@@ -223,10 +218,10 @@ static int fakelb_probe(struct platform_device *pdev)
static int fakelb_remove(struct platform_device *pdev) static int fakelb_remove(struct platform_device *pdev)
{ {
struct fakelb_phy *phy, *temp; struct fakelb_phy *phy, *tmp;
spin_lock(&fakelb_phys_lock); 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); fakelb_del(phy);
spin_unlock(&fakelb_phys_lock); spin_unlock(&fakelb_phys_lock);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment