]> www.infradead.org Git - users/jedix/linux-maple.git/commit
phy: freescale: fsl-samsung-hdmi: Limit PLL lock detection clock divider to valid...
authorPei Xiao <xiaopei01@kylinos.cn>
Tue, 11 Feb 2025 02:29:48 +0000 (10:29 +0800)
committerVinod Koul <vkoul@kernel.org>
Thu, 13 Feb 2025 17:30:45 +0000 (23:00 +0530)
commitcd57e4327707126dca3f9517b84274c001d4c184
tree18f2ddeea7a61ddbf703494574403a15c51535e0
parente2158c953c973adb49383ddea2504faf08d375b7
phy: freescale: fsl-samsung-hdmi: Limit PLL lock detection clock divider to valid range

FIELD_PREP() checks that a value fits into the available bitfield,
but the index div equals to 4,is out of range.

which gcc complains about:
In function ‘fsl_samsung_hdmi_phy_configure_pll_lock_det’,
inlined from ‘fsl_samsung_hdmi_phy_configure’ at
drivers/phy/freescale/phy-fsl-samsung-hdmi.c :470:2:
././include/linux/compiler_types.h:542:38: error: call to ‘__compiletime_assert_538’
declared with attribute error: FIELD_PREP: value too large for the field
  542 |  _compiletime_assert(condition, msg, __compiletime_assert_,
__COUNTER__)
      |                                      ^
././include/linux/compiler_types.h:523:4: note: in definition of
macro ‘__compiletime_assert’ 523 |    prefix ## suffix();
      |    ^~~~~~
././include/linux/compiler_types.h:542:2: note: in expansion of macro
‘_compiletime_assert’
  542 |  _compiletime_assert(condition, msg, __compiletime_assert_,
 __COUNTER__)

REG12_CK_DIV_MASK only two bit, limit div to range 0~3,
so build error will fix.

Fixes: d567679f2b6a ("phy: freescale: fsl-samsung-hdmi: Clean up fld_tg_code calculation")
Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
Changlog:

Reviewed-by: Adam Ford <aford173@gmail.com>
Link: https://lore.kernel.org/r/tencent_6F503D43467AA99DD8CC59B8F645F0725B0A@qq.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/freescale/phy-fsl-samsung-hdmi.c