Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 310780e

Browse files
nathanchancegregkh
authored andcommitted
usb: dwc2: hcd_queue: Fix use of floating point literal
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/usb/dwc2/hcd_queue.c:1744:25: error: expression requires 'long double' type support, but target 'x86_64-unknown-linux-gnu' does not support it delay = ktime_set(0, DWC2_RETRY_WAIT_DELAY); ^ drivers/usb/dwc2/hcd_queue.c:62:34: note: expanded from macro 'DWC2_RETRY_WAIT_DELAY' #define DWC2_RETRY_WAIT_DELAY (1 * 1E6L) ^ 1 error 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 a floating point value in this driver, as the value is only used as a parameter to a function that expects an integer type. Use NSEC_PER_MSEC, which is the same integer value as '1E6L', to avoid changing functionality but fix the error. Link: ClangBuiltLinux#1497 Link: llvm/llvm-project@a8083d4 Fixes: 6ed30a7 ("usb: dwc2: host: use hrtimer for NAK retries") Cc: stable <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: John Keeping <[email protected]> Acked-by: Minas Harutyunyan <[email protected]> Signed-off-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2628844 commit 310780e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/usb/dwc2/hcd_queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#define DWC2_UNRESERVE_DELAY (msecs_to_jiffies(5))
6060

6161
/* If we get a NAK, wait this long before retrying */
62-
#define DWC2_RETRY_WAIT_DELAY (1 * 1E6L)
62+
#define DWC2_RETRY_WAIT_DELAY (1 * NSEC_PER_MSEC)
6363

6464
/**
6565
* dwc2_periodic_channel_available() - Checks that a channel is available for a

0 commit comments

Comments
 (0)