Received: by 2002:a05:6358:795:b0:dc:4c66:fc3e with SMTP id n21csp362115rwj; Sat, 29 Oct 2022 04:29:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5OG+aKt/PrNtIuDwkdSfhmGzF8+Tm+Hug2V/nAiEtEHlN+QrcZgg1Cvu1FoPh2ew3R5Ymv X-Received: by 2002:a17:906:4fcb:b0:791:9a26:376f with SMTP id i11-20020a1709064fcb00b007919a26376fmr3456821ejw.431.1667042950512; Sat, 29 Oct 2022 04:29:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667042950; cv=none; d=google.com; s=arc-20160816; b=u/0j6/VXCKAZRA/5ADwZQoopcTC8HAoLmssztBYFl7bD4Y1tBfJulMNkY6lMBsWxWg 8GaF2ukajR/IrZbw2TouDgZZrwainOInKVl9kDl8Kd5U1ih6tM2398OD1CYy8XnV7oQp Ty+7HMnhtFnq8pbIQp20XVfr1yETE24YTA3UDVmBsfZqy0GXLhEuYyjhb4DlvKyINVJ0 xR5bRzZLhoIVt7S+nlMGXJxhggl3vO3PwQn4UjN/8XMhG7Xeq6VyDY29CG4QoeMXldMq MePW4gOjGSBZE53VG6JMlJ4e7MX3XGAjmEUjeosnhG+CoqAXyNiwlKS7JnbGupzm6GJj Ljow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :mime-version:accept-language:in-reply-to:references:message-id:date :thread-index:thread-topic:subject:cc:to:from; bh=54OGeFA/lAGjUasfz5ckFF4hcZe5wvNRf8++RBabgLk=; b=uPvRey6JqDvsvm2zBpLWJfwdBUQsbrQClVJvkVwqAdr7dWOpRVm+2HLTQnkKaqYmsO QB079A2wDVLYO/R6k89hvB+J9oqVzCcUWBoR2nrku56tLbzVYONRTkUqwyAhR0ORbgK9 eFcvbFXyIjaTidX6hrwseBwuiUdE+DJ5aXNUC7+fpMXA6bSlmsRewAqvuIjwmteYMpbR dG01xheCWFQKpTCVWQWy4y5dVfhxTGeY03VgTzYedPqgccCgg2GvAiR8x3pfswu/KXDT QiP9yCvhf5D+MFaSzMcrfI2QFtkBUd0vCY5VkJzpc2Z/DVNU1g1RDiwRElgOV31BXYf/ NxgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vs22-20020a170907139600b00780d18701f2si1101922ejb.176.2022.10.29.04.28.46; Sat, 29 Oct 2022 04:29:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229574AbiJ2LPi convert rfc822-to-8bit (ORCPT + 99 others); Sat, 29 Oct 2022 07:15:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229491AbiJ2LPg (ORCPT ); Sat, 29 Oct 2022 07:15:36 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 743C8237CC for ; Sat, 29 Oct 2022 04:15:31 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-146-75xd6qPbO8iGWQnN0ZN75w-1; Sat, 29 Oct 2022 12:15:28 +0100 X-MC-Unique: 75xd6qPbO8iGWQnN0ZN75w-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Sat, 29 Oct 2022 12:15:27 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.042; Sat, 29 Oct 2022 12:15:27 +0100 From: David Laight To: 'Julia Lawall' , UMWARI JOVIAL CC: "gregkh@linuxfoundation.org" , "linux-staging@lists.linux.dev" , "linux-kernel@vger.kernel.org" , "outreachy@lists.linux.dev" Subject: RE: [PATCH] Remove Unnecessary typecast of c90 int constant Thread-Topic: [PATCH] Remove Unnecessary typecast of c90 int constant Thread-Index: AQHY6p4QqXp6c6aJbUmajhb1BaK9064lOaUg Date: Sat, 29 Oct 2022 11:15:27 +0000 Message-ID: References: <20221028063711.GA35659@rdm> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Julia Lawall > Sent: 28 October 2022 08:23 > > On Fri, 28 Oct 2022, UMWARI JOVIAL wrote: > > > According to Linux kernel coding style. > > > > Reported by checkpatch: > > WARNING: Unnecessary typecast of c90 int constant - '(int)2.412e8' could be '2.412e8' > > WARNING: Unnecessary typecast of c90 int constant - '(int)2.487e8' could be '2.487e8' > > It's not ideal to just include the checkpatch messges verbatim in your log > message. It woudl be better to say what you are doing and why, in > complete sentences ("According to the Linux coding style" is not a > complete sentence). > > I also suspect that the checkpatch message is wrong. Floating point > numbers cannot be used in the kernel, and the case of the constant ensures > that the value will be converted to an integer at compile time. Much better to just use 241200000u (or 241200u * 1000 for readability). David > > julia > > > > > Signed-off-by: UMWARI JOVIAL > > --- > > drivers/staging/rtl8192e/rtllib_softmac_wx.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c > b/drivers/staging/rtl8192e/rtllib_softmac_wx.c > > index fdf867a5dd7a..4fc4fb25d8d6 100644 > > --- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c > > +++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c > > @@ -41,8 +41,8 @@ int rtllib_wx_set_freq(struct rtllib_device *ieee, struct iw_request_info *a, > > > > /* if setting by freq convert to channel */ > > if (fwrq->e == 1) { > > - if ((fwrq->m >= (int)2.412e8 && > > - fwrq->m <= (int)2.487e8)) { > > + if ((fwrq->m >= 2.412e8 && > > + fwrq->m <= 2.487e8)) { > > int f = fwrq->m / 100000; > > int c = 0; > > > > -- > > 2.25.1 > > > > > > - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)