lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <0ddf5cc8-8f16-ba7e-7587-3fa37b2a82b8@infradead.org>
Date:   Sun, 19 Feb 2023 10:38:09 -0800
From:   Randy Dunlap <rdunlap@...radead.org>
To:     Bjorn Andersson <bjorn.andersson@...aro.org>,
        Bjorn Andersson <quic_bjorande@...cinc.com>,
        Bjorn Andersson <andersson@...nel.org>
Cc:     Sebastian Reichel <sre@...nel.org>,
        Linux PM <linux-pm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: build warning in power: supply: Qualcomm PMIC GLINK power supply

Hi Bjorn,

FYI: (seen in passing, I wasn't looking for this.)

When doing compile tests on MIPS (32-bit):

In file included from ../arch/mips/include/asm/div64.h:89,
                 from ../include/linux/math.h:6,
                 from ../include/linux/math64.h:6,
                 from ../include/linux/time64.h:5,
                 from ../include/linux/restart_block.h:10,
                 from ../include/linux/thread_info.h:14,
                 from ../include/asm-generic/current.h:5,
                 from ./arch/mips/include/generated/asm/current.h:1,
                 from ../include/linux/sched.h:12,
                 from ../include/linux/ratelimit.h:6,
                 from ../include/linux/dev_printk.h:16,
                 from ../include/linux/device.h:15,
                 from ../include/linux/auxiliary_bus.h:11,
                 from ../drivers/power/supply/qcom_battmgr.c:6:
../drivers/power/supply/qcom_battmgr.c: In function 'qcom_battmgr_sm8350_callback':
../include/asm-generic/div64.h:222:35: warning: comparison of distinct pointer types lacks a cast
  222 |         (void)(((typeof((n)) *)0) == ((uint64_t *)0));  \
      |                                   ^~
../drivers/power/supply/qcom_battmgr.c:1130:25: note: in expansion of macro 'do_div'
 1130 |                         do_div(battmgr->status.percent, 100);
      |                         ^~~~~~
In file included from ../include/linux/dev_printk.h:14:
../include/asm-generic/div64.h:234:32: warning: right shift count >= width of type [-Wshift-count-overflow]
  234 |         } else if (likely(((n) >> 32) == 0)) {          \
      |                                ^~
../include/linux/compiler.h:77:45: note: in definition of macro 'likely'
   77 | # define likely(x)      __builtin_expect(!!(x), 1)
      |                                             ^
../drivers/power/supply/qcom_battmgr.c:1130:25: note: in expansion of macro 'do_div'
 1130 |                         do_div(battmgr->status.percent, 100);
      |                         ^~~~~~


The first argument must be 64-bit. qcom_battmgr_status.percent is 'unsigned int',
which is not 64-bit (AFAIK; and according to LDD3).

-- 
~Randy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ