From: Sergio Paracuellos <sergio.paracuellos@gmail.com>
To: gregkh@linuxfoundation.org
Cc: neil@brown.name, driverdev-devel@linuxdriverproject.org
Subject: [PATCH v4 12/15] staging: mt7621-pci: use BIT macro in preprocessor definitions
Date: Mon, 16 Jul 2018 17:53:20 +0200 [thread overview]
Message-ID: <1531756403-7197-13-git-send-email-sergio.paracuellos@gmail.com> (raw)
In-Reply-To: <1531756403-7197-1-git-send-email-sergio.paracuellos@gmail.com>
Some preprocessor definitions are using a custom implementation of
BIT macro. Just use linux kernel BIT macro instead.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
drivers/staging/mt7621-pci/pci-mt7621.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 85ca466..848a04e 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -40,6 +40,7 @@
**************************************************************************
*/
+#include <linux/bitops.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/kernel.h>
@@ -66,15 +67,15 @@
* devices.
*/
-#define RALINK_PCIE0_CLK_EN (1<<24)
-#define RALINK_PCIE1_CLK_EN (1<<25)
-#define RALINK_PCIE2_CLK_EN (1<<26)
+#define RALINK_PCIE0_CLK_EN BIT(24)
+#define RALINK_PCIE1_CLK_EN BIT(25)
+#define RALINK_PCIE2_CLK_EN BIT(26)
#define RALINK_PCI_CONFIG_ADDR 0x20
#define RALINK_PCI_CONFIG_DATA_VIRTUAL_REG 0x24
-#define RALINK_PCIE0_RST (1<<24)
-#define RALINK_PCIE1_RST (1<<25)
-#define RALINK_PCIE2_RST (1<<26)
+#define RALINK_PCIE0_RST BIT(24)
+#define RALINK_PCIE1_RST BIT(25)
+#define RALINK_PCIE2_RST BIT(26)
#define RALINK_PCI_PCICFG_ADDR 0x0000
#define RALINK_PCI_PCIMSK_ADDR 0x000C
@@ -114,11 +115,11 @@
#define RALINK_PCIE_CLK_GEN 0x7c
#define RALINK_PCIE_CLK_GEN1 0x80
//RALINK_RSTCTRL bit
-#define RALINK_PCIE_RST (1<<23)
-#define RALINK_PCI_RST (1<<24)
+#define RALINK_PCIE_RST BIT(23)
+#define RALINK_PCI_RST BIT(24)
//RALINK_CLKCFG1 bit
-#define RALINK_PCI_CLK_EN (1<<19)
-#define RALINK_PCIE_CLK_EN (1<<21)
+#define RALINK_PCI_CLK_EN BIT(19)
+#define RALINK_PCIE_CLK_EN BIT(21)
#define MEMORY_BASE 0x0
static int pcie_link_status = 0;
--
2.7.4
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2018-07-16 15:53 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 15:53 [PATCH v4 00/15] staging: mt7621-pci: avoid custom pci config read and writes Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 01/15] staging: mt7621-pci: use generic kernel pci subsystem read and write Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 02/15] staging: mt7621-pci: remove dead code derived to not use custom reads and writes Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 03/15] staging: mt7621-pci: add pcie_write and pcie_read helpers Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 04/15] staging: mt7621-pci: use pcie_[read|write] in [write|read]_config Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 05/15] staging: mt7621-pci: simplify read_config function Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 06/15] staging: mt7621-pci: simplify write_config function Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 07/15] staging: mt7621-pci: remove unused macros Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 08/15] staging: mt7621-pci: avoid register duplication per controller using pcie_[read|write] Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 09/15] staging: mt7621-pci: remove unused includes Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 10/15] staging: mt7621-pci: use pcie_[read|write] in RALINK_PCI_PCICFG_ADDR and RALINK_PCI_PCIMSK_ADDR Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 11/15] staging: mt7621-pci: remove RALINK_PCI_BASE from remaining definitions Sergio Paracuellos
2018-07-16 15:53 ` Sergio Paracuellos [this message]
2018-07-16 15:53 ` [PATCH v4 13/15] staging: mt7621-pci: rename RALINK_PCI_CONFIG_DATA_VIRTUAL_REG definition Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 14/15] staging: mt7621-pci: remove duplicated include Sergio Paracuellos
2018-07-16 15:53 ` [PATCH v4 15/15] staging: mt7621-pci: remove remaining pci_legacy dependant code Sergio Paracuellos
2018-07-24 22:21 ` [PATCH v4 00/15] staging: mt7621-pci: avoid custom pci config read and writes NeilBrown
2018-07-25 6:14 ` Sergio Paracuellos
2018-07-25 7:47 ` Sergio Paracuellos
2018-07-26 4:50 ` NeilBrown
2018-07-26 5:59 ` Sergio Paracuellos
2018-07-26 6:45 ` NeilBrown
2018-07-26 7:34 ` Sergio Paracuellos
2018-07-26 8:23 ` Sergio Paracuellos
2018-07-26 10:02 ` NeilBrown
2018-07-26 11:24 ` Sergio Paracuellos
2018-07-26 13:11 ` Sergio Paracuellos
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=1531756403-7197-13-git-send-email-sergio.paracuellos@gmail.com \
--to=sergio.paracuellos@gmail.com \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=neil@brown.name \
/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.