Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4073892imm; Sat, 21 Jul 2018 09:30:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdhK2SiqTw/4qnnf4cFAEzHyvEtCuLxU/++oWbCGXQBpyU+1g6DqdWVBGXH5CHQu1Ssmdfo X-Received: by 2002:a65:5086:: with SMTP id r6-v6mr6047859pgp.375.1532190635569; Sat, 21 Jul 2018 09:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532190635; cv=none; d=google.com; s=arc-20160816; b=DhQAn9fw0I8dnQ4Z5576m5sP5hafHAzIpGzuUGnCsEmI0dC6TZolkYjwFp7NnVdSgq wyThM4M84DICtlWTJpmhthxQMThHyKLTTYiBv3z0msRK3S7EAvs2G2Iq+aW2ZrjMCxCZ X4m39yOq0W9z0/uywici2A28tBvuL2PGXlzGf0AC8G0KIvAuw4fj2WLLU6dWgeRIj5Yz cHOZCd5jLMFH4wRIrDDvibw2TdqcR+wYdkNuDT7l03SMgG2mLLptS7CpYd7yxnlzm/ta G+PBXZ+bs8UzTWkkO1+vSS1GacqoL38kJCLFIPott7bdysB8Mf/uLmNmK4g95W11vva4 mBoQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=9EMuvribZcPJVhF5hR4tRbOhusVE15mnDAyjlUbLOqE=; b=w2Ng49srRqqt1IblF0c1R9nJN7Av+8YWGpvo8d2V74eBYCM2UIyv7sccdCyH0Dmwcj Of6KBrDjsGArCwttlBGqOReABmo4/BQGo4xG2KTgA07PHOhDHceMhQ+9OOvP0Q/0aj7L gNjj22ic73/qf485iaR/PxI32uCZ2EB3n9aF+mfeqB2eA0sgsXTLkc/S1tK6GjbHtFfw yqg3j3/J56nk2EZDPnunZo9/I5xXTpqo45VTgTIF4yUMwHE/8XKHd8BCtex7HXabU0oU Synzy4At5q4Btr09l/Gai9L/YYFQhOuUmTmcANcSuG01jOfyGDQz8fiEnPnG8hoB0QCr hKFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zERBn6U1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g75-v6si4581325pfb.37.2018.07.21.09.30.19; Sat, 21 Jul 2018 09:30:35 -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; dkim=pass header.i=@kernel.org header.s=default header.b=zERBn6U1; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728005AbeGURWq (ORCPT + 99 others); Sat, 21 Jul 2018 13:22:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:43054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727813AbeGURWp (ORCPT ); Sat, 21 Jul 2018 13:22:45 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 06C7C20849; Sat, 21 Jul 2018 16:29:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1532190568; bh=65yYyUrenRsCMJiRmdLy1jtf2+ePkf3AWxPMGOhOJfA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=zERBn6U1kDlBtIlQLodfvpr7A7qQJFMIB4qeImnVFr0KenrwpRPdgICHS6bA3ewLf OP2ty3dyidG55pXgaqeZFMDBmsDleF7izVziYMVnVYT+5YlCPza0iIe4GumxG5R8kF g2hdptMq2yEIAsUoblbgBD1Z5g88cFuYT8g4bjM8= Date: Sat, 21 Jul 2018 17:29:24 +0100 From: Jonathan Cameron To: Himanshu Jha Cc: Andy Shevchenko , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , Linux Kernel Mailing List , linux-iio , Daniel Baluta Subject: Re: [PATCH v4] iio: chemical: Add support for Bosch BME680 sensor Message-ID: <20180721172924.53619e6a@archlinux> In-Reply-To: <20180721155230.GB11127@himanshu-Vostro-3559> References: <1532122284-19602-1-git-send-email-himanshujha199640@gmail.com> <20180721161934.75066d97@archlinux> <20180721153607.GA11127@himanshu-Vostro-3559> <20180721155230.GB11127@himanshu-Vostro-3559> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 21 Jul 2018 21:22:30 +0530 Himanshu Jha wrote: > On Sat, Jul 21, 2018 at 06:43:51PM +0300, Andy Shevchenko wrote: > > On Sat, Jul 21, 2018 at 6:36 PM, Himanshu Jha > > wrote: > > > > >> > + /* Look up table 1 for the possible gas range values */ > > >> > + u32 lookupTable1[16] = {2147483647u, 2147483647u, 2147483647u, > > >> > + 2147483647u, 2147483647u, 2126008810u, > > >> > + 2147483647u, 2130303777u, 2147483647u, > > >> > + 2147483647u, 2143188679u, 2136746228u, > > >> > + 2147483647u, 2126008810u, 2147483647u, > > >> > + 2147483647u}; > > > > This one needs perhaps a bit of though, but... > > > > >> > + /* Look up table 2 for the possible gas range values */ > > >> > + u32 lookupTable2[16] = {4096000000u, 2048000000u, 1024000000u, > > >> > + 512000000u, 255744255u, 127110228u, 64000000u, > > >> > + 32258064u, 16016016u, 8000000u, 4000000u, > > >> > + 2000000u, 1000000u, 500000u, 250000u, 125000u}; > > > > ...this one obviously just a not needed one. You may replace it with a > > one constant and simple calculation to get either value (index from > > value, or value from index). > > Not sure to understand your opinion!? > > Anything related to increase to .ro segment ? > > I think adding is better to let compiler optimise the code a bit > further. No, I missed this as didn't look too closely at those numbers. They are almost by not quite simple power's of 2 * 125000. Question is whether the very very small difference from that matter or not... Andy is suggesting replacing this block of data with an equation that is 'near enough'. > > > -- > > With Best Regards, > > Andy Shevchenko >