From: Greg KH <gregkh@linuxfoundation.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: ndesaulniers@google.com, sebastian.reichel@collabora.com,
stable@vger.kernel.org
Subject: Re: [PATCH 4.4,4.9] power: reset: ltc2952: Fix use of floating point literals
Date: Mon, 10 Jan 2022 07:56:10 +0100 [thread overview]
Message-ID: <YdvYih67e806pY0g@kroah.com> (raw)
In-Reply-To: <20220109185902.1097931-1-nathan@kernel.org>
On Sun, Jan 09, 2022 at 11:59:02AM -0700, Nathan Chancellor wrote:
> commit 644106cdb89844be2496b21175b7c0c2e0fab381 upstream.
>
> 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: 6647156c00cc ("power: reset: add LTC2952 poweroff driver")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1497
> Link: https://github.com/llvm/llvm-project/commit/a8083d42b1c346e21623a1d36d1f0cadd7801d83
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
> [nathan: Resolve conflict due to lack of 8b0e195314fab]
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
> drivers/power/reset/ltc2952-poweroff.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Now queued up, thanks.
greg k-h
prev parent reply other threads:[~2022-01-10 6:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-09 12:51 FAILED: patch "[PATCH] power: reset: ltc2952: Fix use of floating point literals" failed to apply to 4.9-stable tree gregkh
2022-01-09 18:59 ` [PATCH 4.4,4.9] power: reset: ltc2952: Fix use of floating point literals Nathan Chancellor
2022-01-10 6:56 ` Greg KH [this message]
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=YdvYih67e806pY0g@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=sebastian.reichel@collabora.com \
--cc=stable@vger.kernel.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 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).