mirror of
https://github.com/torvalds/linux.git
synced 2026-08-07 07:54:18 +02:00
can: rcar_canfd: Update RCANFD_GERFL_ERR macro
Replace the macro RCANFD_GERFL_EEF0_7->RCANFD_GERFL_EEF. The macros RCANFD_GERFL_EEF* in RCANFD_GERFL_ERR can be replaced by FIELD_PREP() and drop the redundant macro RCANFD_GERFL_EEF(ch). Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20250417054320.14100-6-biju.das.jz@bp.renesas.com Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
parent
05e7f5a90c
commit
b75fcf2af2
|
|
@ -21,6 +21,7 @@
|
|||
* wherever it is modified to a readable name.
|
||||
*/
|
||||
|
||||
#include <linux/bitfield.h>
|
||||
#include <linux/bitmap.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/can/dev.h>
|
||||
|
|
@ -74,18 +75,18 @@
|
|||
#define RCANFD_GSTS_GNOPM (BIT(0) | BIT(1) | BIT(2) | BIT(3))
|
||||
|
||||
/* RSCFDnCFDGERFL / RSCFDnGERFL */
|
||||
#define RCANFD_GERFL_EEF0_7 GENMASK(23, 16)
|
||||
#define RCANFD_GERFL_EEF(ch) BIT(16 + (ch))
|
||||
#define RCANFD_GERFL_EEF GENMASK(23, 16)
|
||||
#define RCANFD_GERFL_CMPOF BIT(3) /* CAN FD only */
|
||||
#define RCANFD_GERFL_THLES BIT(2)
|
||||
#define RCANFD_GERFL_MES BIT(1)
|
||||
#define RCANFD_GERFL_DEF BIT(0)
|
||||
|
||||
#define RCANFD_GERFL_ERR(gpriv, x) \
|
||||
((x) & (reg_gen4(gpriv, RCANFD_GERFL_EEF0_7, \
|
||||
RCANFD_GERFL_EEF(0) | RCANFD_GERFL_EEF(1)) | \
|
||||
RCANFD_GERFL_MES | \
|
||||
((gpriv)->fdmode ? RCANFD_GERFL_CMPOF : 0)))
|
||||
({\
|
||||
typeof(gpriv) (_gpriv) = (gpriv); \
|
||||
((x) & ((FIELD_PREP(RCANFD_GERFL_EEF, (_gpriv)->channels_mask)) | \
|
||||
RCANFD_GERFL_MES | ((_gpriv)->fdmode ? RCANFD_GERFL_CMPOF : 0))); \
|
||||
})
|
||||
|
||||
/* AFL Rx rules registers */
|
||||
|
||||
|
|
@ -938,7 +939,7 @@ static void rcar_canfd_global_error(struct net_device *ndev)
|
|||
u32 ridx = ch + RCANFD_RFFIFO_IDX;
|
||||
|
||||
gerfl = rcar_canfd_read(priv->base, RCANFD_GERFL);
|
||||
if (gerfl & RCANFD_GERFL_EEF(ch)) {
|
||||
if (gerfl & FIELD_PREP(RCANFD_GERFL_EEF, BIT(ch))) {
|
||||
netdev_dbg(ndev, "Ch%u: ECC Error flag\n", ch);
|
||||
stats->tx_dropped++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user