* drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types)
@ 2023-08-27 22:19 kernel test robot
2023-09-13 14:43 ` Sebastian Reichel
0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2023-08-27 22:19 UTC (permalink / raw)
To: Bjorn Andersson; +Cc: oe-kbuild-all, linux-kernel, Neil Armstrong
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 85eb043618bb17124050197d71c453d4a1f556e5
commit: 29e8142b5623b5949587bcc4f591c4e6595c4aca power: supply: Introduce Qualcomm PMIC GLINK power supply
date: 7 months ago
config: i386-randconfig-061-20230828 (https://download.01.org/0day-ci/archive/20230828/202308280602.nE6xa80J-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230828/202308280602.nE6xa80J-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/202308280602.nE6xa80J-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
drivers/power/supply/qcom_battmgr.c:357:31: sparse: expected unsigned int [usertype] battery_id
drivers/power/supply/qcom_battmgr.c:357:31: sparse: got restricted __le32 [usertype]
drivers/power/supply/qcom_battmgr.c:369:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
drivers/power/supply/qcom_battmgr.c:369:31: sparse: expected unsigned int [usertype] battery_id
drivers/power/supply/qcom_battmgr.c:369:31: sparse: got restricted __le32 [usertype]
>> drivers/power/supply/qcom_battmgr.c:1286:30: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] owner @@ got int @@
drivers/power/supply/qcom_battmgr.c:1286:30: sparse: expected restricted __le32 [usertype] owner
drivers/power/supply/qcom_battmgr.c:1286:30: sparse: got int
>> drivers/power/supply/qcom_battmgr.c:1287:29: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] type @@ got int @@
drivers/power/supply/qcom_battmgr.c:1287:29: sparse: expected restricted __le32 [usertype] type
drivers/power/supply/qcom_battmgr.c:1287:29: sparse: got int
>> drivers/power/supply/qcom_battmgr.c:1288:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] opcode @@ got int @@
drivers/power/supply/qcom_battmgr.c:1288:31: sparse: expected restricted __le32 [usertype] opcode
drivers/power/supply/qcom_battmgr.c:1288:31: sparse: got int
vim +357 drivers/power/supply/qcom_battmgr.c
350
351 static int qcom_battmgr_update_status(struct qcom_battmgr *battmgr)
352 {
353 struct qcom_battmgr_update_request request = {
354 .hdr.owner = cpu_to_le32(PMIC_GLINK_OWNER_BATTMGR),
355 .hdr.type = cpu_to_le32(PMIC_GLINK_REQ_RESP),
356 .hdr.opcode = cpu_to_le32(BATTMGR_BAT_STATUS),
> 357 .battery_id = cpu_to_le32(0),
358 };
359
360 return qcom_battmgr_request(battmgr, &request, sizeof(request));
361 }
362
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types)
2023-08-27 22:19 drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types) kernel test robot
@ 2023-09-13 14:43 ` Sebastian Reichel
0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Reichel @ 2023-09-13 14:43 UTC (permalink / raw)
To: Bjorn Andersson; +Cc: oe-kbuild-all, linux-kernel, Neil Armstrong
[-- Attachment #1: Type: text/plain, Size: 3613 bytes --]
Hi Bjorn,
On Mon, Aug 28, 2023 at 06:19:22AM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 85eb043618bb17124050197d71c453d4a1f556e5
> commit: 29e8142b5623b5949587bcc4f591c4e6595c4aca power: supply: Introduce Qualcomm PMIC GLINK power supply
> date: 7 months ago
> config: i386-randconfig-061-20230828 (https://download.01.org/0day-ci/archive/20230828/202308280602.nE6xa80J-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
> reproduce: (https://download.01.org/0day-ci/archive/20230828/202308280602.nE6xa80J-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/202308280602.nE6xa80J-lkp@intel.com/
>
> sparse warnings: (new ones prefixed by >>)
> >> drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
> drivers/power/supply/qcom_battmgr.c:357:31: sparse: expected unsigned int [usertype] battery_id
> drivers/power/supply/qcom_battmgr.c:357:31: sparse: got restricted __le32 [usertype]
> drivers/power/supply/qcom_battmgr.c:369:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
> drivers/power/supply/qcom_battmgr.c:369:31: sparse: expected unsigned int [usertype] battery_id
> drivers/power/supply/qcom_battmgr.c:369:31: sparse: got restricted __le32 [usertype]
> >> drivers/power/supply/qcom_battmgr.c:1286:30: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] owner @@ got int @@
> drivers/power/supply/qcom_battmgr.c:1286:30: sparse: expected restricted __le32 [usertype] owner
> drivers/power/supply/qcom_battmgr.c:1286:30: sparse: got int
> >> drivers/power/supply/qcom_battmgr.c:1287:29: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] type @@ got int @@
> drivers/power/supply/qcom_battmgr.c:1287:29: sparse: expected restricted __le32 [usertype] type
> drivers/power/supply/qcom_battmgr.c:1287:29: sparse: got int
> >> drivers/power/supply/qcom_battmgr.c:1288:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] opcode @@ got int @@
> drivers/power/supply/qcom_battmgr.c:1288:31: sparse: expected restricted __le32 [usertype] opcode
> drivers/power/supply/qcom_battmgr.c:1288:31: sparse: got int
>
> vim +357 drivers/power/supply/qcom_battmgr.c
>
> 350
> 351 static int qcom_battmgr_update_status(struct qcom_battmgr *battmgr)
> 352 {
> 353 struct qcom_battmgr_update_request request = {
> 354 .hdr.owner = cpu_to_le32(PMIC_GLINK_OWNER_BATTMGR),
> 355 .hdr.type = cpu_to_le32(PMIC_GLINK_REQ_RESP),
> 356 .hdr.opcode = cpu_to_le32(BATTMGR_BAT_STATUS),
> > 357 .battery_id = cpu_to_le32(0),
> 358 };
> 359
> 360 return qcom_battmgr_request(battmgr, &request, sizeof(request));
> 361 }
> 362
It looks like battery_id should be __le32 in 'struct
qcom_battmgr_update_request', care to send a patch for that?
Greetings,
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types)
@ 2023-09-16 13:15 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2023-09-16 13:15 UTC (permalink / raw)
To: Bjorn Andersson; +Cc: oe-kbuild-all, linux-kernel, Neil Armstrong
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 57d88e8a5974644039fbc47806bac7bb12025636
commit: 29e8142b5623b5949587bcc4f591c4e6595c4aca power: supply: Introduce Qualcomm PMIC GLINK power supply
date: 7 months ago
config: i386-randconfig-062-20230916 (https://download.01.org/0day-ci/archive/20230916/202309162149.4owm9iXc-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230916/202309162149.4owm9iXc-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/202309162149.4owm9iXc-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
drivers/power/supply/qcom_battmgr.c:357:31: sparse: expected unsigned int [usertype] battery_id
drivers/power/supply/qcom_battmgr.c:357:31: sparse: got restricted __le32 [usertype]
drivers/power/supply/qcom_battmgr.c:369:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
drivers/power/supply/qcom_battmgr.c:369:31: sparse: expected unsigned int [usertype] battery_id
drivers/power/supply/qcom_battmgr.c:369:31: sparse: got restricted __le32 [usertype]
>> drivers/power/supply/qcom_battmgr.c:1286:30: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] owner @@ got int @@
drivers/power/supply/qcom_battmgr.c:1286:30: sparse: expected restricted __le32 [usertype] owner
drivers/power/supply/qcom_battmgr.c:1286:30: sparse: got int
>> drivers/power/supply/qcom_battmgr.c:1287:29: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] type @@ got int @@
drivers/power/supply/qcom_battmgr.c:1287:29: sparse: expected restricted __le32 [usertype] type
drivers/power/supply/qcom_battmgr.c:1287:29: sparse: got int
>> drivers/power/supply/qcom_battmgr.c:1288:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] opcode @@ got int @@
drivers/power/supply/qcom_battmgr.c:1288:31: sparse: expected restricted __le32 [usertype] opcode
drivers/power/supply/qcom_battmgr.c:1288:31: sparse: got int
vim +357 drivers/power/supply/qcom_battmgr.c
350
351 static int qcom_battmgr_update_status(struct qcom_battmgr *battmgr)
352 {
353 struct qcom_battmgr_update_request request = {
354 .hdr.owner = cpu_to_le32(PMIC_GLINK_OWNER_BATTMGR),
355 .hdr.type = cpu_to_le32(PMIC_GLINK_REQ_RESP),
356 .hdr.opcode = cpu_to_le32(BATTMGR_BAT_STATUS),
> 357 .battery_id = cpu_to_le32(0),
358 };
359
360 return qcom_battmgr_request(battmgr, &request, sizeof(request));
361 }
362
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types)
@ 2023-03-10 17:04 kernel test robot
2023-03-11 17:54 ` [PATCHv1 01/11] dt-bindings: power: supply: adc-battery: add binding Sebastian Reichel
0 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2023-03-10 17:04 UTC (permalink / raw)
To: Arnd Bergmann
Cc: oe-kbuild-all, linux-kernel, Geert Uytterhoeven, Konrad Dybcio
Hi Arnd,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 44889ba56cbb3d51154660ccd15818bc77276696
commit: 92304df83b943776492309f42452effea0cc1089 power: supply: qcom_battmgr: remove bogus do_div()
date: 9 days ago
config: openrisc-randconfig-s042-20230310 (https://download.01.org/0day-ci/archive/20230311/202303110050.1EF6YVC5-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=92304df83b943776492309f42452effea0cc1089
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 92304df83b943776492309f42452effea0cc1089
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=openrisc olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/power/supply/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303110050.1EF6YVC5-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
drivers/power/supply/qcom_battmgr.c:357:31: sparse: expected unsigned int [usertype] battery_id
drivers/power/supply/qcom_battmgr.c:357:31: sparse: got restricted __le32 [usertype]
drivers/power/supply/qcom_battmgr.c:369:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
drivers/power/supply/qcom_battmgr.c:369:31: sparse: expected unsigned int [usertype] battery_id
drivers/power/supply/qcom_battmgr.c:369:31: sparse: got restricted __le32 [usertype]
>> drivers/power/supply/qcom_battmgr.c:1285:30: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] owner @@ got int @@
drivers/power/supply/qcom_battmgr.c:1285:30: sparse: expected restricted __le32 [usertype] owner
drivers/power/supply/qcom_battmgr.c:1285:30: sparse: got int
>> drivers/power/supply/qcom_battmgr.c:1286:29: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] type @@ got int @@
drivers/power/supply/qcom_battmgr.c:1286:29: sparse: expected restricted __le32 [usertype] type
drivers/power/supply/qcom_battmgr.c:1286:29: sparse: got int
>> drivers/power/supply/qcom_battmgr.c:1287:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] opcode @@ got int @@
drivers/power/supply/qcom_battmgr.c:1287:31: sparse: expected restricted __le32 [usertype] opcode
drivers/power/supply/qcom_battmgr.c:1287:31: sparse: got int
vim +357 drivers/power/supply/qcom_battmgr.c
29e8142b5623b5 Bjorn Andersson 2023-02-07 350
29e8142b5623b5 Bjorn Andersson 2023-02-07 351 static int qcom_battmgr_update_status(struct qcom_battmgr *battmgr)
29e8142b5623b5 Bjorn Andersson 2023-02-07 352 {
29e8142b5623b5 Bjorn Andersson 2023-02-07 353 struct qcom_battmgr_update_request request = {
29e8142b5623b5 Bjorn Andersson 2023-02-07 354 .hdr.owner = cpu_to_le32(PMIC_GLINK_OWNER_BATTMGR),
29e8142b5623b5 Bjorn Andersson 2023-02-07 355 .hdr.type = cpu_to_le32(PMIC_GLINK_REQ_RESP),
29e8142b5623b5 Bjorn Andersson 2023-02-07 356 .hdr.opcode = cpu_to_le32(BATTMGR_BAT_STATUS),
29e8142b5623b5 Bjorn Andersson 2023-02-07 @357 .battery_id = cpu_to_le32(0),
29e8142b5623b5 Bjorn Andersson 2023-02-07 358 };
29e8142b5623b5 Bjorn Andersson 2023-02-07 359
29e8142b5623b5 Bjorn Andersson 2023-02-07 360 return qcom_battmgr_request(battmgr, &request, sizeof(request));
29e8142b5623b5 Bjorn Andersson 2023-02-07 361 }
29e8142b5623b5 Bjorn Andersson 2023-02-07 362
:::::: The code at line 357 was first introduced by commit
:::::: 29e8142b5623b5949587bcc4f591c4e6595c4aca power: supply: Introduce Qualcomm PMIC GLINK power supply
:::::: TO: Bjorn Andersson <bjorn.andersson@linaro.org>
:::::: CC: Bjorn Andersson <andersson@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCHv1 01/11] dt-bindings: power: supply: adc-battery: add binding
@ 2023-03-11 17:54 ` Sebastian Reichel
2023-03-12 22:46 ` drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types) Sebastian Reichel
0 siblings, 1 reply; 6+ messages in thread
From: Sebastian Reichel @ 2023-03-11 17:54 UTC (permalink / raw)
To: Linus Walleij
Cc: Matti Vaittinen, Rob Herring, Krzysztof Kozlowski, linux-kernel,
linux-pm, devicetree
[-- Attachment #1: Type: text/plain, Size: 2038 bytes --]
Hi Linus,
On Fri, Mar 10, 2023 at 09:14:39AM +0100, Linus Walleij wrote:
> Hi Sebastian,
>
> thanks for your patches!
>
> On Thu, Mar 9, 2023 at 11:50 PM Sebastian Reichel <sre@kernel.org> wrote:
>
> > Add binding for a battery that is only monitored via ADC
> > channels and simple status GPIOs.
> >
> > Signed-off-by: Sebastian Reichel <sre@kernel.org>
>
> This does look very useful.
:)
> > +title: ADC battery
> > +
> > +maintainers:
> > + - Sebastian Reichel <sre@kernel.org>
> > +
> > +description: |
> > + Basic Battery, which only reports (in circuit) voltage and optionally
> > + current via an ADC channel.
>
> I would over-specify: "voltage over the terminals" and
> "current out of the battery" so this cannot be misunderstood.
>
> + this text:
>
> It can also optionally indicate that the battery is full by pulling a GPIO
> line.
Ack.
>
> > + charged-gpios:
> > + description:
> > + GPIO which signals that the battery is fully charged.
>
> It doesn't say how, I guess either this is an analog circuit (!) or
> a charger IC? If it doesn't matter, no big deal, but if something is
> implicit here, then spell it out please.
In my case the GPIO is provided by a charger chip, that is not
software controllable (just reports charge-done & charger-connected
via GPIOs). I've seen something similar in a customer device some
years ago. I will add a sentence:
The GPIO is often provided by charger ICs, that are not software
controllable.
> > + fuel-gauge {
>
> This techno-lingo/slang term is a bit unfortunate, but if there are
> precedents then stick with it.
>
> The correct term could be something like battery-capacity-meter
> I suppose.
Right now in DT we have
- specific node name (e.g. chip names) that should be changed :)
- smart-battery
- battery
- fuel-gauge
I think fuel-gauge is the most sensible of that list, considering
hardware vendors usually call their chips battery fuel gauge.
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types)
2023-03-11 17:54 ` [PATCHv1 01/11] dt-bindings: power: supply: adc-battery: add binding Sebastian Reichel
@ 2023-03-12 22:46 ` Sebastian Reichel
0 siblings, 0 replies; 6+ messages in thread
From: Sebastian Reichel @ 2023-03-12 22:46 UTC (permalink / raw)
To: Bjorn Andersson, Bjorn Andersson
Cc: Arnd Bergmann, oe-kbuild-all, linux-kernel, Geert Uytterhoeven,
Konrad Dybcio, linux-pm
[-- Attachment #1: Type: text/plain, Size: 2350 bytes --]
Hi Bjorn,
Can you please send a follow up patch for the sparse warnings in
qcom_battmgr [0]? It looks like there are two issues:
1. qcom_battmgr_update_request.battery_id is u32 instead of __le32
2. qcom_battmgr_enable_worker is missing cpu_to_le32() when building
struct qcom_battmgr_enable_request
[0] https://lore.kernel.org/all/202303110050.1EF6YVC5-lkp@intel.com/
> sparse warnings: (new ones prefixed by >>)
> >> drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
> drivers/power/supply/qcom_battmgr.c:357:31: sparse: expected unsigned int [usertype] battery_id
> drivers/power/supply/qcom_battmgr.c:357:31: sparse: got restricted __le32 [usertype]
> drivers/power/supply/qcom_battmgr.c:369:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
> drivers/power/supply/qcom_battmgr.c:369:31: sparse: expected unsigned int [usertype] battery_id
> drivers/power/supply/qcom_battmgr.c:369:31: sparse: got restricted __le32 [usertype]
> >> drivers/power/supply/qcom_battmgr.c:1285:30: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] owner @@ got int @@
> drivers/power/supply/qcom_battmgr.c:1285:30: sparse: expected restricted __le32 [usertype] owner
> drivers/power/supply/qcom_battmgr.c:1285:30: sparse: got int
> >> drivers/power/supply/qcom_battmgr.c:1286:29: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] type @@ got int @@
> drivers/power/supply/qcom_battmgr.c:1286:29: sparse: expected restricted __le32 [usertype] type
> drivers/power/supply/qcom_battmgr.c:1286:29: sparse: got int
> >> drivers/power/supply/qcom_battmgr.c:1287:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] opcode @@ got int @@
> drivers/power/supply/qcom_battmgr.c:1287:31: sparse: expected restricted __le32 [usertype] opcode
> drivers/power/supply/qcom_battmgr.c:1287:31: sparse: got int
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types)
@ 2023-03-04 10:37 kernel test robot
0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2023-03-04 10:37 UTC (permalink / raw)
To: Arnd Bergmann
Cc: oe-kbuild-all, linux-kernel, Geert Uytterhoeven, Konrad Dybcio
Hi Arnd,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0988a0ea791999ebbf95693f2676381825b05033
commit: 92304df83b943776492309f42452effea0cc1089 power: supply: qcom_battmgr: remove bogus do_div()
date: 3 days ago
config: openrisc-randconfig-s052-20230302 (https://download.01.org/0day-ci/archive/20230304/202303041819.L36zCcwM-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 12.1.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=92304df83b943776492309f42452effea0cc1089
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 92304df83b943776492309f42452effea0cc1089
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=openrisc olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=openrisc SHELL=/bin/bash drivers/power/supply/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303041819.L36zCcwM-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
drivers/power/supply/qcom_battmgr.c:357:31: sparse: expected unsigned int [usertype] battery_id
drivers/power/supply/qcom_battmgr.c:357:31: sparse: got restricted __le32 [usertype]
drivers/power/supply/qcom_battmgr.c:369:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned int [usertype] battery_id @@ got restricted __le32 [usertype] @@
drivers/power/supply/qcom_battmgr.c:369:31: sparse: expected unsigned int [usertype] battery_id
drivers/power/supply/qcom_battmgr.c:369:31: sparse: got restricted __le32 [usertype]
>> drivers/power/supply/qcom_battmgr.c:1285:30: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] owner @@ got int @@
drivers/power/supply/qcom_battmgr.c:1285:30: sparse: expected restricted __le32 [usertype] owner
drivers/power/supply/qcom_battmgr.c:1285:30: sparse: got int
>> drivers/power/supply/qcom_battmgr.c:1286:29: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] type @@ got int @@
drivers/power/supply/qcom_battmgr.c:1286:29: sparse: expected restricted __le32 [usertype] type
drivers/power/supply/qcom_battmgr.c:1286:29: sparse: got int
>> drivers/power/supply/qcom_battmgr.c:1287:31: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] opcode @@ got int @@
drivers/power/supply/qcom_battmgr.c:1287:31: sparse: expected restricted __le32 [usertype] opcode
drivers/power/supply/qcom_battmgr.c:1287:31: sparse: got int
vim +357 drivers/power/supply/qcom_battmgr.c
29e8142b5623b5 Bjorn Andersson 2023-02-07 350
29e8142b5623b5 Bjorn Andersson 2023-02-07 351 static int qcom_battmgr_update_status(struct qcom_battmgr *battmgr)
29e8142b5623b5 Bjorn Andersson 2023-02-07 352 {
29e8142b5623b5 Bjorn Andersson 2023-02-07 353 struct qcom_battmgr_update_request request = {
29e8142b5623b5 Bjorn Andersson 2023-02-07 354 .hdr.owner = cpu_to_le32(PMIC_GLINK_OWNER_BATTMGR),
29e8142b5623b5 Bjorn Andersson 2023-02-07 355 .hdr.type = cpu_to_le32(PMIC_GLINK_REQ_RESP),
29e8142b5623b5 Bjorn Andersson 2023-02-07 356 .hdr.opcode = cpu_to_le32(BATTMGR_BAT_STATUS),
29e8142b5623b5 Bjorn Andersson 2023-02-07 @357 .battery_id = cpu_to_le32(0),
29e8142b5623b5 Bjorn Andersson 2023-02-07 358 };
29e8142b5623b5 Bjorn Andersson 2023-02-07 359
29e8142b5623b5 Bjorn Andersson 2023-02-07 360 return qcom_battmgr_request(battmgr, &request, sizeof(request));
29e8142b5623b5 Bjorn Andersson 2023-02-07 361 }
29e8142b5623b5 Bjorn Andersson 2023-02-07 362
:::::: The code at line 357 was first introduced by commit
:::::: 29e8142b5623b5949587bcc4f591c4e6595c4aca power: supply: Introduce Qualcomm PMIC GLINK power supply
:::::: TO: Bjorn Andersson <bjorn.andersson@linaro.org>
:::::: CC: Bjorn Andersson <andersson@kernel.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-09-16 13:17 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-27 22:19 drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types) kernel test robot
2023-09-13 14:43 ` Sebastian Reichel
-- strict thread matches above, loose matches on Subject: below --
2023-09-16 13:15 kernel test robot
2023-03-10 17:04 kernel test robot
2023-03-11 17:54 ` [PATCHv1 01/11] dt-bindings: power: supply: adc-battery: add binding Sebastian Reichel
2023-03-12 22:46 ` drivers/power/supply/qcom_battmgr.c:357:31: sparse: sparse: incorrect type in initializer (different base types) Sebastian Reichel
2023-03-04 10:37 kernel test robot
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).