Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2274597pxb; Thu, 4 Nov 2021 17:32:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMSIR/qNueD3dtjY8nj4xMr/Y9wk/Fhz4rIAltZ3dyY273j+KJug1ltjB+FoFx60bflaAJ X-Received: by 2002:a05:6e02:be8:: with SMTP id d8mr37847484ilu.44.1636072326734; Thu, 04 Nov 2021 17:32:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636072326; cv=none; d=google.com; s=arc-20160816; b=DkIEcNy8DaLcScNG+Wof7hTp0ECdUpf+LKq4Y5LIXs7Ohiw8fjgDedb4II9Blvl6d4 K9ZP7gaxjEWPx+ph1iIQb9e9Wy2z0lyxJaW5iJXbBxFgjfbil4D5THPGudstn8Yo8nsA MZ1qRZQEzr9Wbe1VosfENT3EKqqtj1MwDkcWwDHidJwmR6co+UHCouYmjDADDqTpeWAG g8XOCXU0DzIpgBTzVutB8ZI+iqkFl51x+Vr/oU/uKKYptfBVANprN1Y+zmOvtSUybohK ZmiFx0UYPqOVx6SXJe2iLjidYTwZnEPM2eDV8gyTiM5v2gwSwC+1i1w4tlEbPPdahdJj 8Zqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=fwKpNt7ymTVCYOYWKlB8RE2BRmpgEI+Zd0SnTr489iM=; b=f+g5kVgT+znYC2KhxzevXT0E5GT0ue+iNGwR3Q3f6+0RbyJmKeJo2QkZtmLMveMT0Q Ilc07uPFXOAJ+yJR/awaSIjg+BRfPIbK30YkdwbeWid1MRHRlwhPEKI/ZV+W1x5Fc/+J v7b5qbkCLDaFpAYw+RC0S+Yu1lEQ1IVu079Qw1SuBvw+RdwgOkIRVHTSWvYZvXV5cULb Ttzu/W5Ss9uavAf4mVh66IkmqhI7uaIe6zpXb2rotAGmjQDopkb7VqxOmvjamZvcwYPA pJEXKtts+qiNSWgkApJS35BKlbEij0FJVlaib8105HVeRNCPvQ+olP8IxVh2JjFqZ9i0 lhlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=aeCLODg8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g2si13470817ile.118.2021.11.04.17.31.25; Thu, 04 Nov 2021 17:32:06 -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=@google.com header.s=20210112 header.b=aeCLODg8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232002AbhKDXck (ORCPT + 99 others); Thu, 4 Nov 2021 19:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231756AbhKDXcj (ORCPT ); Thu, 4 Nov 2021 19:32:39 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D74B2C061203 for ; Thu, 4 Nov 2021 16:30:00 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id d12so11622675lfv.6 for ; Thu, 04 Nov 2021 16:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fwKpNt7ymTVCYOYWKlB8RE2BRmpgEI+Zd0SnTr489iM=; b=aeCLODg8lQVcApwUPT8C1pmcAbVwwb/el05kFi7evy79R6sHu2k++aDajKhhITDEFC KuzahGktT5SEBgkJK9HRi2MNjfOSNVqv/SkTA47KIiA1RFmxhpnNRVTBCMuHNEsexeaf NkRwDEBBgXLJ4BImz+E96ODpQL7Iy2+03Ewh7mD9bFQJpUG9O1++zDAmHb3Qi9JAwc1x OkHsY/E+k8cO2L9acTaKJ1IyIhZguoYv+oorD+66/CLSQl+buh53vFV5tItoavsh1JY1 qqqpbOjrsNfOfip8THdpy+ZPLnFwWa5uV/hyxt+P6KYV+8+CsWMGRGpJx8rnG51z7RK0 ebFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fwKpNt7ymTVCYOYWKlB8RE2BRmpgEI+Zd0SnTr489iM=; b=wM7gCkj64QiWIHg58oAJvHoIWLfs1LbRDn1m34pmK1YrqcvvV6kUPHSFwSFxHLvysG p79dC3PFJmEZ5N+kIUuZ+7Yp/K2GehJKX4wXq3o5wcNEHfwes8biQL3qj/WjyxIhnGny JgKGIdFToirA0kAjOkF/1UOoxWqsTlqDQVs78rjQqii7Awd4bAA8m3pvrSwh384uiBSI NnWzaY+yMvPuulMo1f/YaIlGXOSW1Of/QCOVqjBeIUhvkC7AWWGK0RKJUT1t5vDAMzEj Fc1B9wyRhINVpMtcQNKrezq8wT5jBllAMPun47QylpzHFLUUSW9maaCX0yPib7whDtGM YeEg== X-Gm-Message-State: AOAM531QXquX9h34Fanig4DUOmO41iO8U5TOS/HNrS4O39JWcdwaVhjn v6nW/wnzpGZboxT4j1UaDwdfC7sKlQszDsADioV+uQ== X-Received: by 2002:a05:6512:b29:: with SMTP id w41mr49675962lfu.240.1636068598804; Thu, 04 Nov 2021 16:29:58 -0700 (PDT) MIME-Version: 1.0 References: <20211104215923.719785-1-nathan@kernel.org> In-Reply-To: <20211104215923.719785-1-nathan@kernel.org> From: Nick Desaulniers Date: Thu, 4 Nov 2021 16:29:46 -0700 Message-ID: Subject: Re: [PATCH] usb: dwc2: hcd_queue: Fix use of floating point literal To: Nathan Chancellor Cc: Minas Harutyunyan , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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