Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2249669pxb; Thu, 4 Nov 2021 17:02:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAlWlBWW1XMez/4emQKkJkcezUbC+rIjbYZ6ZV5/8AeJCdo6IC8L70LoxHYRDel0BriHcr X-Received: by 2002:aa7:df8f:: with SMTP id b15mr60678689edy.202.1636070540504; Thu, 04 Nov 2021 17:02:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636070540; cv=none; d=google.com; s=arc-20160816; b=wSn/cJ9IerRPA3A6bRZzDH+SKNF0VNgIqwBmi9pkVludYy27Ka9JtAFg1i7HD4lN3z NljPtNeEPld3D2s5chL2msxyyZ+sfVBL8bywrto15HTUpzbwxcnFcZkC9K+VV5RhlW23 6NsfvNWKoi8Q5zvYC7AEjnAR8UpZSe7hzO4se/8X/hWcjwCPK83oqgNmdSyOxgk0TS/V FHaR0QSjnvjU2/2SJa+bAc6h62zInz/dWAKv+2go8Y687ObhMzXC8nx+sNqxDGzc1uEV wCLQODNRf6TzEVr5GmXlcbgrMSHujVofp0EmV6N+v4Zajz5Imks5OpU3pE2HlAMqJX5n oh8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=csw9Ea29/6mU1MEawS787Ofv0obgSoVnoUbREbOFBVE=; b=LDX/WKq9NKAVsSNgYrUvDaYGrJ6x8ypo+itDs7Zx55lPBUKXlsNhvyPCmkEXJkVhYn t/Z0Fg7eXaXrIu+LEokWKtKEhoP0dbAHZ8HgVxDTcYTY0uJBFGB/B4Lz/oeAs4f4OkpJ vNkX0JJ7CoNSZ5owuWonYTikUFnv2nrOYUxoXmQ/wzu2gR7ZA6nIUKoeLEN2yjzAeAqK vi7OpM7Cxx8iRNs3q7Eb2gKwRXxvXuFccjScoXaLKFlJQNZFvHuH5fs6IdP41rGymFwF JLgh0mpJZ4wOqIBu7PepTBQXbUnC4l0Tj1gQccGPvnNL3XTVpn29sCkjEdQZU3zBz3jP N/wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E56O7dJ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ck13si9263408edb.463.2021.11.04.17.01.50; Thu, 04 Nov 2021 17:02:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E56O7dJ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232446AbhKEAC0 (ORCPT + 99 others); Thu, 4 Nov 2021 20:02:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:51564 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232410AbhKEAC0 (ORCPT ); Thu, 4 Nov 2021 20:02:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0A56F604D2; Thu, 4 Nov 2021 23:59:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636070387; bh=ed29zpkeOjsycDqE+cquSEnEmDgcI51DG+xfYCKXcz4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E56O7dJ97Huw9uzbwz9GmCdTVSA/2qNNXJnG/u6mGPYRiohU8IMbXLFVtwhh0g87o UDcW+OCPZ40zr+YJUTKHL1AJVhKOXLciO9DgFpDM8OYub84f5XAHQeN16VFPimXQB0 +D0vMja12Rj/s59GKc5Zmxw7wgaiKrFjaHguWC9F5SqoMKLQUcKb1US4rmMiuYOfaA if1XE2rRox8P2kvY6dSnoxq0zVt8O+KvgwOL414uLIwGCm4Bv5tP3XthcKi/TaA3z+ 3+u/aLKe/OdnvJ2y3bHGq7sXyXxBGAcrKTxLXRcb8PQ5rMxpCnUpFLS6lsxtuLcZsF kwPsIXJnypQPA== Date: Thu, 4 Nov 2021 16:59:42 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: Minas Harutyunyan , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] usb: dwc2: hcd_queue: Fix use of floating point literal Message-ID: References: <20211104215923.719785-1-nathan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 04, 2021 at 04:33:41PM -0700, Nick Desaulniers wrote: > On Thu, Nov 4, 2021 at 4:29 PM Nick Desaulniers wrote: > > > > On Thu, Nov 4, 2021 at 2:59 PM Nathan Chancellor wrote: > > > > > > 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 USEC_PER_SEC, which is the same integer value as > > > '1E6L', to avoid changing functionality but fix the error. > > > > > > Fixes: 6ed30a7d8ec2 ("usb: dwc2: host: use hrtimer for NAK retries") > > > Link: https://github.com/ClangBuiltLinux/linux/issues/1497 > > > Link: https://github.com/llvm/llvm-project/commit/a8083d42b1c346e21623a1d36d1f0cadd7801d83 > > > Signed-off-by: Nathan Chancellor > > > > Thanks for the patch! > > Reviewed-by: Nick Desaulniers > > hmm...should we explicitly #include for this > declaration? It may work due to transitive includes, but that's > generally considered brittle should those transitive includes change > in the future. This file uses ktime_t, which comes from include/linux/ktime.h, which eventually includes include/vdso/time64.h. include/vdso/time64.h is only included in three header files and no drivers so I do not think this is that brittle. I am happy to change that if the maintainers feel it is worth the extra include. > > > > > --- > > > drivers/usb/dwc2/hcd_queue.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c > > > index 89a788326c56..bdf1927e1be1 100644 > > > --- a/drivers/usb/dwc2/hcd_queue.c > > > +++ b/drivers/usb/dwc2/hcd_queue.c > > > @@ -59,7 +59,7 @@ > > > #define DWC2_UNRESERVE_DELAY (msecs_to_jiffies(5)) > > > > > > /* If we get a NAK, wait this long before retrying */ > > > -#define DWC2_RETRY_WAIT_DELAY (1 * 1E6L) > > > +#define DWC2_RETRY_WAIT_DELAY (1 * USEC_PER_SEC) > > > > > > /** > > > * dwc2_periodic_channel_available() - Checks that a channel is available for a > > > > > > base-commit: d4439a1189f93d0ac1eaf0197db8e6b3e197d5c7 > > > -- > > > 2.34.0.rc0 > > > > > > > > > -- > > Thanks, > > ~Nick Desaulniers > > > > -- > Thanks, > ~Nick Desaulniers