All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xue Liu <liuxuenetmail@gmail.com>
To: linux-wpan@vger.kernel.org, stefan@datenfreihafen.org,
	alex.aring@gmail.com
Subject: [PATCH 1/2] ieee802154: mcr20a: Replace magic number with constants
Date: Fri, 31 Aug 2018 23:46:41 +0200	[thread overview]
Message-ID: <20180831214642.30711-2-liuxuenetmail@gmail.com> (raw)
In-Reply-To: <20180831214642.30711-1-liuxuenetmail@gmail.com>

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);
-- 
2.17.0

  reply	other threads:[~2018-09-01  1:56 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 ` Xue Liu [this message]
2018-09-27 15:27   ` [PATCH 1/2] ieee802154: mcr20a: Replace magic number with constants Stefan Schmidt
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=20180831214642.30711-2-liuxuenetmail@gmail.com \
    --to=liuxuenetmail@gmail.com \
    --cc=alex.aring@gmail.com \
    --cc=linux-wpan@vger.kernel.org \
    --cc=stefan@datenfreihafen.org \
    /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 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.