From patchwork Fri Aug 31 21:46:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xue Liu X-Patchwork-Id: 10584489 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6EB2F180E for ; Fri, 31 Aug 2018 21:46:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B7E22C44D for ; Fri, 31 Aug 2018 21:46:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F03F2C512; Fri, 31 Aug 2018 21:46:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 032872C44D for ; Fri, 31 Aug 2018 21:46:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727203AbeIAB4M (ORCPT ); Fri, 31 Aug 2018 21:56:12 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43622 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726915AbeIAB4M (ORCPT ); Fri, 31 Aug 2018 21:56:12 -0400 Received: by mail-wr1-f66.google.com with SMTP id k5-v6so12410126wre.10 for ; Fri, 31 Aug 2018 14:46:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=tJD4//cfu6lANccgy9VcJGGS5k87RRnd/XIc4tLf7OA=; b=FmqyIABeB2FKyoYP39LNs6a7xLt3Iy7KB5gfTbFYW8ILfeHTboBO2iHX/4oKc9Uuy9 n7OXKPdGvcJZ05zko94Dof81D/udAfvG/Vq2SROdKYEmyl8ohGVu8wIykPLDnQsFvgcb RxgZItIp+GEksDvZL9nW7YQZawSC4jW3Il+M2NOJ7MNG2f+kER5Ldf8PKJzFC+u0TMiu Dxe4HCIvPd1M+l6EZHyROlMM/BwDvflLy00l6wo+z1L7CQDVzfqe4gW//20J6lG0zSM/ Q9zksn7KQurZw/E29Pb5cFxNySK5sUPyDkQKHqwO25up7t1WsN9NKD3waTBsLn0QKOKO Okag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=tJD4//cfu6lANccgy9VcJGGS5k87RRnd/XIc4tLf7OA=; b=IfEFafJhXqt5DcEstTkOVUl3D/XKr5gTOMNhkm2S7SZ2MO5mMhEuP2ObOPq/jhpm3z MaQmCJuG6UZJcWLy8LKeSdzmId+wb02SXzGUTh2sU2Z65ICma1DB6AF1wBZoS8/cilsT Gq2AD3yNwZyv4NlLqP5YgWR+b9UgLSD1BVIaBCwUfyHm9z4Dbfs8ULndRIS2gil1Kuxb wpFy1BVL0DU5zX/vGMsB8AOMOnpS/AuHmpqxeW+qiid7/V9yN11EsJm+trfWEnXguBEk MpcYiraFxMzH6dK95hFxvCc3R3lXfETRLqH9XcYOKfWSKTbogTk2yF1t60a98ZkxG71F 3Q2g== X-Gm-Message-State: APzg51Dy/2Ks7zJ/w6dSGekHPBe80ci/uxmrJF0SI0DRckbGLrYAj6Wt 0qB6YjO27xpwCjN0asAyE9PUQWivgzw= X-Google-Smtp-Source: ANB0VdbWifjQyC2n5YpyXZcbw3lXbRxLBEgybQRd9gTBrGYkB1B4bBRyoOm8UeAqKHD4ZPhjLfqOig== X-Received: by 2002:adf:ffc7:: with SMTP id x7-v6mr7840098wrs.137.1535752006666; Fri, 31 Aug 2018 14:46:46 -0700 (PDT) Received: from cc-PC.fritz.box (dslb-002-200-211-021.002.200.pools.vodafone-ip.de. [2.200.211.21]) by smtp.googlemail.com with ESMTPSA id j11-v6sm8342064wrr.37.2018.08.31.14.46.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 14:46:45 -0700 (PDT) From: Xue Liu 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 Message-Id: <20180831214642.30711-2-liuxuenetmail@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180831214642.30711-1-liuxuenetmail@gmail.com> References: <20180831214642.30711-1-liuxuenetmail@gmail.com> Sender: linux-wpan-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);