Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4092320ybh; Tue, 6 Aug 2019 06:13:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZTQMYNBwQn7tE5may/jR72ug2OB15MROWRFrN+CXNsm/XsgN0pHBkIdW56PXO0qTyFDO7 X-Received: by 2002:a17:902:100a:: with SMTP id b10mr3088852pla.338.1565097196478; Tue, 06 Aug 2019 06:13:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565097196; cv=none; d=google.com; s=arc-20160816; b=RZIxSjRkkV4XYdrBvmYqT+Ek/2dg1bFkvZZ85MFVQgxlMVDqgCLPSyvcJwvNSBNVX9 lokSImn7hPcDvmU0F+NnctPW+MqIWP+LdkXIAED5ULTeYHPNVCRV0c1VsVhVtJMwpQkt ATELYu1aghBeWYAGzdDfRTyq68zdFhFsGqSg/89DWSgrBM/nfgzTFYW590vyhxcr8mF0 piUz7yak9mCGeD99U4urxgjKh//GERLa3x5aPqDZKkWtszmo3k+YXwDbYkvf/fkPwt5g Qqv8xMbCqPUFyu89FqN85sGHXNq4oX7G55VQa4g7J6LdbmIUZBwsVDTRbiMNCNDsrUID MNHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=YlRnRTR4pwJBmDVRwFVpnW79shG41xNn3FILNYPh7To=; b=HHacw8bpCQ8Kvmf7TP70g2ihv3A8vqgWRCZ7fIxpRA7qtuhIGuVxZfOzygb+lRqbLp JLhVJ53uhL12dkjuKntXnmYHyShEJAQAYR8sIfoClkf60D/MmTh2pqVKJU2MXhIoWKQ6 Pnyb+nAwWR3jWvvX2aGK8EhT8SaMPzXzAdaFHRnwbjp4XAkrkrlmDc1mQDXJaU0+q9Hy WfJ6Hz1gFaEPULUwiUy6qGrVccZ9ZgPm0I2q1cgOJkwAMMZTW2QPtlcoYRotpCapK79o 72Cappmh+o/VybNd/jqSBRStn4MIdyhNQvvD1XVr/0kNE/VMxSl3qCjXqzWvxo4qUOcH xB2w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h186si48724328pge.110.2019.08.06.06.13.00; Tue, 06 Aug 2019 06:13:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731963AbfHFNKT convert rfc822-to-8bit (ORCPT + 99 others); Tue, 6 Aug 2019 09:10:19 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([146.101.78.151]:29072 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731515AbfHFNKT (ORCPT ); Tue, 6 Aug 2019 09:10:19 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-31-8SN7SsMjODOE3pGV42hYng-1; Tue, 06 Aug 2019 14:10:15 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Tue, 6 Aug 2019 14:10:14 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Tue, 6 Aug 2019 14:10:14 +0100 From: David Laight To: 'Dan Carpenter' , Jose Carlos Cazarin Filho CC: "Larry.Finger@lwfinger.net" , "florian.c.schilhabel@googlemail.com" , "gregkh@linuxfoundation.org" , "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , "lkcamp@lists.libreplanetbr.org" Subject: RE: [PATCH] rtl8712: rtl871x_ioctl_linux.c: fix unnecessary typecast Thread-Topic: [PATCH] rtl8712: rtl871x_ioctl_linux.c: fix unnecessary typecast Thread-Index: AQHVTE2Sh/UbLvavCEKXN3OpolxoRabuFsqQ Date: Tue, 6 Aug 2019 13:10:14 +0000 Message-ID: <8d6c6714f9ca46ab90b2a747c05b899b@AcuMS.aculab.com> References: <20190806013329.28574-1-joseespiriki@gmail.com> <20190806115305.GF1974@kadam> In-Reply-To: <20190806115305.GF1974@kadam> Accept-Language: en-GB, en-US Content-Language: 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-MC-Unique: 8SN7SsMjODOE3pGV42hYng-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter > Sent: 06 August 2019 12:53 > On Mon, Aug 05, 2019 at 10:33:29PM -0300, Jose Carlos Cazarin Filho wrote: > > Fix checkpath warning: > > WARNING: Unnecessary typecast of c90 int constant > > > > Signed-off-by: Jose Carlos Cazarin Filho > > --- > > Hello all! > > This is my first commit to the Linux Kernel, I'm doing this to learn and be able > > to contribute more in the future > > Peace all! > > drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > index 944336e0d..da371072e 100644 > > --- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > +++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c > > @@ -665,8 +665,8 @@ static int r8711_wx_set_freq(struct net_device *dev, > > > > /* If setting by frequency, convert to a channel */ > > if ((fwrq->e == 1) && > > - (fwrq->m >= (int) 2.412e8) && > > - (fwrq->m <= (int) 2.487e8)) { > > + (fwrq->m >= 2.412e8) && > > + (fwrq->m <= 2.487e8)) { > > I don't think we can do this. You're not allowed to use floats in the > kernel (because they make context switching slow). I could have sworn > that we use the -nofp to stop the compile when people use floats but > this compiles fine for me. My guess is the 'c90 int constant' text. It rather implies that '2.412e8' has become the same as '2141200000'. Which is rather worrying because suddenly 'int_var * 2.4e8' might be an integer multiply rather than a double one and overflow. Have the standard people broken code again? David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)