mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-30 05:42:46 +01:00
phy: mediatek: fix build warning of FIELD_PREP()
Change the inline function mtk_phy_update_field() into a macro to
avoid check warning of FIELD_PREP() with compiler parameter
-Wtautological-constant-out-of-range-compare
the warning is caused by mask check:
"BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \"
Fixes: 29c0747755 ("phy: mediatek: add a new helper to update bitfield")
Reported-by: kernel test robot <[email protected]>
Signed-off-by: Chunfeng Yun <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
This commit is contained in:
1 parent
add7000bdd
commit
84513eccd6
1 file changed
+6
-5
@@ -36,10 +36,11 @@ static inline void mtk_phy_update_bits(void __iomem *reg, u32 mask, u32 val)
|
||||
writel(tmp, reg);
|
||||
}
|
||||
|
||||
/* field @mask should be constant and continuous */
|
||||
static inline void mtk_phy_update_field(void __iomem *reg, u32 mask, u32 val)
|
||||
{
|
||||
mtk_phy_update_bits(reg, mask, FIELD_PREP(mask, val));
|
||||
}
|
||||
/* field @mask shall be constant and continuous */
|
||||
#define mtk_phy_update_field(reg, mask, val) \
|
||||
({ \
|
||||
typeof(mask) mask_ = (mask); \
|
||||
mtk_phy_update_bits(reg, mask_, FIELD_PREP(mask_, val)); \
|
||||
})
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user