From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Xue Liu <liuxuenetmail@gmail.com>,
linux-wpan@vger.kernel.org, alex.aring@gmail.com
Subject: Re: [PATCH 1/2] ieee802154: mcr20a: Replace magic number with constants
Date: Thu, 27 Sep 2018 17:27:22 +0200 [thread overview]
Message-ID: <3c1d6d02-8669-62a6-b6bc-adb2a4238908@datenfreihafen.org> (raw)
In-Reply-To: <20180831214642.30711-2-liuxuenetmail@gmail.com>
Hello Xue.
On 31/08/2018 23:46, Xue Liu wrote:
> The combination of defined constants are used to present the
> state of IRQ so the magic numbers has been replaced.
>
> This is a simple coding style change which should have no impact on
> runtime code execution.
>
> Signed-off-by: Xue Liu <liuxuenetmail@gmail.com>
> ---
> drivers/net/ieee802154/mcr20a.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ieee802154/mcr20a.c b/drivers/net/ieee802154/mcr20a.c
> index e428277781ac..04891429a554 100644
> --- a/drivers/net/ieee802154/mcr20a.c
> +++ b/drivers/net/ieee802154/mcr20a.c
> @@ -903,19 +903,19 @@ mcr20a_irq_clean_complete(void *context)
>
> switch (seq_state) {
> /* TX IRQ, RX IRQ and SEQ IRQ */
> - case (0x03):
> + case (DAR_IRQSTS1_TXIRQ | DAR_IRQSTS1_SEQIRQ):
> if (lp->is_tx) {
> lp->is_tx = 0;
> dev_dbg(printdev(lp), "TX is done. No ACK\n");
> mcr20a_handle_tx_complete(lp);
> }
> break;
> - case (0x05):
> + case (DAR_IRQSTS1_RXIRQ | DAR_IRQSTS1_SEQIRQ):
> /* rx is starting */
> dev_dbg(printdev(lp), "RX is starting\n");
> mcr20a_handle_rx(lp);
> break;
> - case (0x07):
> + case (DAR_IRQSTS1_RXIRQ | DAR_IRQSTS1_TXIRQ | DAR_IRQSTS1_SEQIRQ):
> if (lp->is_tx) {
> /* tx is done */
> lp->is_tx = 0;
> @@ -927,7 +927,7 @@ mcr20a_irq_clean_complete(void *context)
> mcr20a_handle_rx(lp);
> }
> break;
> - case (0x01):
> + case (DAR_IRQSTS1_SEQIRQ):
> if (lp->is_tx) {
> dev_dbg(printdev(lp), "TX is starting\n");
> mcr20a_handle_tx(lp);
>
This patch has been applied to the wpan tree and will be
part of the next pull request to net. Thanks!
I decided to put this into wpan directly as it clearly is cleanup
material. The second patch will need to go through wpan-next though.
regards
Stefan Schmidt
next prev parent reply other threads:[~2018-09-27 21:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 21:46 [PATCH 0/2] ieee802154: mcr20a: clean and improve the driver Xue Liu
2018-08-31 21:46 ` [PATCH 1/2] ieee802154: mcr20a: Replace magic number with constants Xue Liu
2018-09-27 15:27 ` Stefan Schmidt [this message]
2018-08-31 21:46 ` [PATCH 2/2] ieee802154: mcr20a: Remove struct mcr20a_platform_data Xue Liu
2018-09-27 15:44 ` Stefan Schmidt
2018-09-27 18:38 ` Xue Liu
2018-09-28 14:10 ` Stefan Schmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3c1d6d02-8669-62a6-b6bc-adb2a4238908@datenfreihafen.org \
--to=stefan@datenfreihafen.org \
--cc=alex.aring@gmail.com \
--cc=linux-wpan@vger.kernel.org \
--cc=liuxuenetmail@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).