at86rf230: cleanups
Subsystems (2)
Alexander Aring
maintainerv2 cover at86rf230: cleanups
This patch series contains various cleanups for the at86rf230. Except patch 3/5 which contains a fix for a rarely error handling. Because this error handling is very rarely and should only happens if something is wrong with the spi controller, it's okay to fix it in next.
- Alex
changes since v2:
- make patch 1/5 "at86rf230: remove if branch" more human readable.
Alexander Aring (5):
at86rf230: remove if branch
at86rf230: make at86rf230_async_error inline
at86rf230: fix context pointer handling
at86rf230: cleanup check on trac status
at86rf230: remove unnecessary assign
drivers/net/ieee802154/at86rf230.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)
Signature · 1 line
2.1.3
Alexander Aring
maintainerPATCH v2 1/5 at86rf230: remove if branch
This patch removes an unnecessary if branch inside the tx complete handler.
--- drivers/net/ieee802154/at86rf230.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ieee802154/at86rf230.c +1 -4
@@ -715,10 +715,7 @@ at86rf230_tx_complete(void *context)enable_irq (lp->spi->irq); -if (lp->max_frame_retries <=0 ) -ieee802154_xmit_complete (lp->hw, skb, true); -else -ieee802154_xmit_complete (lp->hw, skb, false); +ieee802154_xmit_complete (lp->hw, skb, !lp->tx_aret); } static void
Signature · 1 line
2.1.3
Re: [PATCHv2 bluetooth-next 1/5] at86rf230: remove if branch
Hello.
Quoted 16 lines · Alexander Aring
This patch removes an unnecessary if branch inside the tx complete handler.
Signed-off-by Alexander Aring <[email protected]>--- drivers/net/ieee802154/at86rf230.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)drivers/net/ieee802154/at86rf230.c +0
-0@@ -715,10 +715,7 @@ at86rf230_tx_complete(void *context)
drivers/net/ieee802154/at86rf230.c at86rf230_tx_complete(void *context) · line 721
Quoted 10 lines
drivers/net/ieee802154/at86rf230.c +1
-4enable_irq (lp->spi->irq); -if (lp->max_frame_retries <=0 ) -ieee802154_xmit_complete (lp->hw, skb, true); -else -ieee802154_xmit_complete (lp->hw, skb, false); +ieee802154_xmit_complete (lp->hw, skb, !lp->tx_aret); } static void
Thanks!
regards
Stefan Schmidt
Alexander Aring
maintainerPATCH v2 2/5 at86rf230: make at86rf230_async_error inline
In reply to Alexander AringThis patch makes the at86rf230_async_error inline. This function is small enough to handle inline.
--- drivers/net/ieee802154/at86rf230.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/at86rf230.c +1 -1
@@ -450,7 +450,7 @@ at86rf230_async_error_recover(void *context)ieee802154_wake_queue (lp->hw); } -static void +static inline void at86rf230_async_error (struct at86rf230_local *lp,struct at86rf230_state_change *ctx,int rc) {
Signature · 1 line
2.1.3
Alexander Aring
maintainerPATCH v2 3/5 at86rf230: fix context pointer handling
In reply to Alexander AringThis patch changes the context pointer to the parameter given one inside function at86rf230_async_state_change_start. This could occur problem if context isn't pointed to lp->state.
--- drivers/net/ieee802154/at86rf230.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ieee802154/at86rf230.c +1 -1
@@ -655,7 +655,7 @@ at86rf230_async_state_change_start(void *context)if (ctx->irq_enable)enable_irq (lp->spi->irq); -at86rf230_async_error (lp, &lp->state, rc); +at86rf230_async_error (lp, ctx, rc); } }
Signature · 1 line
2.1.3
Alexander Aring
maintainerPATCH v2 4/5 at86rf230: cleanup check on trac status
In reply to Alexander Aring--- drivers/net/ieee802154/at86rf230.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/net/ieee802154/at86rf230.c +3 -5
@@ -750,13 +750,11 @@ at86rf230_tx_trac_check(void *context)* to STATE_FORCE_TRX_OFF then STATE_TX_ON to recover the transceiver * state to TX_ON. */ -if (trac) { +if (trac)at86rf230_async_state_change (lp, ctx,STATE_FORCE_TRX_OFF , at86rf230_tx_trac_error, true); -return ; - } - -at86rf230_tx_on (context); +else +at86rf230_tx_on (context); }
Signature · 1 line
2.1.3
Alexander Aring
maintainerPATCH v2 5/5 at86rf230: remove unnecessary assign
In reply to Alexander AringThe attribute extra_tx_headroom should already be zero.
--- drivers/net/ieee802154/at86rf230.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ieee802154/at86rf230.c +0 -1
@@ -1405,7 +1405,6 @@ at86rf230_detect_device(struct at86rf230_local *lp)return -EINVAL ; } - lp->hw->extra_tx_headroom =0 ; lp->hw->flags =IEEE802154_HW_TX_OMIT_CKSUM |IEEE802154_HW_AACK |IEEE802154_HW_TXPOWER |IEEE802154_HW_ARET |IEEE802154_HW_AFILT |IEEE802154_HW_PROMISCUOUS ;
Signature · 1 line
2.1.3
Marcel Holtmann
AppliedHi Alex,
Quoted 18 lines
This patch series contains various cleanups for the at86rf230. Except patch 3/5 which contains a fix for a rarely error handling. Because this error handling is very rarely and should only happens if something is wrong with the spi controller, it's okay to fix it in next.
- Alex
changes since v2:
- make patch 1/5 "at86rf230: remove if branch" more human readable.Alexander Aring (5):
at86rf230: remove if branch
at86rf230: makeat86rf230_async_errorinline
at86rf230: fix context pointer handling
at86rf230: cleanup check on trac status
at86rf230: remove unnecessary assign
Quoted 2 lines
drivers/net/ieee802154/at86rf230.c| 18 ++++++------------1 file changed, 6 insertions(+), 12 deletions(-)
I applied patches 1-3 and 5 to bluetooth-next tree.
The patch 4 does not apply and so please re-send a new version.
Regards
Marcel