[PATCH] phy: mediatek: Avoid floating point constants
AngeloGioacchino Del Regno
angelogioacchino.delregno at collabora.com
Wed Apr 19 05:29:08 PDT 2023
Il 19/04/23 14:21, Thierry Reding ha scritto:
> From: Thierry Reding <treding at nvidia.com>
>
> When building with old versions of GCC (6.3 in this case), the compiler
> stumbles over the floating point constants in this driver:
>
> drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c: In function ‘mtk_hdmi_pll_prepare’:
> drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:331:23: error: ‘-mgeneral-regs-only’ is incompatible with floating-point code
> } else if (pixel_clk >= 74.175 * MEGA && pixel_clk <= 300 * MEGA) {
>
> drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:361:12: error: ‘-mgeneral-regs-only’ is incompatible with floating-point code
> static int mtk_hdmi_pll_prepare(struct clk_hw *hw)
> ^~~~~~~~~~~~~~~~~~~~
> drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:361:12: error: ‘-mgeneral-regs-only’ is incompatible with floating-point code
>
> Fix this by switching to the KILO macro instead and multiplying the
> constants by 1000 to get rid of the floating point.
>
> Fixes: 45810d486bb4 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195")
> Reported-by: Jonathan Hunter <jonathanh at nvidia.com>
> Signed-off-by: Thierry Reding <treding at nvidia.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno at collabora.com>
More information about the Linux-mediatek
mailing list