* [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups
@ 2014-12-15 9:25 Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 1/5] at86rf230: remove if branch Alexander Aring
` (5 more replies)
0 siblings, 6 replies; 8+ messages in thread
From: Alexander Aring @ 2014-12-15 9:25 UTC (permalink / raw)
To: linux-wpan; +Cc: kernel, Alexander Aring
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(-)
--
2.1.3
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCHv2 bluetooth-next 1/5] at86rf230: remove if branch
2014-12-15 9:25 [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups Alexander Aring
@ 2014-12-15 9:25 ` Alexander Aring
2014-12-15 9:34 ` Stefan Schmidt
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 2/5] at86rf230: make at86rf230_async_error inline Alexander Aring
` (4 subsequent siblings)
5 siblings, 1 reply; 8+ messages in thread
From: Alexander Aring @ 2014-12-15 9:25 UTC (permalink / raw)
To: linux-wpan; +Cc: kernel, Alexander Aring
This patch removes an unnecessary if branch inside the tx complete
handler.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
---
drivers/net/ieee802154/at86rf230.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 1c01356..434efc5 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -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
--
2.1.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCHv2 bluetooth-next 2/5] at86rf230: make at86rf230_async_error inline
2014-12-15 9:25 [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 1/5] at86rf230: remove if branch Alexander Aring
@ 2014-12-15 9:25 ` Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 3/5] at86rf230: fix context pointer handling Alexander Aring
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2014-12-15 9:25 UTC (permalink / raw)
To: linux-wpan; +Cc: kernel, Alexander Aring
This patch makes the at86rf230_async_error inline. This function is
small enough to handle inline.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Stefan Schmidt <s.schmidt@samsung.com>
---
drivers/net/ieee802154/at86rf230.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 434efc5..8ca4ef6 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -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)
{
--
2.1.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCHv2 bluetooth-next 3/5] at86rf230: fix context pointer handling
2014-12-15 9:25 [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 1/5] at86rf230: remove if branch Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 2/5] at86rf230: make at86rf230_async_error inline Alexander Aring
@ 2014-12-15 9:25 ` Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 4/5] at86rf230: cleanup check on trac status Alexander Aring
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2014-12-15 9:25 UTC (permalink / raw)
To: linux-wpan; +Cc: kernel, Alexander Aring
This 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.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Stefan Schmidt <s.schmidt@samsung.com>
---
drivers/net/ieee802154/at86rf230.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 8ca4ef6..c39466e 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -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);
}
}
--
2.1.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCHv2 bluetooth-next 4/5] at86rf230: cleanup check on trac status
2014-12-15 9:25 [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups Alexander Aring
` (2 preceding siblings ...)
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 3/5] at86rf230: fix context pointer handling Alexander Aring
@ 2014-12-15 9:25 ` Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 5/5] at86rf230: remove unnecessary assign Alexander Aring
2014-12-18 23:21 ` [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups Marcel Holtmann
5 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2014-12-15 9:25 UTC (permalink / raw)
To: linux-wpan; +Cc: kernel, Alexander Aring
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Stefan Schmidt <s.schmidt@samsung.com>
---
drivers/net/ieee802154/at86rf230.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index c39466e..9f61748 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -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);
}
--
2.1.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCHv2 bluetooth-next 5/5] at86rf230: remove unnecessary assign
2014-12-15 9:25 [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups Alexander Aring
` (3 preceding siblings ...)
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 4/5] at86rf230: cleanup check on trac status Alexander Aring
@ 2014-12-15 9:25 ` Alexander Aring
2014-12-18 23:21 ` [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups Marcel Holtmann
5 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2014-12-15 9:25 UTC (permalink / raw)
To: linux-wpan; +Cc: kernel, Alexander Aring
The attribute extra_tx_headroom should already be zero.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Stefan Schmidt <s.schmidt@samsung.com>
---
drivers/net/ieee802154/at86rf230.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 9f61748..577b24e 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -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;
--
2.1.3
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCHv2 bluetooth-next 1/5] at86rf230: remove if branch
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 1/5] at86rf230: remove if branch Alexander Aring
@ 2014-12-15 9:34 ` Stefan Schmidt
0 siblings, 0 replies; 8+ messages in thread
From: Stefan Schmidt @ 2014-12-15 9:34 UTC (permalink / raw)
To: 'Alexander Aring', linux-wpan; +Cc: kernel
Hello.
On 15/12/14 10:25, Alexander Aring wrote:
> This patch removes an unnecessary if branch inside the tx complete
> handler.
>
> Signed-off-by: Alexander Aring <alex.aring@gmail.com>
> ---
> drivers/net/ieee802154/at86rf230.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/net/ieee802154/at86rf230.c
> b/drivers/net/ieee802154/at86rf230.c
> index 1c01356..434efc5 100644
> --- a/drivers/net/ieee802154/at86rf230.c
> +++ b/drivers/net/ieee802154/at86rf230.c
> @@ -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
>
Thanks!
Reviewed-by: Stefan Schmidt <s.schmidt@samsung.com>
regards
Stefan Schmidt
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups
2014-12-15 9:25 [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups Alexander Aring
` (4 preceding siblings ...)
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 5/5] at86rf230: remove unnecessary assign Alexander Aring
@ 2014-12-18 23:21 ` Marcel Holtmann
5 siblings, 0 replies; 8+ messages in thread
From: Marcel Holtmann @ 2014-12-18 23:21 UTC (permalink / raw)
To: Alexander Aring; +Cc: linux-wpan, kernel
Hi Alex,
> 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(-)
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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-12-18 23:21 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-15 9:25 [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 1/5] at86rf230: remove if branch Alexander Aring
2014-12-15 9:34 ` Stefan Schmidt
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 2/5] at86rf230: make at86rf230_async_error inline Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 3/5] at86rf230: fix context pointer handling Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 4/5] at86rf230: cleanup check on trac status Alexander Aring
2014-12-15 9:25 ` [PATCHv2 bluetooth-next 5/5] at86rf230: remove unnecessary assign Alexander Aring
2014-12-18 23:21 ` [PATCHv2 bluetooth-next 0/5] at86rf230: cleanups Marcel Holtmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.