Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1948401rwi; Fri, 28 Oct 2022 00:38:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6BSKR0wNb9wMf8nQpzkdbonNPLr6sjjDmz4yotO6LNVzNPIkrd0BH1S5yKBTIpJHh7GnzK X-Received: by 2002:a17:907:2e01:b0:78d:f24b:7330 with SMTP id ig1-20020a1709072e0100b0078df24b7330mr45476505ejc.604.1666942693335; Fri, 28 Oct 2022 00:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666942693; cv=none; d=google.com; s=arc-20160816; b=sR3k0ud2JrCekrP+C09zGjxQlKFEpz6rRCJrxQ0kKn+a1WvsDspVkatb+rRSmzINmv k2t1bcuqCsKwBLPs/P23AVAo7PxZNOOaFe2KrOOl+WLny2WgEgCTg+U4tDB7CXXyUCy6 ZLr21CheHteiRxkn2N/EHt6UTD41vhoLI9AHYpUsZ+lnb5KF2/tkH08/En1q5K90qiiG SrlauD1zPMd0xfM+Bj1w82HrvFXE69CcOvEe/NW2cpReIVRQjZNK3QquIb9JecM/oSu4 rhcyJKC+SJjSogb2/uNGa6/c6ofwPK/C27RQE5HSkRKqph8LWRFtzPhw97eeL8KCfMnC Tyiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:dkim-signature; bh=0kHs01PQa80TsHGmTZUZWsuUjTB6ZMnDZZBdpbxyknA=; b=s7Je/9kyjop5VLIjkJDROAJWIq7nzYn36rcq0+bHVF0nw2e7jMqtQBH36l1iHUUZSv cqOsWSOUsMrARUxuEoZKC7OK4Ql1qBe1HMHJ9BRdW5JM3TEMzF9/SGdqWBLJC8TtuOEo AUDHw5cTpJqpOJmYCmaUIxtv4ZbTeFS4OBgnJC7u57BK/WhS/MpUobSrg66oZ52tbO6t ke3NTIerIX/LtgiK1NwNY6Ok3jSFH00lxoGdwOdMJTKcW1V2P1OW3tC2mqpfzkECQlxR vaeCtofxSKpdl7DtpoPSuxBLD5Y/xXYpFcgx+pSr7xVy9WFNdDdG0qPxn2a22FVPdP7c TYhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@inria.fr header.s=dc header.b=kmbA+1Ys; 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=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg4-20020a1709072cc400b00711da52c6e4si4244709ejc.309.2022.10.28.00.37.48; Fri, 28 Oct 2022 00:38:13 -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; dkim=pass header.i=@inria.fr header.s=dc header.b=kmbA+1Ys; 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=pass (p=NONE sp=NONE dis=NONE) header.from=inria.fr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbiJ1HWj (ORCPT + 99 others); Fri, 28 Oct 2022 03:22:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbiJ1HWh (ORCPT ); Fri, 28 Oct 2022 03:22:37 -0400 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41B45CD5F4 for ; Fri, 28 Oct 2022 00:22:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=0kHs01PQa80TsHGmTZUZWsuUjTB6ZMnDZZBdpbxyknA=; b=kmbA+1YsZfLc5Zs/C/3vkxApFiJBMskkMPoxWrVI+g2B59zrCOE8LtdQ nw4rf0okywtJUeUa4lH00QjdggpCSf6buI5twHJK/aZCBVDFXBD0XLHXM LKf8REzP0hDfYaxd70T7Kn5SBauaHwOVJcV8h/7yMnsbI+3cMGH9AGuNG Y=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=julia.lawall@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="5.95,220,1661810400"; d="scan'208";a="35792117" Received: from 51.123.68.85.rev.sfr.net (HELO hadrien) ([85.68.123.51]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2022 09:22:33 +0200 Date: Fri, 28 Oct 2022 09:22:33 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: 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 In-Reply-To: <20221028063711.GA35659@rdm> Message-ID: References: <20221028063711.GA35659@rdm> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 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. 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 > > >