From patchwork Mon Aug 20 17:39:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Frey X-Patchwork-Id: 10570583 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC7C61390 for ; Mon, 20 Aug 2018 17:36:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D560529897 for ; Mon, 20 Aug 2018 17:36:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7FCC2989D; Mon, 20 Aug 2018 17:36:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DC1329899 for ; Mon, 20 Aug 2018 17:36:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726141AbeHTUxP (ORCPT ); Mon, 20 Aug 2018 16:53:15 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:35228 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726077AbeHTUxP (ORCPT ); Mon, 20 Aug 2018 16:53:15 -0400 Received: by mail-pg1-f195.google.com with SMTP id z4-v6so2132167pgv.2 for ; Mon, 20 Aug 2018 10:36:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Jc69hEIUlgXkbCEIs3okhbHQ+7OBNNZXiO7swFhP2M4=; b=i1hvPA66P5AFu91xsSLHWN6m6UVnnU6BKvPsCoZIOgnyVHUt9edLboRTv++tqTdGkR /UgJBhCMCK4iymJrAVwRHu2wuIXDpk4S6+QrFye53Sq0bLfGIdE5ych8EssUEn7Izalq MmJ4vYDqu45B2o6xqFLve6AUQtjg7wCaghJwaqaFt27DOgwMhTrSyU/cwm33guZwliKt B7cjMWNYyfZzHv349axWZDIbM+tSs81Qz/0zKTKTsmQnbG3mCkwoZNypUsi9V4ygpmZG vIaFXNg2t5GKaYcLZYzq0Zp6AlDRQA6epmhEFCK38YFmqSMMf0WSMyhWCCgRhiiUAxKG eUtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Jc69hEIUlgXkbCEIs3okhbHQ+7OBNNZXiO7swFhP2M4=; b=KFzfeQXWJ1bRg+IHsQhtOGopURcAult2cZ/nIyhvlfzGaS3f/i0ylxzRuuXSozuygm HHxLK8GiWfvXqnGOBQi7aNDXmhIpL25SoOaulncdK0xOxeu3rA+ulp5/vm3PvQbwy/QW g8JXQpCduIzNIx7zX7tYqlmfQvVCgd0lBiXbWhHjmaVDmnGaCdTnsESF78NZWCU2qOru /i08xdMCV4spT7gFgPxZdOUd5yTuMeb4qklJcLxPaDllJqf0eTYs+GqfSd5aZ6hPOphV 5XhPS0Pp1hoBDdoWNieEWhZxnWE67TTjoQOFw3xtx0ZgNNvz1wiLRM0XMySA3YVb7VI2 HneQ== X-Gm-Message-State: AOUpUlHeZsM+E5jKfYzD47oR2OAc4ZK6CfZtFjJl8rVA7S5pB6B8WoJa Lmdf1VMM0Q5BqU2aiBfX/S8NMclhANs= X-Google-Smtp-Source: AA+uWPxaVPSU6wSK7EYIO4O/4bod7VoXG+TAFEmtv99mDfdKUYivfzwsUX1JJbOLLzbnZsJX154GRQ== X-Received: by 2002:a63:f80a:: with SMTP id n10-v6mr28608080pgh.82.1534786601643; Mon, 20 Aug 2018 10:36:41 -0700 (PDT) Received: from dfrey-debian-linux.sierrawireless.local ([185.153.179.9]) by smtp.gmail.com with ESMTPSA id t15-v6sm18402768pfa.158.2018.08.20.10.36.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Aug 2018 10:36:40 -0700 (PDT) From: David Frey To: linux-iio@vger.kernel.org Cc: jic23@kernel.org, himanshujha199640@gmail.com, David Frey Subject: [PATCH] iio: chemical: bme680: Remove field value defines Date: Mon, 20 Aug 2018 10:39:59 -0700 Message-Id: <20180820173959.22380-1-dpfrey@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180819201439.30d318c7@archlinux> References: <20180819201439.30d318c7@archlinux> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove BME680_RUN_GAS_EN_BIT and BME680_NB_CONV_0_VAL field value definitions because the fields are simply boolean and integer respectively. Signed-off-by: David Frey Reviewed-by: Himanshu Jha Tested-by: Himanshu Jha --- This patch applies on top of my "indent #defines consistently" v3 patch. Appologies if I should have submitted this patch in a different way. If I should have submitted this differently, I would appreciate a pointer on what I should have done in this case. BME680_RUN_GAS_EN_BIT was indeed somewhat wrongly formatted, but the issue was not the indentation level, but rather that I should have followed immediately after BME680_RUN_GAS_MASK. Once I moved it there, I realized that neither this definition nor BME680_NB_CONV_0_VAL really added any value and hence I removed both in this patch. drivers/iio/chemical/bme680.h | 2 -- drivers/iio/chemical/bme680_core.c | 5 +++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iio/chemical/bme680.h b/drivers/iio/chemical/bme680.h index dd4247d364a0..48dc9e50e017 100644 --- a/drivers/iio/chemical/bme680.h +++ b/drivers/iio/chemical/bme680.h @@ -54,8 +54,6 @@ #define BME680_REG_CTRL_GAS_1 0x71 #define BME680_RUN_GAS_MASK BIT(4) #define BME680_NB_CONV_MASK GENMASK(3, 0) -#define BME680_RUN_GAS_EN_BIT BIT(4) -#define BME680_NB_CONV_0_VAL 0 #define BME680_REG_MEAS_STAT_0 0x1D #define BME680_GAS_MEAS_BIT BIT(6) diff --git a/drivers/iio/chemical/bme680_core.c b/drivers/iio/chemical/bme680_core.c index cde08d57e7d5..01ca7ba64ea0 100644 --- a/drivers/iio/chemical/bme680_core.c +++ b/drivers/iio/chemical/bme680_core.c @@ -566,10 +566,11 @@ static int bme680_gas_config(struct bme680_data *data) return ret; } - /* Selecting the runGas and NB conversion settings for the sensor */ + /* Enable the gas sensor and select heater profile set-point 0 */ ret = regmap_update_bits(data->regmap, BME680_REG_CTRL_GAS_1, BME680_RUN_GAS_MASK | BME680_NB_CONV_MASK, - BME680_RUN_GAS_EN_BIT | BME680_NB_CONV_0_VAL); + FIELD_PREP(BME680_RUN_GAS_MASK, 1) | + FIELD_PREP(BME680_NB_CONV_MASK, 0)); if (ret < 0) dev_err(dev, "failed to write ctrl_gas_1 register\n");