All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] power-supply: Constify static psy_tzd_ops struct
Date: Thu, 21 Jan 2021 03:16:19 +0800	[thread overview]
Message-ID: <202101210346.v8KrVwdJ-lkp@intel.com> (raw)
In-Reply-To: <20210120095427.10592-1-dj0227@163.com>

[-- Attachment #1: Type: text/plain, Size: 5342 bytes --]

Hi Jian,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on power-supply/for-next]
[also build test WARNING on v5.11-rc4 next-20210120]
[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]

url:    https://github.com/0day-ci/linux/commits/Jian-Dong/power-supply-Constify-static-psy_tzd_ops-struct/20210121-020328
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
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
        # https://github.com/0day-ci/linux/commit/250990c10e4f818c6fda0c43f489a5e7559bdb9c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jian-Dong/power-supply-Constify-static-psy_tzd_ops-struct/20210121-020328
        git checkout 250990c10e4f818c6fda0c43f489a5e7559bdb9c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/power/supply/power_supply_core.c: In function 'psy_register_thermal':
>> drivers/power/supply/power_supply_core.c:970:17: warning: passing argument 5 of 'thermal_zone_device_register' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
     970 |      0, 0, psy, &psy_tzd_ops, NULL, 0, 0);
         |                 ^~~~~~~~~~~~
   In file included from drivers/power/supply/power_supply_core.c:23:
   include/linux/thermal.h:370:29: note: expected 'struct thermal_zone_device_ops *' but argument is of type 'const struct thermal_zone_device_ops *'
     370 | struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
         |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +970 drivers/power/supply/power_supply_core.c

3be330bf8860dc6 drivers/power/power_supply_core.c        Jenny TC              2012-05-09  958  
3be330bf8860dc6 drivers/power/power_supply_core.c        Jenny TC              2012-05-09  959  static int psy_register_thermal(struct power_supply *psy)
3be330bf8860dc6 drivers/power/power_supply_core.c        Jenny TC              2012-05-09  960  {
bbcf90c0646ac79 drivers/power/supply/power_supply_core.c Andrzej Pietrasiewicz 2020-06-29  961  	int i, ret;
3be330bf8860dc6 drivers/power/power_supply_core.c        Jenny TC              2012-05-09  962  
297d716f6260cc9 drivers/power/power_supply_core.c        Krzysztof Kozlowski   2015-03-12  963  	if (psy->desc->no_thermal)
a69d82b9bdf1e53 drivers/power/power_supply_core.c        Krzysztof Kozlowski   2014-10-07  964  		return 0;
a69d82b9bdf1e53 drivers/power/power_supply_core.c        Krzysztof Kozlowski   2014-10-07  965  
3be330bf8860dc6 drivers/power/power_supply_core.c        Jenny TC              2012-05-09  966  	/* Register battery zone device psy reports temperature */
297d716f6260cc9 drivers/power/power_supply_core.c        Krzysztof Kozlowski   2015-03-12  967  	for (i = 0; i < psy->desc->num_properties; i++) {
297d716f6260cc9 drivers/power/power_supply_core.c        Krzysztof Kozlowski   2015-03-12  968  		if (psy->desc->properties[i] == POWER_SUPPLY_PROP_TEMP) {
297d716f6260cc9 drivers/power/power_supply_core.c        Krzysztof Kozlowski   2015-03-12  969  			psy->tzd = thermal_zone_device_register(psy->desc->name,
297d716f6260cc9 drivers/power/power_supply_core.c        Krzysztof Kozlowski   2015-03-12 @970  					0, 0, psy, &psy_tzd_ops, NULL, 0, 0);
bbcf90c0646ac79 drivers/power/supply/power_supply_core.c Andrzej Pietrasiewicz 2020-06-29  971  			if (IS_ERR(psy->tzd))
bbcf90c0646ac79 drivers/power/supply/power_supply_core.c Andrzej Pietrasiewicz 2020-06-29  972  				return PTR_ERR(psy->tzd);
bbcf90c0646ac79 drivers/power/supply/power_supply_core.c Andrzej Pietrasiewicz 2020-06-29  973  			ret = thermal_zone_device_enable(psy->tzd);
bbcf90c0646ac79 drivers/power/supply/power_supply_core.c Andrzej Pietrasiewicz 2020-06-29  974  			if (ret)
bbcf90c0646ac79 drivers/power/supply/power_supply_core.c Andrzej Pietrasiewicz 2020-06-29  975  				thermal_zone_device_unregister(psy->tzd);
bbcf90c0646ac79 drivers/power/supply/power_supply_core.c Andrzej Pietrasiewicz 2020-06-29  976  			return ret;
3be330bf8860dc6 drivers/power/power_supply_core.c        Jenny TC              2012-05-09  977  		}
3be330bf8860dc6 drivers/power/power_supply_core.c        Jenny TC              2012-05-09  978  	}
3be330bf8860dc6 drivers/power/power_supply_core.c        Jenny TC              2012-05-09  979  	return 0;
3be330bf8860dc6 drivers/power/power_supply_core.c        Jenny TC              2012-05-09  980  }
3be330bf8860dc6 drivers/power/power_supply_core.c        Jenny TC              2012-05-09  981  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 72485 bytes --]

  reply	other threads:[~2021-01-20 19:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20  9:54 [PATCH] power-supply: Constify static psy_tzd_ops struct Jian Dong
2021-01-20 19:16 ` kernel test robot [this message]
2021-01-20 21:50 ` kernel test robot
2021-01-20 21:50   ` kernel test robot
2021-01-28  0:30 ` Sebastian Reichel

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=202101210346.v8KrVwdJ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.