devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jisheng Zhang <jszhang@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH net-next 3/3] net: stmmac: add glue layer for T-HEAD TH1520 SoC
Date: Thu, 24 Aug 2023 23:06:07 +0800	[thread overview]
Message-ID: <202308242250.G39QxvdR-lkp@intel.com> (raw)
In-Reply-To: <20230820120213.2054-4-jszhang@kernel.org>

Hi Jisheng,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Jisheng-Zhang/dt-bindings-net-snps-dwmac-allow-dwmac-3-70a-to-set-pbl-properties/20230821-114902
base:   net-next/main
patch link:    https://lore.kernel.org/r/20230820120213.2054-4-jszhang%40kernel.org
patch subject: [PATCH net-next 3/3] net: stmmac: add glue layer for T-HEAD TH1520 SoC
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20230824/202308242250.G39QxvdR-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230824/202308242250.G39QxvdR-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202308242250.G39QxvdR-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c:151:3: warning: variable 'div' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
     151 |                 default:
         |                 ^~~~~~~
   drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c:156:50: note: uninitialized use occurs here
     156 |                                    GMAC_PLLCLK_DIV_MASK, GMAC_PLLCLK_DIV_NUM(div));
         |                                                                              ^~~
   drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c:40:68: note: expanded from macro 'GMAC_PLLCLK_DIV_NUM'
      40 | #define  GMAC_PLLCLK_DIV_NUM(x)         FIELD_PREP(GMAC_PLLCLK_DIV_MASK, (x))
         |                                                                           ^
   include/linux/bitfield.h:114:33: note: expanded from macro 'FIELD_PREP'
     114 |                 __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: ");    \
         |                                               ^~~~
   include/linux/bitfield.h:68:41: note: expanded from macro '__BF_FIELD_CHECK'
      68 |                 BUILD_BUG_ON_MSG(__builtin_constant_p(_val) ?           \
         |                                                       ^~~~
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:397:22: note: expanded from macro 'compiletime_assert'
     397 |         _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
         |                             ^~~~~~~~~
   include/linux/compiler_types.h:385:23: note: expanded from macro '_compiletime_assert'
     385 |         __compiletime_assert(condition, msg, prefix, suffix)
         |                              ^~~~~~~~~
   include/linux/compiler_types.h:377:9: note: expanded from macro '__compiletime_assert'
     377 |                 if (!(condition))                                       \
         |                       ^~~~~~~~~
   drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c:121:9: note: initialize the variable 'div' to silence this warning
     121 |         u32 div;
         |                ^
         |                 = 0
   1 warning generated.


vim +/div +151 drivers/net/ethernet/stmicro/stmmac/dwmac-thead.c

   115	
   116	static void thead_dwmac_fix_speed(void *priv, unsigned int speed, unsigned int mode)
   117	{
   118		struct thead_dwmac *dwmac = priv;
   119		struct plat_stmmacenet_data *plat = dwmac->plat;
   120		unsigned long rate;
   121		u32 div;
   122	
   123		switch (plat->interface) {
   124		/* For MII, rxc/txc is provided by phy */
   125		case PHY_INTERFACE_MODE_MII:
   126			return;
   127	
   128		case PHY_INTERFACE_MODE_RGMII:
   129		case PHY_INTERFACE_MODE_RGMII_ID:
   130		case PHY_INTERFACE_MODE_RGMII_RXID:
   131		case PHY_INTERFACE_MODE_RGMII_TXID:
   132			rate = clk_get_rate(plat->stmmac_clk);
   133			if (!rate || rate % GMAC_GMII_RGMII_RATE != 0 ||
   134			    rate % GMAC_MII_RATE != 0) {
   135				dev_err(dwmac->dev, "invalid gmac rate %ld\n", rate);
   136				return;
   137			}
   138	
   139			regmap_update_bits(dwmac->apb_regmap, GMAC_PLLCLK_DIV, GMAC_PLLCLK_DIV_EN, 0);
   140	
   141			switch (speed) {
   142			case SPEED_1000:
   143				div = rate / GMAC_GMII_RGMII_RATE;
   144				break;
   145			case SPEED_100:
   146				div = rate / GMAC_MII_RATE;
   147				break;
   148			case SPEED_10:
   149				div = rate * 10 / GMAC_MII_RATE;
   150				break;
 > 151			default:
   152				dev_err(dwmac->dev, "invalid speed %u\n", speed);
   153				break;
   154			}
   155			regmap_update_bits(dwmac->apb_regmap, GMAC_PLLCLK_DIV,
   156					   GMAC_PLLCLK_DIV_MASK, GMAC_PLLCLK_DIV_NUM(div));
   157	
   158			regmap_update_bits(dwmac->apb_regmap, GMAC_PLLCLK_DIV,
   159					   GMAC_PLLCLK_DIV_EN, GMAC_PLLCLK_DIV_EN);
   160			break;
   161		default:
   162			dev_err(dwmac->dev, "unsupported phy interface %d\n",
   163				plat->interface);
   164			return;
   165		}
   166	}
   167	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

      parent reply	other threads:[~2023-08-24 15:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-20 12:02 [PATCH net-next 0/3] add the dwmac driver for T-HEAD TH1520 SoC Jisheng Zhang
2023-08-20 12:02 ` [PATCH net-next 1/3] dt-bindings: net: snps,dwmac: allow dwmac-3.70a to set pbl properties Jisheng Zhang
2023-08-21  6:22   ` Krzysztof Kozlowski
2023-08-20 12:02 ` [PATCH net-next 2/3] dt-bindings: net: add T-HEAD dwmac support Jisheng Zhang
2023-08-21  6:29   ` Krzysztof Kozlowski
2023-08-20 12:02 ` [PATCH net-next 3/3] net: stmmac: add glue layer for T-HEAD TH1520 SoC Jisheng Zhang
2023-08-20 14:55   ` Simon Horman
2023-08-24 15:06   ` kernel test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202308242250.G39QxvdR-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=jszhang@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=llvm@lists.linux.dev \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).