linux/drivers/power/reset
Nathan Chancellor 644106cdb8 power: reset: ltc2952: Fix use of floating point literals
A new commit in LLVM causes an error on the use of 'long double' when
'-mno-x87' is used, which the kernel does through an alias,
'-mno-80387' (see the LLVM commit below for more details around why it
does this).

drivers/power/reset/ltc2952-poweroff.c:162:28: error: expression requires  'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it
        data->wde_interval = 300L * 1E6L;
                                  ^
drivers/power/reset/ltc2952-poweroff.c:162:21: error: expression requires  'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it
        data->wde_interval = 300L * 1E6L;
                           ^
drivers/power/reset/ltc2952-poweroff.c:163:41: error: expression requires  'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it
        data->trigger_delay = ktime_set(2, 500L*1E6L);
                                               ^
3 errors generated.

This happens due to the use of a 'long double' literal. The 'E6' part of
'1E6L' causes the literal to be a 'double' then the 'L' suffix promotes
it to 'long double'.

There is no visible reason for floating point values in this driver, as
the values are only assigned to integer types. Use NSEC_PER_MSEC, which
is the same integer value as '1E6L', to avoid changing functionality but
fix the error.

Fixes: 6647156c00 ("power: reset: add LTC2952 poweroff driver")
Link: https://github.com/ClangBuiltLinux/linux/issues/1497
Link: a8083d42b1
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2021-11-16 15:22:39 +01:00
..
arm-versatile-reboot.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
as3722-poweroff.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 288 2019-06-05 17:36:37 +02:00
at91-poweroff.c power: reset: at91-poweroff: move shdwc related data to one structure 2018-12-06 21:56:37 +01:00
at91-reset.c power: reset: at91-reset: check properly the return value of devm_of_iomap 2021-10-02 17:40:34 +02:00
at91-sama5d2_shdwc.c power: reset: at91-sama5d2_shdwc: Remove redundant error printing in at91_shdwc_probe() 2021-06-04 13:04:01 +02:00
atc260x-poweroff.c power: reset: Add poweroff driver for ATC260x PMICs 2021-01-13 22:17:23 +01:00
axxia-reset.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
brcm-kona-reset.c power: Introduce Broadcom kona reset driver 2016-06-06 16:17:33 -07:00
brcmstb-reboot.c power/reset: brcmstb: Add support for old 65nm chips 2015-01-22 02:25:32 +01:00
gemini-poweroff.c power: gemini-poweroff: Avoid more spurious poweroffs 2018-07-06 16:34:01 +02:00
gpio-poweroff.c power: reset: gpio-poweroff: add missing MODULE_DEVICE_TABLE 2021-06-04 12:58:30 +02:00
gpio-restart.c power: reset: gpio-restart: don't error on deferral 2019-12-18 16:10:08 +01:00
hisi-reboot.c power: reset: hisi-reboot: add missing MODULE_DEVICE_TABLE 2021-04-09 13:50:01 +02:00
Kconfig power: reset: Add TPS65086 restart driver 2021-08-16 14:48:51 +02:00
keystone-reset.c drivers: power: add missing MODULE_DEVICE_TABLE in keystone-reset.c 2021-06-30 00:06:37 +02:00
linkstation-poweroff.c power: reset: linkstation-poweroff: add new device 2021-08-13 19:16:41 +02:00
ltc2952-poweroff.c power: reset: ltc2952: Fix use of floating point literals 2021-11-16 15:22:39 +01:00
Makefile power: reset: Add TPS65086 restart driver 2021-08-16 14:48:51 +02:00
msm-poweroff.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 284 2019-06-05 17:36:37 +02:00
mt6323-poweroff.c rtc: mt6397: Add support for the MediaTek MT6358 RTC 2020-05-21 08:55:48 +01:00
nvmem-reboot-mode.c power: reset: nvmem-reboot-mode: use NVMEM as reboot mode write interface 2019-06-25 23:58:40 +02:00
ocelot-reset.c power: reset: ocelot: Add support 2 other MIPS based SoCs 2020-11-29 22:34:07 +01:00
oxnas-restart.c power: reset: introduce oxnas-restart 2020-04-30 23:24:33 +02:00
piix4-poweroff.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
qcom-pon.c power: reset: qcom-pon: reg write mask depends on pon generation 2020-04-28 21:16:45 +02:00
qnap-poweroff.c power: reset: Use printk format symbol resolver 2020-11-30 02:10:18 +01:00
reboot-mode.c power: reset: reboot-mode: Fix author email format 2019-09-02 21:05:59 +02:00
regulator-poweroff.c power: reset: regulator-poweroff: add missing MODULE_DEVICE_TABLE 2021-06-29 23:55:12 +02:00
restart-poweroff.c power: reset: restart-poweroff: Add missing MODULE_DEVICE_TABLE 2021-04-12 21:18:52 +02:00
rmobile-reset.c power: reset: convert to SPDX identifiers 2018-09-16 11:42:48 +02:00
sc27xx-poweroff.c power supply and reset changes for the v5.7 series 2020-04-05 13:47:57 -07:00
st-poweroff.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
syscon-poweroff.c power: reset: Use printk format symbol resolver 2020-11-30 02:10:18 +01:00
syscon-reboot-mode.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
syscon-reboot.c power: reset: syscon-reboot: Add parental syscon support 2020-05-28 09:00:30 +02:00
tps65086-restart.c power: reset: Add TPS65086 restart driver 2021-08-16 14:48:51 +02:00
vexpress-poweroff.c power: reset: remove unneeded semicolon 2021-03-22 14:55:50 +01:00
xgene-reboot.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00