From nobody Tue Feb 10 21:40:36 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 ED596BA4A for ; Thu, 2 Jan 2025 02:33:11 +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=1735785198; cv=none; b=b5hbarbapz3evJV3BrG8bkd1K/My2z0qN7UV0JP4KagAwcYsXV0DsLZa+rDZlWe5psO+UO9bkUSg9Sc141F6+99n2ig6mxri8qIvSJKvh536IvW/thltvz6/3ZdehF3pUB8kidf29M2ztX8Lmv8YlRkCBSaY7KSHqE/vFfHSCG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735785198; c=relaxed/simple; bh=Vht+EXz+rKwjEG0MWC3QoN3OY04DrgrIWu5Xbq+PbU0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=uSgxuE3Yj7oKdXmWioMdp8P3WFnhVhvWGcqjTgQKzM55GWK+hBphe9n77x2ufdyBUJ57qEeTjJ3RyoeTbpEN7S7dGJ8mG5j7tvI+bJOna/sowehqIEZM1JSZxHxsbhPnogAflRpVpyOcXbaO49pcKUQMDM1VS+TEII87UjWb15M= 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: e5f806d2c8b111efa216b1d71e6e1362-20250102 X-CTIC-Tags: HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NO_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_LANG, HR_SJ_LEN, HR_SJ_LETTER, HR_SJ_NOR_SYM, HR_SJ_PHRASE HR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_AS_FROM, 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.41,REQID:d574fe76-9993-4111-977e-fec511b003a1,IP:0,U RL:0,TC:0,Content:35,EDM:0,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:30 X-CID-INFO: VERSION:1.1.41,REQID:d574fe76-9993-4111-977e-fec511b003a1,IP:0,URL :0,TC:0,Content:35,EDM:0,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:30 X-CID-META: VersionHash:6dc6a47,CLOUDID:229384d6987eb6bf5ee8c9b744993455,BulkI D:241230101136WWCDXQWK,BulkQuantity:1,Recheck:0,SF:17|19|66|78|81|82|102,T C:nil,Content:4|50,EDM:-3,IP:nil,URL:0,File:nil,RT:nil,Bulk:40,QS:nil,BEC: nil,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_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD X-UUID: e5f806d2c8b111efa216b1d71e6e1362-20250102 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 2055933202; Thu, 02 Jan 2025 10:33:06 +0800 From: Pei Xiao To: xiaopei01@kylinos.cn Cc: aford173@gmail.com, aford@beaconembedded.com, arnd@arndb.de, dominique.martinet@atmark-techno.com, frieder.schrempf@kontron.de, geert@linux-m68k.org, kishon@kernel.org, l.stach@pengutronix.de, linux-kernel@vger.kernel.org, linux-phy@lists.infradead.org, m.felsch@pengutronix.de, sandor.yu@nxp.com, u.kleine-koenig@baylibre.com, vkoul@kernel.org Subject: [PATCH] phy: freescale: fsl-samsung-hdmi: fix build error in fsl_samsung_hdmi_phy_configure_pll_lock_det Date: Thu, 2 Jan 2025 10:32:56 +0800 Message-Id: <1a684565d9765e3db49eb504a9cb6bc72a5d4fd1.1735785110.git.xiaopei01@kylinos.cn> X-Mailer: git-send-email 2.25.1 In-Reply-To: <3bcfd31d-0ddb-46a7-9ed8-5b41047d8e69@kylinos.cn> References: <3bcfd31d-0ddb-46a7-9ed8-5b41047d8e69@kylinos.cn> 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 correctly 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, add logical AND to limit 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 --- V2: change to use logical AND --- drivers/phy/freescale/phy-fsl-samsung-hdmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c b/drivers/phy/fre= escale/phy-fsl-samsung-hdmi.c index 5eac70a1e858..7b70ea7b1599 100644 --- a/drivers/phy/freescale/phy-fsl-samsung-hdmi.c +++ b/drivers/phy/freescale/phy-fsl-samsung-hdmi.c @@ -341,7 +341,8 @@ fsl_samsung_hdmi_phy_configure_pll_lock_det(struct fsl_= samsung_hdmi_phy *phy, break; } =20 - writeb(FIELD_PREP(REG12_CK_DIV_MASK, div), phy->regs + PHY_REG(12)); + /*REG12_CK_DIV_MASK only two bit, logical AND to limit range */ + writeb(FIELD_PREP(REG12_CK_DIV_MASK, div & 0x03), phy->regs + PHY_REG(12)= ); =20 /* * Calculation for the frequency lock detector target code (fld_tg_code) --=20 2.25.1