From patchwork Wed Jan 17 06:51:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10168607 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 635A860386 for ; Wed, 17 Jan 2018 06:52:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EBE427D0E for ; Wed, 17 Jan 2018 06:52:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 431AF27FC0; Wed, 17 Jan 2018 06:52:50 +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 8AE4027D0E for ; Wed, 17 Jan 2018 06:52:49 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 2B35E266FE1; Wed, 17 Jan 2018 07:52:32 +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 6CAA5266F92; Wed, 17 Jan 2018 07:52:27 +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 475C4266F72 for ; Wed, 17 Jan 2018 07:52:25 +0100 (CET) Received: by mail-pl0-f65.google.com with SMTP id b96so8117826pli.2 for ; Tue, 16 Jan 2018 22:52:24 -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=uLhBAbv9yc4/gj0URjvCzkT25tRsy/9rzuMkxtQ24WbiMcoe1q8PZOVA4SUpo8QRPm 6rF9auNbETfS7+9ltQpRcxLBUvWZ8tq4XU6Gwly9tlB79XVj+8NDmW1kfwANmF3Z4aj8 XsptmwWnnoREVumtm2zXKUFAftk2HXHuMqMJQZ5SuF12UEUsdPVAmtcw0DaEcaYoq6b9 JiJuFxYhwAJcoStLGN8zjlL67YPBbqPGc4VyEuhQTrbP4i530y5ys7dwFt2MTkkL07DV 6WkisRxc0eFROtMI38Jn5wk6aa6W+nrFZ1cRpdAWpF4kHYfOZHUiYqv4ZOV9IyA6xrV/ kPOA== 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=Pp/0GWtmqsD6WBB0VbspIhfXwJptxys+YQKVN9Qx3qcMX8zTDljwPdgcaEMMAAWI+c 5X8rZF7oRJw9Y97FGsnzITn3/+PElZpz+YW5V/HndmOa7Dt5Aavj4/A9VTy/eDhvmTN9 RO1rdGgM9+LadW3JeYvlplj26XgNdHNwUWjwoqIoc2OQKikHUOvuaO1naUjzRycvCFys Lp/sW0DvjOKus87MPa3ZfHaQFqlwSdaOXn9gSkEdIGm8jn+p1Y/HMJiLpGXe2xwJWWBf bt4hedfe3rdhy3RYkwiBJMx+BIDxydnqCBAyJ6GBqfSViM/vFvkatMlCt/P1rB5ZHBvj h8pA== X-Gm-Message-State: AKwxytd/YDptrRDC0MeO1XCvzQBuailnstMfShS5oiRj7vesIXUfTUVD 82woake6a32UjXBJvuhNIWI= X-Google-Smtp-Source: ACJfBotTjX7fLFF2uJVAOWyyTd72oYn0kpySnQ08y0nPCRoDqCShx6PU3hF6iUQlZ6pdT6HYWh/hbA== X-Received: by 10.84.233.197 with SMTP id m5mr12768440pln.347.1516171943979; Tue, 16 Jan 2018 22:52:23 -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 e185sm7503221pfg.155.2018.01.16.22.52.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Jan 2018 22:52:23 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Tue, 16 Jan 2018 22:51:26 -0800 Message-Id: <1516171902-32669-2-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516171902-32669-1-git-send-email-nicoleotsuka@gmail.com> References: <1516171902-32669-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 v5 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 */