From patchwork Sun Nov 5 18:00:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harinath Nampally X-Patchwork-Id: 10042389 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EFB3760244 for ; Sun, 5 Nov 2017 18:00:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1D4B2918A for ; Sun, 5 Nov 2017 18:00:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C6B37292AC; Sun, 5 Nov 2017 18:00:18 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 52EB3291FA for ; Sun, 5 Nov 2017 18:00:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751185AbdKESAK (ORCPT ); Sun, 5 Nov 2017 13:00:10 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:54767 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750877AbdKESAI (ORCPT ); Sun, 5 Nov 2017 13:00:08 -0500 Received: by mail-io0-f195.google.com with SMTP id e89so13392213ioi.11; Sun, 05 Nov 2017 10:00:08 -0800 (PST) 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=v8kX7gnx7to/4lDPDDybyu20M1ncCNyus/ev6stSOWE=; b=mVRVTKVwLheQlXeG0ZS5vxswQCo0LgSToiT/cNUq1SVucgd0d4sjakT02T4uAjt+Ko +DCinQ79/m1xcFrOEmBIkgT9u0UHzc8aPoeees86ixLo14AqKTboX4EbswB/yR7bQIJ4 R+jE0v1UJ8HLs2d/GkULq19iRkV/qGxhSuXDNXV4kT+jpgXiNbkY6DkWdVMqjYBGco/r oNePsr3sLF/1OaOksd8Ei5wYx8xFOesTKNRJS5Dx5Yo/04PHAb0MWiJwexg1bIeBRwzL ep516PsIG7VxTDjCBrAiK2PdZAlyIWvXQtMI+d5wawY/n3BjRRBDZ2MPCUWjS1/WedJM YHsw== 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=v8kX7gnx7to/4lDPDDybyu20M1ncCNyus/ev6stSOWE=; b=rDki/PW0EsNDuGHBNg1s18EdHguP151c2emMU9LDNXSzHNp2uHzGmKRUdx+CgMkpUF Bt1NZAm4FjwiOq8UO08yDa3ZWgUNuB9xk50LT7shwxw0xkC93cjN7p63tMCCj5YQTVoJ RvMI+FndHQldTDhFSEMQN15kfexzCbtDPlSm0CwqqYY7d8Oh3cZMygHvV6ffr9GxG5Ab 3uIsuPLA0u2qib4GrUK5CYzhC81I7V0wAApm/XoTnhVV9kq3+3JSL8Lm/6VHqoL3nDOG DjwRt7/QIBd5k4iNHnnNkaolJIxaGQoKcXKPDVE/pNC45BBcHvia9wrJq5J3NXj28ULi HYHw== X-Gm-Message-State: AJaThX4as7+TaQ2PcN0CblMt568tcPNQiXvm9K4t54/ddpmVZmP7xbg8 3kXaEDG8SzB/OEbvZB7ODtI= X-Google-Smtp-Source: ABhQp+QZVb++q+ReuZyLlvqhgx1KGEVsoKcRkKnBvBQyAYSGAn7mRJp1wn/D5cXW2Y0iWC8sr2QdUA== X-Received: by 10.107.24.129 with SMTP id 123mr17073898ioy.115.1509904807759; Sun, 05 Nov 2017 10:00:07 -0800 (PST) Received: from hary-Aspire-X3400G.Belkin ([97.70.80.173]) by smtp.googlemail.com with ESMTPSA id t70sm4811315ioi.72.2017.11.05.10.00.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 05 Nov 2017 10:00:06 -0800 (PST) From: Harinath Nampally To: jic23@kernel.org Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, gregkh@linuxfoundation.org, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, amsfield22@gmail.com, martink@posteo.de Subject: [PATCH v4 1/2] iio: accel: mma8452: Rename a struct for code readibility Date: Sun, 5 Nov 2017 13:00:02 -0500 Message-Id: <1509904804-4608-2-git-send-email-harinath922@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1509904804-4608-1-git-send-email-harinath922@gmail.com> References: <1509904804-4608-1-git-send-email-harinath922@gmail.com> 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 Rename time step look up struct to generic name as the values in the look table are same for all the other events like pulse, transient etc. Signed-off-by: Harinath Nampally Acked-by: Martin Kepplinger --- v4: Shorter subject line and better description in commit message drivers/iio/accel/mma8452.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iio/accel/mma8452.c b/drivers/iio/accel/mma8452.c index bfd4bc8..16adf47 100644 --- a/drivers/iio/accel/mma8452.c +++ b/drivers/iio/accel/mma8452.c @@ -284,7 +284,7 @@ static const int mma8452_samp_freq[8][2] = { }; /* Datasheet table: step time "Relationship with the ODR" (sample frequency) */ -static const unsigned int mma8452_transient_time_step_us[4][8] = { +static const unsigned int mma8452_time_step_us[4][8] = { { 1250, 2500, 5000, 10000, 20000, 20000, 20000, 20000 }, /* normal */ { 1250, 2500, 5000, 10000, 20000, 80000, 80000, 80000 }, /* l p l n */ { 1250, 2500, 2500, 2500, 2500, 2500, 2500, 2500 }, /* high res*/ @@ -826,7 +826,7 @@ static int mma8452_read_event_value(struct iio_dev *indio_dev, if (power_mode < 0) return power_mode; - us = ret * mma8452_transient_time_step_us[power_mode][ + us = ret * mma8452_time_step_us[power_mode][ mma8452_get_odr_index(data)]; *val = us / USEC_PER_SEC; *val2 = us % USEC_PER_SEC; @@ -883,7 +883,7 @@ static int mma8452_write_event_value(struct iio_dev *indio_dev, return ret; steps = (val * USEC_PER_SEC + val2) / - mma8452_transient_time_step_us[ret][ + mma8452_time_step_us[ret][ mma8452_get_odr_index(data)]; if (steps < 0 || steps > 0xff)