public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Thomas Weißschuh" <linux@weissschuh.net>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Maximilian Luz" <luzmaximilian@gmail.com>,
	"Pali Rohár" <pali@kernel.org>,
	"Konrad Dybcio" <konradybcio@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	platform-driver-x86@vger.kernel.org,
	"Thomas Weißschuh" <linux@weissschuh.net>
Subject: Re: [PATCH 04/14] power: supply: ab8500: use power_supply_for_each_psy()
Date: Tue, 10 Dec 2024 00:29:21 +0800	[thread overview]
Message-ID: <202412092219.bRJmBwIP-lkp@intel.com> (raw)
In-Reply-To: <20241208-power-supply-dev_to_psy-v1-4-f95de9117558@weissschuh.net>

Hi Thomas,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 39f3bd9c9a27d526858da153090376decdf7bfea]

url:    https://github.com/intel-lab-lkp/linux/commits/Thomas-Wei-schuh/power-supply-mm8013-use-accessor-for-driver-data/20241208-210605
base:   39f3bd9c9a27d526858da153090376decdf7bfea
patch link:    https://lore.kernel.org/r/20241208-power-supply-dev_to_psy-v1-4-f95de9117558%40weissschuh.net
patch subject: [PATCH 04/14] power: supply: ab8500: use power_supply_for_each_psy()
config: arm-allyesconfig (https://download.01.org/0day-ci/archive/20241209/202412092219.bRJmBwIP-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241209/202412092219.bRJmBwIP-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/202412092219.bRJmBwIP-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/power/supply/ab8500_btemp.c:543:49: warning: 'struct power_supply_ext' declared inside parameter list will not be visible outside of this definition or declaration
     543 | static int ab8500_btemp_get_ext_psy_data(struct power_supply_ext *ext, void *data)
         |                                                 ^~~~~~~~~~~~~~~~
   drivers/power/supply/ab8500_btemp.c: In function 'ab8500_btemp_get_ext_psy_data':
   drivers/power/supply/ab8500_btemp.c:546:54: error: invalid use of undefined type 'struct power_supply_ext'
     546 |         const char **supplicants = (const char **)ext->supplied_to;
         |                                                      ^~
   drivers/power/supply/ab8500_btemp.c:558:42: error: invalid use of undefined type 'struct power_supply_ext'
     558 |         j = match_string(supplicants, ext->num_supplicants, psy->desc->name);
         |                                          ^~
   drivers/power/supply/ab8500_btemp.c:563:28: error: invalid use of undefined type 'struct power_supply_ext'
     563 |         for (j = 0; j < ext->desc->num_properties; j++) {
         |                            ^~
   drivers/power/supply/ab8500_btemp.c:565:27: error: invalid use of undefined type 'struct power_supply_ext'
     565 |                 prop = ext->desc->properties[j];
         |                           ^~
   drivers/power/supply/ab8500_btemp.c:567:47: error: passing argument 1 of 'power_supply_get_property' from incompatible pointer type [-Wincompatible-pointer-types]
     567 |                 if (power_supply_get_property(ext, prop, &ret))
         |                                               ^~~
         |                                               |
         |                                               struct power_supply_ext *
   In file included from drivers/power/supply/ab8500_btemp.c:21:
   include/linux/power_supply.h:855:59: note: expected 'struct power_supply *' but argument is of type 'struct power_supply_ext *'
     855 | extern int power_supply_get_property(struct power_supply *psy,
         |                                      ~~~~~~~~~~~~~~~~~~~~~^~~
   drivers/power/supply/ab8500_btemp.c:572:36: error: invalid use of undefined type 'struct power_supply_ext'
     572 |                         switch (ext->desc->type) {
         |                                    ^~
   drivers/power/supply/ab8500_btemp.c: In function 'ab8500_btemp_external_power_changed':
   drivers/power/supply/ab8500_btemp.c:619:40: error: passing argument 2 of 'power_supply_for_each_psy' from incompatible pointer type [-Wincompatible-pointer-types]
     619 |         power_supply_for_each_psy(psy, ab8500_btemp_get_ext_psy_data);
         |                                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                                        |
         |                                        int (*)(struct power_supply_ext *, void *)
   include/linux/power_supply.h:885:56: note: expected 'int (*)(struct power_supply *, void *)' but argument is of type 'int (*)(struct power_supply_ext *, void *)'
     885 | extern int power_supply_for_each_psy(void *data, int (*fn)(struct power_supply *psy, void *data));
         |                                                  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
>> drivers/power/supply/ab8500_chargalg.c:847:52: warning: 'struct power_supply_ext' declared inside parameter list will not be visible outside of this definition or declaration
     847 | static int ab8500_chargalg_get_ext_psy_data(struct power_supply_ext *ext, void *data)
         |                                                    ^~~~~~~~~~~~~~~~
   drivers/power/supply/ab8500_chargalg.c: In function 'ab8500_chargalg_get_ext_psy_data':
   drivers/power/supply/ab8500_chargalg.c:850:54: error: invalid use of undefined type 'struct power_supply_ext'
     850 |         const char **supplicants = (const char **)ext->supplied_to;
         |                                                      ^~
   drivers/power/supply/ab8500_chargalg.c:859:42: error: invalid use of undefined type 'struct power_supply_ext'
     859 |         j = match_string(supplicants, ext->num_supplicants, psy->desc->name);
         |                                          ^~
   drivers/power/supply/ab8500_chargalg.c:868:40: error: passing argument 1 of 'power_supply_get_property' from incompatible pointer type [-Wincompatible-pointer-types]
     868 |         if (!power_supply_get_property(ext, POWER_SUPPLY_PROP_CAPACITY, &ret)) {
         |                                        ^~~
         |                                        |
         |                                        struct power_supply_ext *
   In file included from drivers/power/supply/ab8500_chargalg.c:24:
   include/linux/power_supply.h:855:59: note: expected 'struct power_supply *' but argument is of type 'struct power_supply_ext *'
     855 | extern int power_supply_get_property(struct power_supply *psy,
         |                                      ~~~~~~~~~~~~~~~~~~~~~^~~
   drivers/power/supply/ab8500_chargalg.c:874:28: error: invalid use of undefined type 'struct power_supply_ext'
     874 |         for (j = 0; j < ext->desc->num_properties; j++) {
         |                            ^~
   drivers/power/supply/ab8500_chargalg.c:876:27: error: invalid use of undefined type 'struct power_supply_ext'
     876 |                 prop = ext->desc->properties[j];
         |                           ^~
   drivers/power/supply/ab8500_chargalg.c:882:28: error: invalid use of undefined type 'struct power_supply_ext'
     882 |                         ext->desc->type == POWER_SUPPLY_TYPE_MAINS)
         |                            ^~
   In file included from drivers/power/supply/ab8500_chargalg.c:35:
   drivers/power/supply/ab8500_chargalg.c:883:59: error: passing argument 1 of 'power_supply_get_drvdata' from incompatible pointer type [-Wincompatible-pointer-types]
     883 |                         di->ac_chg = psy_to_ux500_charger(ext);
         |                                                           ^~~
         |                                                           |
         |                                                           struct power_supply_ext *
   drivers/power/supply/ab8500-chargalg.h:18:58: note: in definition of macro 'psy_to_ux500_charger'
      18 | #define psy_to_ux500_charger(x) power_supply_get_drvdata(x)
         |                                                          ^
   include/linux/power_supply.h:883:60: note: expected 'struct power_supply *' but argument is of type 'struct power_supply_ext *'
     883 | extern void *power_supply_get_drvdata(struct power_supply *psy);
         |                                       ~~~~~~~~~~~~~~~~~~~~~^~~
   drivers/power/supply/ab8500_chargalg.c:885:28: error: invalid use of undefined type 'struct power_supply_ext'
     885 |                         ext->desc->type == POWER_SUPPLY_TYPE_USB)
         |                            ^~
   drivers/power/supply/ab8500_chargalg.c:886:60: error: passing argument 1 of 'power_supply_get_drvdata' from incompatible pointer type [-Wincompatible-pointer-types]
     886 |                         di->usb_chg = psy_to_ux500_charger(ext);
         |                                                            ^~~
         |                                                            |
         |                                                            struct power_supply_ext *
   drivers/power/supply/ab8500-chargalg.h:18:58: note: in definition of macro 'psy_to_ux500_charger'
      18 | #define psy_to_ux500_charger(x) power_supply_get_drvdata(x)
         |                                                          ^
   include/linux/power_supply.h:883:60: note: expected 'struct power_supply *' but argument is of type 'struct power_supply_ext *'
     883 | extern void *power_supply_get_drvdata(struct power_supply *psy);
         |                                       ~~~~~~~~~~~~~~~~~~~~~^~~
   drivers/power/supply/ab8500_chargalg.c:888:47: error: passing argument 1 of 'power_supply_get_property' from incompatible pointer type [-Wincompatible-pointer-types]
     888 |                 if (power_supply_get_property(ext, prop, &ret))
         |                                               ^~~
         |                                               |
         |                                               struct power_supply_ext *
   include/linux/power_supply.h:855:59: note: expected 'struct power_supply *' but argument is of type 'struct power_supply_ext *'
     855 | extern int power_supply_get_property(struct power_supply *psy,
         |                                      ~~~~~~~~~~~~~~~~~~~~~^~~
   drivers/power/supply/ab8500_chargalg.c:892:36: error: invalid use of undefined type 'struct power_supply_ext'
     892 |                         switch (ext->desc->type) {
         |                                    ^~
   drivers/power/supply/ab8500_chargalg.c:939:36: error: invalid use of undefined type 'struct power_supply_ext'
     939 |                         switch (ext->desc->type) {
         |                                    ^~
   drivers/power/supply/ab8500_chargalg.c:984:36: error: invalid use of undefined type 'struct power_supply_ext'
     984 |                         switch (ext->desc->type) {
         |                                    ^~
   drivers/power/supply/ab8500_chargalg.c:1068:36: error: invalid use of undefined type 'struct power_supply_ext'
    1068 |                         switch (ext->desc->type) {
         |                                    ^~
   drivers/power/supply/ab8500_chargalg.c:1084:36: error: invalid use of undefined type 'struct power_supply_ext'
    1084 |                         switch (ext->desc->type) {
         |                                    ^~
   drivers/power/supply/ab8500_chargalg.c:1109:36: error: invalid use of undefined type 'struct power_supply_ext'
    1109 |                         switch (ext->desc->type) {
         |                                    ^~
   drivers/power/supply/ab8500_chargalg.c:1127:36: error: invalid use of undefined type 'struct power_supply_ext'
    1127 |                         switch (ext->desc->type) {
         |                                    ^~
   drivers/power/supply/ab8500_chargalg.c:1143:36: error: invalid use of undefined type 'struct power_supply_ext'
    1143 |                         switch (ext->desc->type) {
         |                                    ^~
   drivers/power/supply/ab8500_chargalg.c: In function 'ab8500_chargalg_algorithm':
   drivers/power/supply/ab8500_chargalg.c:1233:53: error: passing argument 2 of 'power_supply_for_each_psy' from incompatible pointer type [-Wincompatible-pointer-types]
    1233 |         power_supply_for_each_psy(di->chargalg_psy, ab8500_chargalg_get_ext_psy_data);
         |                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         |                                                     |
         |                                                     int (*)(struct power_supply_ext *, void *)
   include/linux/power_supply.h:885:56: note: expected 'int (*)(struct power_supply *, void *)' but argument is of type 'int (*)(struct power_supply_ext *, void *)'
     885 | extern int power_supply_for_each_psy(void *data, int (*fn)(struct power_supply *psy, void *data));
         |                                                  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +543 drivers/power/supply/ab8500_btemp.c

   542	
 > 543	static int ab8500_btemp_get_ext_psy_data(struct power_supply_ext *ext, void *data)
   544	{
   545		struct power_supply *psy;
   546		const char **supplicants = (const char **)ext->supplied_to;
   547		struct ab8500_btemp *di;
   548		union power_supply_propval ret;
   549		int j;
   550	
   551		psy = (struct power_supply *)data;
   552		di = power_supply_get_drvdata(psy);
   553	
   554		/*
   555		 * For all psy where the name of your driver
   556		 * appears in any supplied_to
   557		 */
   558		j = match_string(supplicants, ext->num_supplicants, psy->desc->name);
   559		if (j < 0)
   560			return 0;
   561	
   562		/* Go through all properties for the psy */
   563		for (j = 0; j < ext->desc->num_properties; j++) {
   564			enum power_supply_property prop;
   565			prop = ext->desc->properties[j];
   566	
   567			if (power_supply_get_property(ext, prop, &ret))
   568				continue;
   569	
   570			switch (prop) {
   571			case POWER_SUPPLY_PROP_PRESENT:
   572				switch (ext->desc->type) {
   573				case POWER_SUPPLY_TYPE_MAINS:
   574					/* AC disconnected */
   575					if (!ret.intval && di->events.ac_conn) {
   576						di->events.ac_conn = false;
   577					}
   578					/* AC connected */
   579					else if (ret.intval && !di->events.ac_conn) {
   580						di->events.ac_conn = true;
   581						if (!di->events.usb_conn)
   582							ab8500_btemp_periodic(di, true);
   583					}
   584					break;
   585				case POWER_SUPPLY_TYPE_USB:
   586					/* USB disconnected */
   587					if (!ret.intval && di->events.usb_conn) {
   588						di->events.usb_conn = false;
   589					}
   590					/* USB connected */
   591					else if (ret.intval && !di->events.usb_conn) {
   592						di->events.usb_conn = true;
   593						if (!di->events.ac_conn)
   594							ab8500_btemp_periodic(di, true);
   595					}
   596					break;
   597				default:
   598					break;
   599				}
   600				break;
   601			default:
   602				break;
   603			}
   604		}
   605		return 0;
   606	}
   607	

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

  reply	other threads:[~2024-12-09 16:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-08 13:02 [PATCH 00/14] power: supply: intruduce and use power_supply_for_each_psy() and dev_to_psy() Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 01/14] power: supply: mm8013: use accessor for driver data Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 02/14] power: supply: core: introduce power_supply_for_each_psy() Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 03/14] power: supply: core: use power_supply_for_each_psy() Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 04/14] power: supply: ab8500: " Thomas Weißschuh
2024-12-09 16:29   ` kernel test robot [this message]
2024-12-08 13:02 ` [PATCH 05/14] power: supply: apm_power: " Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 06/14] power: supply: core: remove power_supply_for_each_device() Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 07/14] power: supply: core: introduce dev_to_psy() Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 08/14] power: supply: core: use dev_to_psy() Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 09/14] power: supply: sysfs: " Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 10/14] power: supply: ab8500: " Thomas Weißschuh
2024-12-17 14:08   ` Linus Walleij
2024-12-08 13:02 ` [PATCH 11/14] power: supply: surface_battery: " Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 12/14] power: supply: bq2415x_charger: " Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 13/14] power: supply: bq24190_charger: " Thomas Weißschuh
2024-12-08 13:02 ` [PATCH 14/14] power: supply: bq24257_charger: " Thomas Weißschuh

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=202412092219.bRJmBwIP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=konradybcio@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux@weissschuh.net \
    --cc=luzmaximilian@gmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pali@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sre@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