From patchwork Mon Jan 15 23:16:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10165431 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 AD035602C2 for ; Mon, 15 Jan 2018 23:17:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D8D927B2F for ; Mon, 15 Jan 2018 23:17:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 922FE27BFF; Mon, 15 Jan 2018 23:17:34 +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=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B7AA027B2F for ; Mon, 15 Jan 2018 23:17:33 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id CD72126761A; Tue, 16 Jan 2018 00:17:30 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 24360267623; Tue, 16 Jan 2018 00:17:29 +0100 (CET) Received: from mail-pl0-f65.google.com (mail-pl0-f65.google.com [209.85.160.65]) by alsa0.perex.cz (Postfix) with ESMTP id 0F870266BBC for ; Tue, 16 Jan 2018 00:17:23 +0100 (CET) Received: by mail-pl0-f65.google.com with SMTP id 62so4728474pld.7 for ; Mon, 15 Jan 2018 15:17:23 -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=buHog9zhbHv5Yl50higsS7w+EYJMeW/mrvb8/cwm9sI=; b=qgT5Ved9CtgjZkwVYjPtWSJXPMajluN+fu1563S7PZ+2r+2aQwhjW+4OIhKzCFXGeX RzOo3O0I43ku1rFoALb8xjVPoxT4CGTdaG+PUYyw6fBwkZIdgp/ulhQis/2txb/XEmAT J2a6TwBlFjZbplo5+mr3CrHPjmOIjwI7WzCI+Qc2GXlVB6OsERTBEwBVtY3KJL0FvN9a Wf3EvAmYEa4rWu/xivnddb/NjzecMlpKtonvZ0bHTrte6VlqU8YrHAdxFEAILvS7+jiz 56ShX+nb8Y5jlp8BzLxEa6WPsEAwoQ1zfLzBgph862RMnIWBoyBJ9JHFwNZyDWvdFeP0 Qv5A== 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=buHog9zhbHv5Yl50higsS7w+EYJMeW/mrvb8/cwm9sI=; b=iTbXLxaTxqnwY+WoF/N4bWpCqXuu6ZbqXB/rTuVxQ1DWlnbTcHqoe34JO7xdRrBf56 pHgnC2KfTEbIkIRC1M52RaIO0nHhyv2SUgUIotQEG/bcvsjJKraLNsR3bjA8srf7TXyh hp15W/V18GA8wSgwSliyk/939pZYvrL05Idp2bEHwY27o7jy1U7XqPRZk33LbDzWtZTg HyZvV93n5v7YmcuvqweIr8d6LOi2Ct9vdw/BB01RnMNgf8Q/Zogb9Yj1zCk3FQhyBkgS A+RCmbwF6Nm8VwSAvrwDdWszwDZrwljmXSGqiL+4IeNj1yrhRw8KtAlHDsxy+0Oqg9Ok Nffw== X-Gm-Message-State: AKwxytfeUfcljgD6gZQWyQx94wt97VuIrv3emsPTo93xNfKNb+Z739h6 mzv/hi1IsbpjT42AoCUzWpg= X-Google-Smtp-Source: ACJfBoteaIaT9IRYLv2zTm6xFRA6GMoD1N5c9pZ7D6kDbnqkuTWzdBizvH4oB2jetPU7mVaFVCVRdQ== X-Received: by 10.84.241.70 with SMTP id u6mr5388376plm.49.1516058242299; Mon, 15 Jan 2018 15:17:22 -0800 (PST) Received: from Asurada-CZ80.localdomain (c-73-231-2-134.hsd1.ca.comcast.net. [73.231.2.134]) by smtp.gmail.com with ESMTPSA id b6sm776442pfe.85.2018.01.15.15.17.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Jan 2018 15:17:21 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Mon, 15 Jan 2018 15:16:16 -0800 Message-Id: <1516058192-65519-2-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516058192-65519-1-git-send-email-nicoleotsuka@gmail.com> References: <1516058192-65519-1-git-send-email-nicoleotsuka@gmail.com> Cc: alsa-devel@alsa-project.org, kernel@pengutronix.de, linux-kernel@vger.kernel.org, caleb@crome.org, lgirdwood@gmail.com, arnaud.mouiche@invoxia.com, lukma@denx.de, fabio.estevam@nxp.com, linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH v4 01/17] ASoC: fsl_ssi: Redefine RX and TX macros X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The RX and TX macros were defined implicitly and there was a potential risk if someone changes their values. Since they were defined to index the array ssi->regvals[2], this patch moves these two macros to fsl_ssi.c, closer to its owner ssi->regvals. And it also puts some comments here to limit their value within [0, 1]. Signed-off-by: Nicolin Chen Tested-by: Caleb Crome --- sound/soc/fsl/fsl_ssi.c | 4 ++++ sound/soc/fsl/fsl_ssi.h | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index aecd00f..001e453 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -56,6 +56,10 @@ #include "fsl_ssi.h" #include "imx-pcm.h" +/* Define RX and TX to index ssi->regvals array; Can be 0 or 1 only */ +#define RX 0 +#define TX 1 + /** * FSLSSI_I2S_FORMATS: audio formats supported by the SSI * diff --git a/sound/soc/fsl/fsl_ssi.h b/sound/soc/fsl/fsl_ssi.h index de2fdc5..18f8dd5 100644 --- a/sound/soc/fsl/fsl_ssi.h +++ b/sound/soc/fsl/fsl_ssi.h @@ -12,9 +12,6 @@ #ifndef _MPC8610_I2S_H #define _MPC8610_I2S_H -#define RX 0 -#define TX 1 - /* -- SSI Register Map -- */ /* SSI Transmit Data Register 0 */