From 4294e5ea1da4052818d1f57466c25ec75bc6283a Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Fri, 8 Oct 2021 16:55:56 -0700 Subject: [PATCH] Use BIT macros --- modules/mqnic/mqnic_board.c | 4 ++-- modules/mqnic/mqnic_ethtool.c | 8 ++++---- modules/mqnic/mqnic_hw.h | 21 +++++++++++---------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/modules/mqnic/mqnic_board.c b/modules/mqnic/mqnic_board.c index a2894a7f9..f2b8b596f 100644 --- a/modules/mqnic/mqnic_board.c +++ b/modules/mqnic/mqnic_board.c @@ -599,9 +599,9 @@ static int mqnic_gecko_bmc_read(struct mqnic_dev *mqnic) while (1) { val = ioread32(mqnic->hw_addr+0x188); - if (val & (1 << 19)) + if (val & BIT(19)) { - if (val & (1 << 18)) + if (val & BIT(18)) { // timed out dev_warn(mqnic->dev, "Timed out waiting for Gecko BMC response"); diff --git a/modules/mqnic/mqnic_ethtool.c b/modules/mqnic/mqnic_ethtool.c index 524124852..ac6a174ca 100644 --- a/modules/mqnic/mqnic_ethtool.c +++ b/modules/mqnic/mqnic_ethtool.c @@ -68,12 +68,12 @@ static int mqnic_get_ts_info(struct net_device *ndev, struct ethtool_ts_info *in SOF_TIMESTAMPING_RAW_HARDWARE; info->tx_types = - (1 << HWTSTAMP_TX_OFF) | - (1 << HWTSTAMP_TX_ON); + BIT(HWTSTAMP_TX_OFF) | + BIT(HWTSTAMP_TX_ON); info->rx_filters = - (1 << HWTSTAMP_FILTER_NONE) | - (1 << HWTSTAMP_FILTER_ALL); + BIT(HWTSTAMP_FILTER_NONE) | + BIT(HWTSTAMP_FILTER_ALL); if (mdev->ptp_clock) info->phc_index = ptp_clock_index(mdev->ptp_clock); diff --git a/modules/mqnic/mqnic_hw.h b/modules/mqnic/mqnic_hw.h index 337d111f1..78df501d3 100644 --- a/modules/mqnic/mqnic_hw.h +++ b/modules/mqnic/mqnic_hw.h @@ -35,6 +35,7 @@ either expressed or implied, of The Regents of the University of California. #define MQNIC_HW_H #include +#include #define MQNIC_MAX_IF 8 #define MQNIC_MAX_PORTS 8 @@ -169,11 +170,11 @@ either expressed or implied, of The Regents of the University of California. #define MQNIC_IF_REG_PORT_OFFSET 0x0044 #define MQNIC_IF_REG_PORT_STRIDE 0x0048 -#define MQNIC_IF_FEATURE_RSS (1 << 0) -#define MQNIC_IF_FEATURE_PTP_TS (1 << 4) -#define MQNIC_IF_FEATURE_TX_CSUM (1 << 8) -#define MQNIC_IF_FEATURE_RX_CSUM (1 << 9) -#define MQNIC_IF_FEATURE_RX_HASH (1 << 10) +#define MQNIC_IF_FEATURE_RSS BIT(0) +#define MQNIC_IF_FEATURE_PTP_TS BIT(4) +#define MQNIC_IF_FEATURE_TX_CSUM BIT(8) +#define MQNIC_IF_FEATURE_RX_CSUM BIT(9) +#define MQNIC_IF_FEATURE_RX_HASH BIT(10) // Port CSRs #define MQNIC_PORT_REG_PORT_ID 0x0000 @@ -211,11 +212,11 @@ either expressed or implied, of The Regents of the University of California. #define MQNIC_PORT_REG_TDMA_ACTIVE_PERIOD_SEC_L 0x1048 #define MQNIC_PORT_REG_TDMA_ACTIVE_PERIOD_SEC_H 0x104C -#define MQNIC_PORT_FEATURE_RSS (1 << 0) -#define MQNIC_PORT_FEATURE_PTP_TS (1 << 4) -#define MQNIC_PORT_FEATURE_TX_CSUM (1 << 8) -#define MQNIC_PORT_FEATURE_RX_CSUM (1 << 9) -#define MQNIC_PORT_FEATURE_RX_HASH (1 << 10) +#define MQNIC_PORT_FEATURE_RSS BIT(0) +#define MQNIC_PORT_FEATURE_PTP_TS BIT(4) +#define MQNIC_PORT_FEATURE_TX_CSUM BIT(8) +#define MQNIC_PORT_FEATURE_RX_CSUM BIT(9) +#define MQNIC_PORT_FEATURE_RX_HASH BIT(10) #define MQNIC_QUEUE_STRIDE 0x00000020 #define MQNIC_CPL_QUEUE_STRIDE 0x00000020