devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christian Marangi <ansuelsmth@gmail.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, netdev@vger.kernel.org
Subject: Re: [net-next PATCH 1/2] net: phy: Add support for new Aeonsemi PHYs
Date: Sun, 30 Mar 2025 02:51:41 +0800	[thread overview]
Message-ID: <202503300205.g0FCozVG-lkp@intel.com> (raw)
In-Reply-To: <20250323225439.32400-1-ansuelsmth@gmail.com>

Hi Christian,

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/Christian-Marangi/dt-bindings-net-Document-support-for-Aeonsemi-PHYs/20250324-065920
base:   net-next/main
patch link:    https://lore.kernel.org/r/20250323225439.32400-1-ansuelsmth%40gmail.com
patch subject: [net-next PATCH 1/2] net: phy: Add support for new Aeonsemi PHYs
config: riscv-randconfig-r072-20250329 (https://download.01.org/0day-ci/archive/20250330/202503300205.g0FCozVG-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)

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/202503300205.g0FCozVG-lkp@intel.com/

smatch warnings:
drivers/net/phy/as21xxx.c:744 as21xxx_led_hw_control_get() warn: unsigned 'val' is never less than zero.
drivers/net/phy/as21xxx.c:775 as21xxx_led_hw_control_set() error: uninitialized symbol 'val'.
drivers/net/phy/as21xxx.c:802 as21xxx_led_polarity_set() error: uninitialized symbol 'led_active_low'.

vim +/val +744 drivers/net/phy/as21xxx.c

   733	
   734	static int as21xxx_led_hw_control_get(struct phy_device *phydev, u8 index,
   735					      unsigned long *rules)
   736	{
   737		u16 val;
   738		int i;
   739	
   740		if (index > AEON_MAX_LDES)
   741			return -EINVAL;
   742	
   743		val = phy_read_mmd(phydev, MDIO_MMD_VEND1, VEND1_LED_REG(index));
 > 744		if (val < 0)
   745			return val;
   746	
   747		val &= VEND1_LED_REG_A_EVENT;
   748		for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
   749			if (val == as21xxx_led_supported_pattern[i].val) {
   750				*rules = as21xxx_led_supported_pattern[i].pattern;
   751				return 0;
   752			}
   753	
   754		/* Should be impossible */
   755		return -EINVAL;
   756	}
   757	
   758	static int as21xxx_led_hw_control_set(struct phy_device *phydev, u8 index,
   759					      unsigned long rules)
   760	{
   761		u16 val;
   762		int i;
   763	
   764		if (index > AEON_MAX_LDES)
   765			return -EINVAL;
   766	
   767		for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
   768			if (rules == as21xxx_led_supported_pattern[i].pattern) {
   769				val = as21xxx_led_supported_pattern[i].val;
   770				break;
   771			}
   772	
   773		return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
   774				      VEND1_LED_REG(index),
 > 775				      VEND1_LED_REG_A_EVENT, val);
   776	}
   777	
   778	static int as21xxx_led_polarity_set(struct phy_device *phydev, int index,
   779					    unsigned long modes)
   780	{
   781		bool led_active_low;
   782		u16 mask, val = 0;
   783		u32 mode;
   784	
   785		if (index > AEON_MAX_LDES)
   786			return -EINVAL;
   787	
   788		for_each_set_bit(mode, &modes, __PHY_LED_MODES_NUM) {
   789			switch (mode) {
   790			case PHY_LED_ACTIVE_LOW:
   791				led_active_low = true;
   792				break;
   793			case PHY_LED_ACTIVE_HIGH: /* default mode */
   794				led_active_low = false;
   795				break;
   796			default:
   797				return -EINVAL;
   798			}
   799		}
   800	
   801		mask = VEND1_GLB_CPU_CTRL_LED_POLARITY(index);
 > 802		if (led_active_low)
   803			val = VEND1_GLB_CPU_CTRL_LED_POLARITY(index);
   804	
   805		return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
   806				      VEND1_GLB_REG_CPU_CTRL,
   807				      mask, val);
   808	}
   809	

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

      parent reply	other threads:[~2025-03-29 18:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-23 22:54 [net-next PATCH 1/2] net: phy: Add support for new Aeonsemi PHYs Christian Marangi
2025-03-23 22:54 ` [net-next PATCH 2/2] dt-bindings: net: Document support for " Christian Marangi
2025-03-24 17:09   ` Rob Herring
2025-03-24  3:19 ` [net-next PATCH 1/2] net: phy: Add support for new " kernel test robot
2025-03-24 14:03 ` Andrew Lunn
2025-03-24 14:16   ` Christian Marangi
2025-03-24 15:16     ` Andrew Lunn
2025-03-25 12:04       ` Christian Marangi
2025-03-25 20:33         ` Andrew Lunn
2025-03-25 20:41           ` Christian Marangi
2025-03-25 21:36         ` Russell King (Oracle)
2025-03-24 14:55 ` Russell King (Oracle)
2025-03-29 18:51 ` 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=202503300205.g0FCozVG-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzk@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    --cc=robh@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).