public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Iskren Chernev <iskren.chernev@gmail.com>,
	Sebastian Reichel <sre@kernel.org>,
	Rob Herring <robh+dt@kernel.org>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht,
	Iskren Chernev <iskren.chernev@gmail.com>
Subject: Re: [PATCH 2/2] power: supply: max17040: Support compatible devices
Date: Tue, 9 Jun 2020 06:20:18 +0800	[thread overview]
Message-ID: <202006090639.OWbHb8Ym%lkp@intel.com> (raw)
In-Reply-To: <20200608182642.592848-2-iskren.chernev@gmail.com>

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

Hi Iskren,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on power-supply/for-next]
[also build test WARNING on next-20200608]
[cannot apply to v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Iskren-Chernev/dt-bindints-power-supply-Document-max17040-extensions/20200609-022950
base:   https://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git for-next
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project e429cffd4f228f70c1d9df0e5d77c08590dd9766)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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 >>, old ones prefixed by <<):

>> drivers/power/supply/max17040_battery.c:456:13: warning: cast to smaller integer type 'enum chip_id' from 'const void *' [-Wvoid-pointer-to-enum-cast]
chip_id = (enum chip_id) of_device_get_match_data(&client->dev);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

vim +456 drivers/power/supply/max17040_battery.c

   430	
   431	static int max17040_probe(struct i2c_client *client,
   432				const struct i2c_device_id *id)
   433	{
   434		struct i2c_adapter *adapter = client->adapter;
   435		struct power_supply_config psy_cfg = {};
   436		struct max17040_chip *chip;
   437		enum chip_id chip_id;
   438		bool enable_irq = false;
   439		int ret;
   440	
   441		if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
   442			return -EIO;
   443	
   444		chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
   445		if (!chip)
   446			return -ENOMEM;
   447	
   448		chip->client = client;
   449		chip->regmap = devm_regmap_init_i2c(client, &max17040_regmap);
   450		chip->pdata = client->dev.platform_data;
   451		chip_id = (enum chip_id) id->driver_data;
   452		if (client->dev.of_node) {
   453			ret = max17040_get_of_data(chip);
   454			if (ret)
   455				return ret;
 > 456			chip_id = (enum chip_id) of_device_get_match_data(&client->dev);
   457		}
   458		chip->data = max17040_family[chip_id];
   459	
   460		i2c_set_clientdata(client, chip);
   461		psy_cfg.drv_data = chip;
   462	
   463		chip->battery = devm_power_supply_register(&client->dev,
   464						&max17040_battery_desc, &psy_cfg);
   465		if (IS_ERR(chip->battery)) {
   466			dev_err(&client->dev, "failed: power supply register\n");
   467			return PTR_ERR(chip->battery);
   468		}
   469	
   470		max17040_reset(chip);
   471		max17040_get_version(chip);
   472		max17040_set_rcomp(chip, chip->rcomp);
   473	
   474		/* check interrupt */
   475		if (client->irq && chip->data.has_low_soc_alert) {
   476			ret = max17040_set_low_soc_alert(chip, chip->low_soc_alert);
   477			if (ret) {
   478				dev_err(&client->dev,
   479					"Failed to set low SOC alert: err %d\n", ret);
   480				return ret;
   481			}
   482			enable_irq = true;
   483		}
   484	
   485		if (client->irq && chip->data.has_soc_alert) {
   486			ret = max17040_set_soc_alert(chip, 1);
   487			if (ret) {
   488				dev_err(&client->dev,
   489					"Failed to set SOC alert: err %d\n", ret);
   490				return ret;
   491			}
   492			enable_irq = true;
   493		} else {
   494			/* soc alerts negate the need for polling */
   495			INIT_DEFERRABLE_WORK(&chip->work, max17040_work);
   496			ret = devm_add_action(&client->dev, max17040_stop_work, chip);
   497			if (ret)
   498				return ret;
   499			max17040_queue_work(chip);
   500		}
   501	
   502		if (enable_irq) {
   503			ret = max17040_setup_irq(chip);
   504			if (ret) {
   505				client->irq = 0;
   506				dev_warn(&client->dev,
   507					 "Failed to get IRQ err %d\n", ret);
   508			}
   509		}
   510	
   511		return 0;
   512	}
   513	

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

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

  parent reply	other threads:[~2020-06-09  0:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-08 18:26 [PATCH 1/2] dt-bindints: power: supply: Document max17040 extensions Iskren Chernev
2020-06-08 18:26 ` [PATCH 2/2] power: supply: max17040: Support compatible devices Iskren Chernev
2020-06-08 21:23   ` kernel test robot
2020-06-08 21:23   ` [RFC PATCH] power: supply: max17040: max17040_family[] can be static kernel test robot
2020-06-08 22:20   ` kernel test robot [this message]
2020-06-17 20:51 ` [PATCH 1/2] dt-bindints: power: supply: Document max17040 extensions Rob Herring

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=202006090639.OWbHb8Ym%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=devicetree@vger.kernel.org \
    --cc=iskren.chernev@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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