* [PATCH V5] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det
@ 2025-01-13 8:34 xiaopeitux
2025-01-17 1:59 ` Adam Ford
0 siblings, 1 reply; 7+ messages in thread
From: xiaopeitux @ 2025-01-13 8:34 UTC (permalink / raw)
To: =vkoul, aford173, geert, linux-phy, linux-kernel; +Cc: Pei Xiao
From: Pei Xiao <xiaopei01@kylinos.cn>
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:
---
V5: add return ret from Geert suggestion
V4: change to use if statement
V3: change to use do-while
V2: change to use logical AND
---
drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
index 5eac70a1e858..6817ceabaab4 100644
--- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
+++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
@@ -325,7 +325,7 @@ to_fsl_samsung_hdmi_phy(struct clk_hw *hw)
return container_of(hw, struct fsl_samsung_hdmi_phy, hw);
}
-static void
+static int
fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
const struct phy_config *cfg)
{
@@ -341,6 +341,9 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
break;
}
+ if (unlikely(div == 4))
+ return -EINVAL;
+
writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12));
/*
@@ -364,6 +367,8 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
FIELD_PREP(REG14_RP_CODE_MASK, 2) |
FIELD_PREP(REG14_TG_CODE_HIGH_MASK, fld_tg_code >> 8),
phy->regs + PHY_REG(14));
+
+ return 0;
}
static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u16 *m, u8 *s)
@@ -467,7 +472,11 @@ static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
writeb(REG21_SEL_TX_CK_INV | FIELD_PREP(REG21_PMS_S_MASK,
cfg->pll_div_regs[2] >> 4), phy->regs + PHY_REG(21));
- fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
+ ret = fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
+ if (ret) {
+ dev_err(phy->dev, "pixclock too large\n");
+ return ret;
+ }
writeb(REG33_FIX_DA | REG33_MODE_SET_DONE, phy->regs + PHY_REG(33));
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH V5] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det
2025-01-13 8:34 [PATCH V5] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det xiaopeitux
@ 2025-01-17 1:59 ` Adam Ford
2025-01-17 2:15 ` Pei Xiao
2025-02-07 15:40 ` Adam Ford
0 siblings, 2 replies; 7+ messages in thread
From: Adam Ford @ 2025-01-17 1:59 UTC (permalink / raw)
To: xiaopeitux; +Cc: =vkoul, geert, linux-phy, linux-kernel, Pei Xiao
On Mon, Jan 13, 2025 at 2:41 AM <xiaopeitux@foxmail.com> wrote:
>
> From: Pei Xiao <xiaopei01@kylinos.cn>
>
> 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.
>
LGTM.
Reviewed-by: Adam Ford <aford173@gmail.com>
> Fixes: d567679f2b6a ("phy: freescale: fsl-samsung-hdmi: Clean up fld_tg_code calculation")
> Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
>
> Changlog:
> ---
> V5: add return ret from Geert suggestion
> V4: change to use if statement
> V3: change to use do-while
> V2: change to use logical AND
> ---
> drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> index 5eac70a1e858..6817ceabaab4 100644
> --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> @@ -325,7 +325,7 @@ to_fsl_samsung_hdmi_phy(struct clk_hw *hw)
> return container_of(hw, struct fsl_samsung_hdmi_phy, hw);
> }
>
> -static void
> +static int
> fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
> const struct phy_config *cfg)
> {
> @@ -341,6 +341,9 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
> break;
> }
>
> + if (unlikely(div == 4))
> + return -EINVAL;
> +
> writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12));
>
> /*
> @@ -364,6 +367,8 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
> FIELD_PREP(REG14_RP_CODE_MASK, 2) |
> FIELD_PREP(REG14_TG_CODE_HIGH_MASK, fld_tg_code >> 8),
> phy->regs + PHY_REG(14));
> +
> + return 0;
> }
>
> static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u16 *m, u8 *s)
> @@ -467,7 +472,11 @@ static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
> writeb(REG21_SEL_TX_CK_INV | FIELD_PREP(REG21_PMS_S_MASK,
> cfg->pll_div_regs[2] >> 4), phy->regs + PHY_REG(21));
>
> - fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
> + ret = fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
> + if (ret) {
> + dev_err(phy->dev, "pixclock too large\n");
> + return ret;
> + }
>
> writeb(REG33_FIX_DA | REG33_MODE_SET_DONE, phy->regs + PHY_REG(33));
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V5] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det
2025-01-17 1:59 ` Adam Ford
@ 2025-01-17 2:15 ` Pei Xiao
2025-02-10 17:02 ` Vinod Koul
2025-02-07 15:40 ` Adam Ford
1 sibling, 1 reply; 7+ messages in thread
From: Pei Xiao @ 2025-01-17 2:15 UTC (permalink / raw)
To: xiaopeitux; +Cc: vkoul, linux-kernel
在 2025/1/17 09:59, Adam Ford 写道:
> On Mon, Jan 13, 2025 at 2:41 AM <xiaopeitux@foxmail.com> wrote:
>> From: Pei Xiao <xiaopei01@kylinos.cn>
>>
>> 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.
>>
> LGTM.
>
> Reviewed-by: Adam Ford <aford173@gmail.com>
loop Vkoul for email address was written incorrectly.
>> Fixes: d567679f2b6a ("phy: freescale: fsl-samsung-hdmi: Clean up fld_tg_code calculation")
>> Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
>>
>> Changlog:
>> ---
>> V5: add return ret from Geert suggestion
>> V4: change to use if statement
>> V3: change to use do-while
>> V2: change to use logical AND
>> ---
>> drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 13 +++++++++++--
>> 1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
>> index 5eac70a1e858..6817ceabaab4 100644
>> --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
>> +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
>> @@ -325,7 +325,7 @@ to_fsl_samsung_hdmi_phy(struct clk_hw *hw)
>> return container_of(hw, struct fsl_samsung_hdmi_phy, hw);
>> }
>>
>> -static void
>> +static int
>> fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
>> const struct phy_config *cfg)
>> {
>> @@ -341,6 +341,9 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
>> break;
>> }
>>
>> + if (unlikely(div == 4))
>> + return -EINVAL;
>> +
>> writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12));
>>
>> /*
>> @@ -364,6 +367,8 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
>> FIELD_PREP(REG14_RP_CODE_MASK, 2) |
>> FIELD_PREP(REG14_TG_CODE_HIGH_MASK, fld_tg_code >> 8),
>> phy->regs + PHY_REG(14));
>> +
>> + return 0;
>> }
>>
>> static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u16 *m, u8 *s)
>> @@ -467,7 +472,11 @@ static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
>> writeb(REG21_SEL_TX_CK_INV | FIELD_PREP(REG21_PMS_S_MASK,
>> cfg->pll_div_regs[2] >> 4), phy->regs + PHY_REG(21));
>>
>> - fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
>> + ret = fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
>> + if (ret) {
>> + dev_err(phy->dev, "pixclock too large\n");
>> + return ret;
>> + }
>>
>> writeb(REG33_FIX_DA | REG33_MODE_SET_DONE, phy->regs + PHY_REG(33));
>>
>> --
>> 2.25.1
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V5] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det
2025-01-17 1:59 ` Adam Ford
2025-01-17 2:15 ` Pei Xiao
@ 2025-02-07 15:40 ` Adam Ford
1 sibling, 0 replies; 7+ messages in thread
From: Adam Ford @ 2025-02-07 15:40 UTC (permalink / raw)
To: xiaopeitux, Vinod Koul; +Cc: geert, linux-phy, linux-kernel, Pei Xiao
On Thu, Jan 16, 2025 at 7:59 PM Adam Ford <aford173@gmail.com> wrote:
>
> On Mon, Jan 13, 2025 at 2:41 AM <xiaopeitux@foxmail.com> wrote:
> >
> > From: Pei Xiao <xiaopei01@kylinos.cn>
> >
> > 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.
> >
> LGTM.
>
> Reviewed-by: Adam Ford <aford173@gmail.com>
Vinod,
Any chance this can get pulled into your phy branch? Several people
have responded indicating some compilers throw build errors, and I
think this is intended to fix that.
adam
>
> > Fixes: d567679f2b6a ("phy: freescale: fsl-samsung-hdmi: Clean up fld_tg_code calculation")
> > Signed-off-by: Pei Xiao <xiaopei01@kylinos.cn>
> >
> > Changlog:
> > ---
> > V5: add return ret from Geert suggestion
> > V4: change to use if statement
> > V3: change to use do-while
> > V2: change to use logical AND
> > ---
> > drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 13 +++++++++++--
> > 1 file changed, 11 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> > index 5eac70a1e858..6817ceabaab4 100644
> > --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> > +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c
> > @@ -325,7 +325,7 @@ to_fsl_samsung_hdmi_phy(struct clk_hw *hw)
> > return container_of(hw, struct fsl_samsung_hdmi_phy, hw);
> > }
> >
> > -static void
> > +static int
> > fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
> > const struct phy_config *cfg)
> > {
> > @@ -341,6 +341,9 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
> > break;
> > }
> >
> > + if (unlikely(div == 4))
> > + return -EINVAL;
> > +
> > writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12));
> >
> > /*
> > @@ -364,6 +367,8 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_samsung_hdmi_phy *phy,
> > FIELD_PREP(REG14_RP_CODE_MASK, 2) |
> > FIELD_PREP(REG14_TG_CODE_HIGH_MASK, fld_tg_code >> 8),
> > phy->regs + PHY_REG(14));
> > +
> > + return 0;
> > }
> >
> > static unsigned long fsl_samsung_hdmi_phy_find_pms(unsigned long fout, u8 *p, u16 *m, u8 *s)
> > @@ -467,7 +472,11 @@ static int fsl_samsung_hdmi_phy_configure(struct fsl_samsung_hdmi_phy *phy,
> > writeb(REG21_SEL_TX_CK_INV | FIELD_PREP(REG21_PMS_S_MASK,
> > cfg->pll_div_regs[2] >> 4), phy->regs + PHY_REG(21));
> >
> > - fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
> > + ret = fsl_samsung_hdmi_phy_configure_pll_lock_det(phy, cfg);
> > + if (ret) {
> > + dev_err(phy->dev, "pixclock too large\n");
> > + return ret;
> > + }
> >
> > writeb(REG33_FIX_DA | REG33_MODE_SET_DONE, phy->regs + PHY_REG(33));
> >
> > --
> > 2.25.1
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V5] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det
2025-01-17 2:15 ` Pei Xiao
@ 2025-02-10 17:02 ` Vinod Koul
2025-02-11 2:10 ` Pei Xiao
0 siblings, 1 reply; 7+ messages in thread
From: Vinod Koul @ 2025-02-10 17:02 UTC (permalink / raw)
To: Pei Xiao; +Cc: xiaopeitux, linux-kernel
On 17-01-25, 10:15, Pei Xiao wrote:
>
> 在 2025/1/17 09:59, Adam Ford 写道:
> > On Mon, Jan 13, 2025 at 2:41 AM <xiaopeitux@foxmail.com> wrote:
> >> From: Pei Xiao <xiaopei01@kylinos.cn>
> >>
> >> 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.
> >>
> > LGTM.
> >
> > Reviewed-by: Adam Ford <aford173@gmail.com>
> loop Vkoul for email address was written incorrectly.
Thanks for looping in!
Change looks good to me. Can you please revise the patch title. A patch
title should describe the change we are making. Fix build error is not
an apt title
--
~Vinod
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V5] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det
2025-02-10 17:02 ` Vinod Koul
@ 2025-02-11 2:10 ` Pei Xiao
2025-02-11 10:47 ` Vinod Koul
0 siblings, 1 reply; 7+ messages in thread
From: Pei Xiao @ 2025-02-11 2:10 UTC (permalink / raw)
To: Vinod Koul, vkoul; +Cc: xiaopeitux, linux-kernel
在 2025/2/11 01:02, Vinod Koul 写道:
> On 17-01-25, 10:15, Pei Xiao wrote:
>> 在 2025/1/17 09:59, Adam Ford 写道:
>>> On Mon, Jan 13, 2025 at 2:41 AM <xiaopeitux@foxmail.com> wrote:
>>>> From: Pei Xiao <xiaopei01@kylinos.cn>
>>>>
>>>> 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.
>>>>
>>> LGTM.
>>>
>>> Reviewed-by: Adam Ford <aford173@gmail.com>
>> loop Vkoul for email address was written incorrectly.
> Thanks for looping in!
>
> Change looks good to me. Can you please revise the patch title. A patch
> title should describe the change we are making. Fix build error is not
> an apt title
there so many "Fix build error" : https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/?qt=grep&q=fix+build+error
what we should revise?
Like:*phy: freescale: fsl-samsung-hdmi: Limit PLL lock detection clock divider to valid range*
if you approve,I will send V6 for the title,or any advice?
Pei,
Thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH V5] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det
2025-02-11 2:10 ` Pei Xiao
@ 2025-02-11 10:47 ` Vinod Koul
0 siblings, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2025-02-11 10:47 UTC (permalink / raw)
To: Pei Xiao; +Cc: xiaopeitux, linux-kernel
On 11-02-25, 10:10, Pei Xiao wrote:
>
> 在 2025/2/11 01:02, Vinod Koul 写道:
> > On 17-01-25, 10:15, Pei Xiao wrote:
> >> 在 2025/1/17 09:59, Adam Ford 写道:
> >>> On Mon, Jan 13, 2025 at 2:41 AM <xiaopeitux@foxmail.com> wrote:
> >>>> From: Pei Xiao <xiaopei01@kylinos.cn>
> >>>>
> >>>> 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.
> >>>>
> >>> LGTM.
> >>>
> >>> Reviewed-by: Adam Ford <aford173@gmail.com>
> >> loop Vkoul for email address was written incorrectly.
> > Thanks for looping in!
> >
> > Change looks good to me. Can you please revise the patch title. A patch
> > title should describe the change we are making. Fix build error is not
> > an apt title
>
> there so many "Fix build error" : https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/?qt=grep&q=fix+build+error
>
> what we should revise?
>
> Like:*phy: freescale: fsl-samsung-hdmi: Limit PLL lock detection clock divider to valid range*
That sounds better
--
~Vinod
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-02-11 10:47 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-13 8:34 [PATCH V5] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det xiaopeitux
2025-01-17 1:59 ` Adam Ford
2025-01-17 2:15 ` Pei Xiao
2025-02-10 17:02 ` Vinod Koul
2025-02-11 2:10 ` Pei Xiao
2025-02-11 10:47 ` Vinod Koul
2025-02-07 15:40 ` Adam Ford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox