Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5053039rwr; Sun, 30 Apr 2023 22:15:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ogHb9oHl7FiUedSrC7HSJZ+ZPY3V5XN+lD46hTZ9yA06uy9hrhYtFB0WY7c6DXycloyZr X-Received: by 2002:a05:6a20:8403:b0:f6:d60d:dbc2 with SMTP id c3-20020a056a20840300b000f6d60ddbc2mr16242881pzd.28.1682918124288; Sun, 30 Apr 2023 22:15:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682918124; cv=none; d=google.com; s=arc-20160816; b=DjJeYfvud8rPeAKLz1IGWL/j9MswPnzrYQjqmHXqEXlJ1FZaRLr2l1q+alzhZ0CC19 u2j7QB7ceZKS5rcMyzN76vKflOrp2gaJqZwrW0Vv94phM8oaQS2be73eXGiIoD5dhqXH /6+IEAmaQl8q2sPl/WZ847ylVljE34pFg3Rk7uDNVj2Yi4dfIatJaKNrd267jRH53ydP IP9LSmSim5mVMUXKA9NtStDqnz00J4kOnWzjxbo2qpnIJwEAei0Tokg3kTw0B0NR+KkE fSSf5wSy70gWCahWALE+Un8EtZdArxPYXn37ZpJTwlCbwpu23NkwTcWnBeslalwW+rOl QHiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bd1OqNxrY+Wc7yTjEuF/vCnYa/8bCtAXbutPvq/tlVg=; b=06iHnGlNyNc8/umvhP4fMC9KGQAO7qNc9dCzV1m3UGJ3OYMuVFCa1IRhi6JjuFcJ8H e/2e0Qopeg1AfXHXT3Hydk3f5Q20nDgNHDSSlWf8Lf7A71onH54rtGdW/Kfbl7YwKKPw 0QlNH2j90RnCLdfEkSMY/ugV0uKrTcCbC/iVXQe9ahXIPBHuSe0mrRbDN7UzN/6MPfE0 GXN4tgbZvfAbUh2J3LwlnyXkb3OERNNad0R+67r9nlAhvqZBemJ0BBFZbcRRzkH4O0X6 P9u5z+aludLjwmbLkor6oO0+H7Oeqsg0DnaqzoG9lPWUdCMQKPLkxaXxqHpPZ28GJNik l6Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D6H4XGx6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a17090abc4b00b00247398cd640si7870338pjv.76.2023.04.30.22.15.07; Sun, 30 Apr 2023 22:15:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=D6H4XGx6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229663AbjEAFPF (ORCPT + 99 others); Mon, 1 May 2023 01:15:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229519AbjEAFPE (ORCPT ); Mon, 1 May 2023 01:15:04 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69CCC1710 for ; Sun, 30 Apr 2023 22:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1682918102; x=1714454102; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Ux9Ts+3V9zBCVDNMcJUyurtBq8zr7ey0DE6a6V0SDgM=; b=D6H4XGx6oFigtqgaO5WMmsr/YrIwMxK5/L6MrH9xZYiLZriPV4a0NfSJ eyaFl4BRCph9iHGbwGf5UoVjWAGS8olv15G7VVr+z17lYhL3VPtfGfeMP o7RsCZwKCKfhEemlzzFe2JeCGMjHZqUC/8rjCRlyMjEm/A2HUuKEg6knB Aq4FMP8aSZDPvkVMPV7ka1erVPnVqS7SvRX1qv8GbSy+cOb0cXhW/y7aC s94XkyrRxa1OBjeZzlVsczRY2G/PTSdxRb8HvGMEVRwT4YrYyLopbHVdu uqktSzhUncX4MThKKTWe6dWxabhQqxLYfQJvq7ZYK+oyA6a3mdtm2Qcr4 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10696"; a="376132465" X-IronPort-AV: E=Sophos;i="5.99,239,1677571200"; d="scan'208";a="376132465" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2023 22:15:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10696"; a="765181857" X-IronPort-AV: E=Sophos;i="5.99,239,1677571200"; d="scan'208";a="765181857" Received: from lkp-server01.sh.intel.com (HELO e3434d64424d) ([10.239.97.150]) by fmsmga004.fm.intel.com with ESMTP; 30 Apr 2023 22:14:58 -0700 Received: from kbuild by e3434d64424d with local (Exim 4.96) (envelope-from ) id 1ptLsH-0000JV-23; Mon, 01 May 2023 05:14:57 +0000 Date: Mon, 1 May 2023 13:14:51 +0800 From: kernel test robot To: Tom Rix , chunkuang.hu@kernel.org, p.zabel@pengutronix.de, chunfeng.yun@mediatek.com, vkoul@kernel.org, kishon@kernel.org, matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev, Tom Rix , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] phy: mediatek: rework the floating point comparisons to fixed point Message-ID: <202305011302.fwiJuq8v-lkp@intel.com> References: <20230501025716.2905609-1-trix@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230501025716.2905609-1-trix@redhat.com> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tom, kernel test robot noticed the following build warnings: [auto build test WARNING on next-20230428] [cannot apply to linus/master pza/reset/next pza/imx-drm/next mbgg-mediatek/for-next v6.3 v6.3-rc7 v6.3-rc6 v6.3] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Tom-Rix/phy-mediatek-rework-the-floating-point-comparisons-to-fixed-point/20230501-110044 base: next-20230428 patch link: https://lore.kernel.org/r/20230501025716.2905609-1-trix%40redhat.com patch subject: [PATCH] phy: mediatek: rework the floating point comparisons to fixed point config: arm64-randconfig-r026-20230430 (https://download.01.org/0day-ci/archive/20230501/202305011302.fwiJuq8v-lkp@intel.com/config) compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project b1465cd49efcbc114a75220b153f5a055ce7911f) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://github.com/intel-lab-lkp/linux/commit/7a707b74a3a3ce9d018ee340e478e5c75301c894 git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review Tom-Rix/phy-mediatek-rework-the-floating-point-comparisons-to-fixed-point/20230501-110044 git checkout 7a707b74a3a3ce9d018ee340e478e5c75301c894 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 olddefconfig COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/phy/mediatek/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot | Link: https://lore.kernel.org/oe-kbuild-all/202305011302.fwiJuq8v-lkp@intel.com/ All warnings (new ones prefixed by >>): drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: warning: variable 'ret' is uninitialized when used here [-Wuninitialized] if (ret) ^~~ drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:216:12: note: initialize the variable 'ret' to silence this warning int i, ret; ^ = 0 >> drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:331:32: warning: result of comparison of constant 74175000000 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare] } else if ((pixel_clk * 1000) >= 74175 * MEGA && pixel_clk <= 300 * MEGA) { ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ >> drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:336:58: warning: result of comparison of constant 74175000000 with expression of type 'u32' (aka 'unsigned int') is always true [-Wtautological-constant-out-of-range-compare] } else if (pixel_clk >= 27 * MEGA && (pixel_clk * 1000) < 74175 * MEGA) { ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ 3 warnings generated. vim +331 drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c 303 304 static int mtk_hdmi_pll_drv_setting(struct clk_hw *hw) 305 { 306 struct mtk_hdmi_phy *hdmi_phy = to_mtk_hdmi_phy(hw); 307 void __iomem *regs = hdmi_phy->regs; 308 u8 data_channel_bias, clk_channel_bias; 309 u8 impedance, impedance_en; 310 u32 tmds_clk; 311 u32 pixel_clk = hdmi_phy->pll_rate; 312 313 tmds_clk = pixel_clk; 314 315 /* bias & impedance setting: 316 * 3G < data rate <= 6G: enable impedance 100ohm, 317 * data channel bias 24mA, clock channel bias 20mA 318 * pixel clk >= HD, 74.175MHZ <= pixel clk <= 300MHZ: 319 * enalbe impedance 100ohm 320 * data channel 20mA, clock channel 16mA 321 * 27M =< pixel clk < 74.175: disable impedance 322 * data channel & clock channel bias 10mA 323 */ 324 325 /* 3G < data rate <= 6G, 300M < tmds rate <= 594M */ 326 if (tmds_clk > 300 * MEGA && tmds_clk <= 594 * MEGA) { 327 data_channel_bias = 0x3c; /* 24mA */ 328 clk_channel_bias = 0x34; /* 20mA */ 329 impedance_en = 0xf; 330 impedance = 0x36; /* 100ohm */ > 331 } else if ((pixel_clk * 1000) >= 74175 * MEGA && pixel_clk <= 300 * MEGA) { 332 data_channel_bias = 0x34; /* 20mA */ 333 clk_channel_bias = 0x2c; /* 16mA */ 334 impedance_en = 0xf; 335 impedance = 0x36; /* 100ohm */ > 336 } else if (pixel_clk >= 27 * MEGA && (pixel_clk * 1000) < 74175 * MEGA) { 337 data_channel_bias = 0x14; /* 10mA */ 338 clk_channel_bias = 0x14; /* 10mA */ 339 impedance_en = 0x0; 340 impedance = 0x0; 341 } else { 342 return -EINVAL; 343 } 344 345 /* bias */ 346 mtk_phy_update_field(regs + HDMI_1_CFG_1, RG_HDMITX21_DRV_IBIAS_D0, data_channel_bias); 347 mtk_phy_update_field(regs + HDMI_1_CFG_1, RG_HDMITX21_DRV_IBIAS_D1, data_channel_bias); 348 mtk_phy_update_field(regs + HDMI_1_CFG_1, RG_HDMITX21_DRV_IBIAS_D2, data_channel_bias); 349 mtk_phy_update_field(regs + HDMI_1_CFG_0, RG_HDMITX21_DRV_IBIAS_CLK, clk_channel_bias); 350 351 /* impedance */ 352 mtk_phy_update_field(regs + HDMI_1_CFG_0, RG_HDMITX21_DRV_IMP_EN, impedance_en); 353 mtk_phy_update_field(regs + HDMI_1_CFG_2, RG_HDMITX21_DRV_IMP_D0_EN1, impedance); 354 mtk_phy_update_field(regs + HDMI_1_CFG_2, RG_HDMITX21_DRV_IMP_D1_EN1, impedance); 355 mtk_phy_update_field(regs + HDMI_1_CFG_2, RG_HDMITX21_DRV_IMP_D2_EN1, impedance); 356 mtk_phy_update_field(regs + HDMI_1_CFG_2, RG_HDMITX21_DRV_IMP_CLK_EN1, impedance); 357 358 return 0; 359 } 360 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests