Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: airoha: Rely __field_prep for non-constant masks

Rely on __field_prep macros for non-constant masks preparing the values
for register updates instead of open-coding.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260304-airoha-__field_prep-v1-1-b185facc4e2f@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Lorenzo Bianconi and committed by
Jakub Kicinski
7600fb3b 8844de10

+3 -3
+3 -3
drivers/net/ethernet/airoha/airoha_eth.c
··· 1727 1727 airoha_fe_rmw(eth, 1728 1728 REG_SP_DFT_CPORT(src_port >> fls(SP_CPORT_DFT_MASK)), 1729 1729 SP_CPORT_MASK(val), 1730 - FE_PSE_PORT_CDM2 << __ffs(SP_CPORT_MASK(val))); 1730 + __field_prep(SP_CPORT_MASK(val), FE_PSE_PORT_CDM2)); 1731 1731 1732 1732 if (port->id != AIROHA_GDM3_IDX && airoha_is_7581(eth)) 1733 1733 airoha_fe_rmw(eth, REG_SRC_PORT_FC_MAP6, ··· 1781 1781 ppe_id = pse_port == FE_PSE_PORT_PPE2 ? 1 : 0; 1782 1782 airoha_fe_rmw(eth, REG_PPE_DFT_CPORT0(ppe_id), 1783 1783 DFT_CPORT_MASK(port->id), 1784 - fe_cpu_port << __ffs(DFT_CPORT_MASK(port->id))); 1784 + __field_prep(DFT_CPORT_MASK(port->id), fe_cpu_port)); 1785 1785 1786 1786 return 0; 1787 1787 } ··· 2138 2138 2139 2139 airoha_qdma_rmw(port->qdma, REG_CHAN_QOS_MODE(channel >> 3), 2140 2140 CHAN_QOS_MODE_MASK(channel), 2141 - mode << __ffs(CHAN_QOS_MODE_MASK(channel))); 2141 + __field_prep(CHAN_QOS_MODE_MASK(channel), mode)); 2142 2142 2143 2143 return 0; 2144 2144 }