From patchwork Mon Feb 12 22:03:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10214549 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 851B860467 for ; Mon, 12 Feb 2018 22:02:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F4E726538 for ; Mon, 12 Feb 2018 22:02:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 542B82879A; Mon, 12 Feb 2018 22:02:58 +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 85AAF26538 for ; Mon, 12 Feb 2018 22:02:57 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id D10C52675C0; Mon, 12 Feb 2018 23:02:45 +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 7BD4B2675AD; Mon, 12 Feb 2018 23:02:42 +0100 (CET) Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by alsa0.perex.cz (Postfix) with ESMTP id 632232675A4 for ; Mon, 12 Feb 2018 23:02:40 +0100 (CET) Received: by mail-pg0-f66.google.com with SMTP id g12so29819pgs.0 for ; Mon, 12 Feb 2018 14:02:39 -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=Sb+BnDP4NOjLeeaUQ4n6o5oi8FnjKDHlmT0sykruCzE=; b=Qso2v/YPIYbvRkJcMX2rR6I9lGzZRVy0VLJ/b+OUN2KawmkZQJ5x8JTcV9mkh5Y6uJ rcg1mcQ0TGZkaxkhnq6svNMM1TspJp7vYzgcw+kPp2RXaxARMU2tlUgZP6wLPTPKgqar AsD1rcjT0v8QRbI6ZLfuoIjXbcwzSbkibKDCEPSmt9/dpU7RbDikYbJMfgJvmF/C07XG s25yk6oUBg7qt2TaeburRqsSE7ktSAZqSJKDGq/jC4O7KmitGH/CyOSxtyjaByYxRH+5 RvqhXUF4nR5JXqanKtwxbOckqB4BJ1Vr2bXXDsLxYdiiHX/uiP0g9kJT5xvuQTEyRPwm qjZw== 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=Sb+BnDP4NOjLeeaUQ4n6o5oi8FnjKDHlmT0sykruCzE=; b=SD9/6IFY1OaHxkqaPikViC/saXfeW6n0AQAn5ThoPeb6PoWTtkEgAzQhYIU3lFYQb5 qlq5E8sidOongrQlqATwW26oK2UP2Mr11p+uk2rClDUIp/od+Cd5I8K6JhO0RAkNE1X5 aRnuLs2ohJ2VHpFnh/+qF2UK6HBg6IVdqn7VWShBl7GXLBO+cTaW4MfvIio4/obkS56f Y65mEkivpYHzXczuKcmkDZ5IKG3bh6Ntrcs9tWO2oEAZFy7qJm/Ew8hCo7OF2+3PmguG CoZ78pnp8t4eoLcl6izgbhale8/aRHMHAtayTZxeeUFsVQKDRzCzpopsQCZbhywzP+TQ synA== X-Gm-Message-State: APf1xPB0QKPzW5KVXOo/hl4P1t3+M9Etj26AnJJ3rqNUQrUoyNDYGBWv gghUnQ3xLbsI2fJ46cLuYCg= X-Google-Smtp-Source: AH8x225NG9ClhxU/kY0pdGWOZTpfbA1evETW1w5notyGSv/Dj8E/3McKgoZOobtRmV9pkl9CXMaLYg== X-Received: by 10.99.116.22 with SMTP id p22mr10321092pgc.89.1518472958989; Mon, 12 Feb 2018 14:02:38 -0800 (PST) Received: from Asurada-Nvidia.nvidia.com (thunderhill.nvidia.com. [216.228.112.22]) by smtp.gmail.com with ESMTPSA id c8sm13386159pgn.72.2018.02.12.14.02.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Feb 2018 14:02:38 -0800 (PST) From: Nicolin Chen To: broonie@kernel.org, timur@tabi.org Date: Mon, 12 Feb 2018 14:03:09 -0800 Message-Id: <1518473005-14090-2-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1518473005-14090-1-git-send-email-nicoleotsuka@gmail.com> References: <1518473005-14090-1-git-send-email-nicoleotsuka@gmail.com> Cc: mail@maciej.szmigiero.name, kernel@pengutronix.de, lgirdwood@gmail.com, alsa-devel@alsa-project.org, caleb@crome.org, linux-kernel@vger.kernel.org, arnaud.mouiche@invoxia.com, lukma@denx.de, fabio.estevam@nxp.com, linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH v6 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 Tested-by: Maciej S. Szmigiero Reviewed-by: Maciej S. Szmigiero --- 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 24fb672..3c8dd60 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 */