From nobody Mon Feb 9 05:51:45 2026 Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E5360BA33 for ; Fri, 10 Jan 2025 02:33:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736476390; cv=none; b=FMUwQoqu596kJ3Ibxc+fASntULMfjfH0oKHKib1K0fDFUKZ2Ls7VBA3Qg7q7FnNLK6/o/uUJB1QDIyJsmy+BxX2wDPXFX3kAtZeX+66wJjD+djM3cDBgaNzptMcn/HFRjR+IgKwBNd1bhjfHsUzfLAOf74xJKA/M8KaVDkpDDcg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736476390; c=relaxed/simple; bh=YBLkPcD0DKJ8OM7mXBR2SnkjyTbw3soroJvAK20s3vw=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=j1uuE8fQlLxhc/klxyLNMD1bkixAfN5GfLyb/z1G5U2IXp6UshCEJrR1IPr1BjfZJkwhbsev2gpCod5I7XZwjQewCQ78+a9f3/AJSWiBSrxbZvSc1KuzQBZ2sDTASIiVdgJmW1QdHM8iSsFeYJY7vWQr36MEjvSUzNklzC3jsO0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 30c17e60cefb11efa216b1d71e6e1362-20250110 X-CTIC-Tags: HR_CC_AS_FROM, HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CTE_8B HR_CTT_TXT, HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_DIGIT_LEN HR_FROM_NAME, HR_SJ_DIGIT_LEN, HR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER HR_SJ_NOR_SYM, HR_SJ_PHRASE, HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT HR_TO_DOMAIN_COUNT, HR_TO_NO_NAME, IP_TRUSTED, SRC_TRUSTED, DN_TRUSTED SA_TRUSTED, SA_EXISTED, SN_TRUSTED, SN_EXISTED, SPF_NOPASS DKIM_NOPASS, DMARC_NOPASS, CIE_BAD, CIE_GOOD_SPF, GTI_FG_BS GTI_RG_INFO, GTI_C_BU, AMN_T1, AMN_GOOD, AMN_C_TI AMN_C_BU X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.45,REQID:64331003-8298-4d7a-b360-d3943c19acf7,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-INFO: VERSION:1.1.45,REQID:64331003-8298-4d7a-b360-d3943c19acf7,IP:0,URL :0,TC:0,Content:0,EDM:0,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTION:r elease,TS:-5 X-CID-META: VersionHash:6493067,CLOUDID:db3af771b26011a74e3b11b3e5216848,BulkI D:250110103254EUNKUCQP,BulkQuantity:0,Recheck:0,SF:17|19|38|66|78|102,TC:n il,Content:0|50,EDM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:ni l,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_FSD,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS X-UUID: 30c17e60cefb11efa216b1d71e6e1362-20250110 X-User: xiaopei01@kylinos.cn Received: from localhost.localdomain [(10.44.16.150)] by mailgw.kylinos.cn (envelope-from ) (Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256) with ESMTP id 551830683; Fri, 10 Jan 2025 10:32:52 +0800 From: Pei Xiao To: vkoul@kernel.org, aford173@gmail.com, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Pei Xiao Subject: [PATCH V3] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det Date: Fri, 10 Jan 2025 10:32:47 +0800 Message-Id: <5b9a5f765f075263498f9a7b62b0b1030d87b6ba.1736476210.git.xiaopei01@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 =E2=80=98fsl_samsung_hdmi_phy_configure_pll_lock_det=E2=80=99, inlined from =E2=80=98fsl_samsung_hdmi_phy_configure=E2=80=99 at drivers/phy/freescale/phy-fsl-samsung-hdmi.c :470:2: ././include/linux/compiler_types.h:542:38: error: call to =E2=80=98__compil= etime_assert_538=E2=80=99 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 =E2=80=98__compiletime_assert=E2=80=99 523 | prefix ## suffix(); | ^~~~~~ ././include/linux/compiler_types.h:542:2: note: in expansion of macro =E2=80=98_compiletime_assert=E2=80=99 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_cod= e calculation") Signed-off-by: Pei Xiao --- V3: change to use do-while V2: change to use logical AND --- drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/fre= escale/phy-fsl-samsung-hdmi.c index 5eac70a1e858..aa233ca25a4d 100644 --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c @@ -332,14 +332,15 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fs= l_samsung_hdmi_phy *phy, u32 pclk =3D cfg->pixclk; u32 fld_tg_code; u32 int_pllclk; - u8 div; + u8 div =3D 0; =20 /* Find int_pllclk speed */ - for (div =3D 0; div < 4; div++) { + do { int_pllclk =3D pclk / (1 << div); - if (int_pllclk < (50 * MHZ)) + if (int_pllclk < (50 * MHZ) || div >=3D 3) break; - } + div++; + } while (1); =20 writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12)); =20 --=20 2.25.1