netdev.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@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	netdev@vger.kernel.org, Christian Marangi <ansuelsmth@gmail.com>
Subject: Re: [net-next PATCH v2 3/3] net: phy: led: dynamically allocate speed modes array
Date: Fri, 15 Dec 2023 20:50:30 +0800	[thread overview]
Message-ID: <202312152044.iRWfyQXJ-lkp@intel.com> (raw)
In-Reply-To: <20231214154906.29436-4-ansuelsmth@gmail.com>

Hi Christian,

kernel test robot noticed the following build errors:

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

url:    https://github.com/intel-lab-lkp/linux/commits/Christian-Marangi/net-phy-refactor-and-better-document-phy_speeds-function/20231215-064112
base:   net-next/main
patch link:    https://lore.kernel.org/r/20231214154906.29436-4-ansuelsmth%40gmail.com
patch subject: [net-next PATCH v2 3/3] net: phy: led: dynamically allocate speed modes array
config: arm-randconfig-003-20231215 (https://download.01.org/0day-ci/archive/20231215/202312152044.iRWfyQXJ-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project.git f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231215/202312152044.iRWfyQXJ-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/202312152044.iRWfyQXJ-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/net/phy/phy_led_triggers.c:89:30: error: implicit declaration of function 'phy_supported_speeds_num' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
           phy->phy_num_led_triggers = phy_supported_speeds_num(phy);
                                       ^
   drivers/net/phy/phy_led_triggers.c:89:30: note: did you mean 'phy_supported_speeds'?
   include/linux/phy.h:208:14: note: 'phy_supported_speeds' declared here
   unsigned int phy_supported_speeds(struct phy_device *phy,
                ^
>> drivers/net/phy/phy_led_triggers.c:133:2: error: implicitly declaring library function 'free' with type 'void (void *)' [-Werror,-Wimplicit-function-declaration]
           free(speeds);
           ^
   drivers/net/phy/phy_led_triggers.c:133:2: note: include the header <stdlib.h> or explicitly provide a declaration for 'free'
   2 errors generated.


vim +/phy_supported_speeds_num +89 drivers/net/phy/phy_led_triggers.c

    83	
    84	int phy_led_triggers_register(struct phy_device *phy)
    85	{
    86		unsigned int *speeds;
    87		int i, err;
    88	
  > 89		phy->phy_num_led_triggers = phy_supported_speeds_num(phy);
    90		if (!phy->phy_num_led_triggers)
    91			return 0;
    92	
    93		speeds = kmalloc_array(phy->phy_num_led_triggers, sizeof(*speeds),
    94				       GFP_KERNEL);
    95		if (!speeds)
    96			return -ENOMEM;
    97	
    98		/* Presence of speed modes already checked up */
    99		phy_supported_speeds(phy, speeds, phy->phy_num_led_triggers);
   100	
   101		phy->led_link_trigger = devm_kzalloc(&phy->mdio.dev,
   102						     sizeof(*phy->led_link_trigger),
   103						     GFP_KERNEL);
   104		if (!phy->led_link_trigger) {
   105			err = -ENOMEM;
   106			goto out_clear;
   107		}
   108	
   109		err = phy_led_trigger_register(phy, phy->led_link_trigger, 0, "link");
   110		if (err)
   111			goto out_free_link;
   112	
   113		phy->phy_led_triggers = devm_kcalloc(&phy->mdio.dev,
   114						    phy->phy_num_led_triggers,
   115						    sizeof(struct phy_led_trigger),
   116						    GFP_KERNEL);
   117		if (!phy->phy_led_triggers) {
   118			err = -ENOMEM;
   119			goto out_unreg_link;
   120		}
   121	
   122		for (i = 0; i < phy->phy_num_led_triggers; i++) {
   123			err = phy_led_trigger_register(phy, &phy->phy_led_triggers[i],
   124						       speeds[i],
   125						       phy_speed_to_str(speeds[i]));
   126			if (err)
   127				goto out_unreg;
   128		}
   129	
   130		phy->last_triggered = NULL;
   131		phy_led_trigger_change_speed(phy);
   132	
 > 133		free(speeds);
   134	
   135		return 0;
   136	out_unreg:
   137		while (i--)
   138			phy_led_trigger_unregister(&phy->phy_led_triggers[i]);
   139		devm_kfree(&phy->mdio.dev, phy->phy_led_triggers);
   140	out_unreg_link:
   141		phy_led_trigger_unregister(phy->led_link_trigger);
   142	out_free_link:
   143		devm_kfree(&phy->mdio.dev, phy->led_link_trigger);
   144		phy->led_link_trigger = NULL;
   145	out_clear:
   146		free(speeds);
   147		phy->phy_num_led_triggers = 0;
   148		return err;
   149	}
   150	EXPORT_SYMBOL_GPL(phy_led_triggers_register);
   151	

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

      parent reply	other threads:[~2023-12-15 12:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-14 15:49 [net-next PATCH v2 0/3] net: add define to describe link speed modes Christian Marangi
2023-12-14 15:49 ` [net-next PATCH v2 1/3] net: phy: refactor and better document phy_speeds function Christian Marangi
2023-12-14 15:49 ` [net-next PATCH v2 2/3] net: phy: add simple helper to return count of supported speeds Christian Marangi
2023-12-15 12:16   ` kernel test robot
2023-12-14 15:49 ` [net-next PATCH v2 3/3] net: phy: led: dynamically allocate speed modes array Christian Marangi
2023-12-15 12:50   ` kernel test robot
2023-12-17  1:12     ` Christian Marangi
2023-12-17 10:38       ` Russell King (Oracle)
2023-12-17 12:12         ` Christian Marangi
2023-12-15 12:50   ` 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=202312152044.iRWfyQXJ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=llvm@lists.linux.dev \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    /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).