Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4039511imm; Sat, 21 Jul 2018 08:45:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdNRFf2PTTS9z+BCJmXMZIHkqE2roYo7BVJXyGeMd6zrS2Gxr+FT1TebZrgJcdcU0kxem1x X-Received: by 2002:a63:6d8b:: with SMTP id i133-v6mr6097441pgc.215.1532187904606; Sat, 21 Jul 2018 08:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532187904; cv=none; d=google.com; s=arc-20160816; b=ytiIZNcvf7WOxGvoAF20Pbzl545qfZjV+uWWZMyNfvk7i7jHhfSwlVGLhAiuPXYLlz Zb3trBp97MTFwoKoaTvfWkMABPVuH4V7qLWP0sLTIV28EA8aAFp+2b50lKOseGrVrrCO Fs9tyl0TuLV5lh/NYOykLHdh+AWPGcr2tJRNQwNJ0cGbN/LJjjAQ6xE9Q++lp/GjnADN 8W3MyMPenx4q04sGlyxpJkRfN3vTfj0Cm5hFWpRxrqXQHx8rFPJIWY4jB9rIy6ZQ9EG6 R8PhICqqHG3VnfCG/zGGOsOzeLpE549+OfdS4CWPMi0acS+ltZkNsfiUFCRY5oLJ10la mnrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=vZ0w8NyDNU6xL1u3nc0ExNEhGmCa8gdU8KmAupNt0w4=; b=JRU3tzPH9HIsvkvBjzE3YCrjsORtJOIjdX7GJoVdOokXSC1C9Yi5wWfgX/N0QxBPdI VitArMBNTc2aecPFfUg/cfrbzccOjETOUUBRm2hDDfd7maUg0NducDRtDhfSeWF1Mzvc fIKDuH6ngr6h62ElJWvGtLYPlO7AtGC6td0CnVAsHYsliUtG3AhAnRrhMg3voZLgNa74 4Iu0GK/ckVClv3aLjmSXvLLr6Ol+TuuxPAHsW+yBo2ZrgEdgcygyjiyhLCR4o6oGoV9E +ttf55yyRhuU/XCWlzzEU7rV+olT829UnY5791c5tugD2MQ8N1oaDorjUwlQLKTVTNMG nSqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TEJ7k7qU; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g87-v6si4586062pfg.225.2018.07.21.08.44.50; Sat, 21 Jul 2018 08:45:04 -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=@gmail.com header.s=20161025 header.b=TEJ7k7qU; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728262AbeGUQhD (ORCPT + 99 others); Sat, 21 Jul 2018 12:37:03 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:33255 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728130AbeGUQhD (ORCPT ); Sat, 21 Jul 2018 12:37:03 -0400 Received: by mail-ua0-f193.google.com with SMTP id i4-v6so9267132uak.0; Sat, 21 Jul 2018 08:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=vZ0w8NyDNU6xL1u3nc0ExNEhGmCa8gdU8KmAupNt0w4=; b=TEJ7k7qUdcU2GLFEZTszKd6wyasB9DkStsgDllH++rhmSfrmSqUB/fCrXktdRfNXYJ pmzLQOQQ02VIO35/bZ83S2tnhFefx23ZU5B9gRl0Z5kux5u/lA1ESBkW9IuGd3WKgzcB F6CaVqYUwKrJ3udlEk/4pfe3fXfq0b2xRd53fbQHaCrQVlhqGHfphZvIJIShWw7o8T1s hs6FTOH75vDlVnDi+GLW6/KuzkuE+JOQg52FyluGTEwKtYqwEQg5XVZhbaI77N91le2e ZxNn/H1UCBc6UiC86ewrn+5gwR32ZFdCNk2cBR2lCF5itBT2+cDnUxeP+5iKmVPqjqLJ 11zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=vZ0w8NyDNU6xL1u3nc0ExNEhGmCa8gdU8KmAupNt0w4=; b=FpTd3E2FGfSfc2zcqQeGu8bvqTWfkg2FmMmIM0JxGR2/KSPSdvk3gbAyXpOn1kvnjy Rg/8JpSfgSjs3KdPq+vuEHowFMLStslZaPXD8nmwEMr5Yoh4OKDA8YjUa++YhVxUdXG7 jXaFOt6TLdO2JuRxuufHg3XCsRBwgAuoTuHQIPm+NTtCftJBC3XtihfzEWNHxeAFWHuw msDnftg0keRf+VOh2D34i2/uNlwZ+L0DAEngNqf/EEzq8EuaxeJC/D1WQSJ1+cEx2oHB B27VztRIqj4eFfTcRQ5ajCWoZcwpeDS9cxr3C1F2f2ypzU4HdsNTs2/YPbMoXd8+w6c5 sMlA== X-Gm-Message-State: AOUpUlG1PqMULgBior84XNqIvja9Z06HYSH0R3Jpl3dEGrw3JoDiUwRY tDd6YhnaGX3I/H9qUcqndypRHVoUPiYakrLHZSE= X-Received: by 2002:ab0:4025:: with SMTP id h34-v6mr4321442uad.12.1532187832995; Sat, 21 Jul 2018 08:43:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Sat, 21 Jul 2018 08:43:51 -0700 (PDT) In-Reply-To: <20180721153607.GA11127@himanshu-Vostro-3559> References: <1532122284-19602-1-git-send-email-himanshujha199640@gmail.com> <20180721161934.75066d97@archlinux> <20180721153607.GA11127@himanshu-Vostro-3559> From: Andy Shevchenko Date: Sat, 21 Jul 2018 18:43:51 +0300 Message-ID: Subject: Re: [PATCH v4] iio: chemical: Add support for Bosch BME680 sensor To: Himanshu Jha Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , Linux Kernel Mailing List , linux-iio , Daniel Baluta Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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). -- With Best Regards, Andy Shevchenko