From patchwork Mon Jan 15 04:21:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 10162987 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 BE976601C0 for ; Mon, 15 Jan 2018 04:22:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF77128904 for ; Mon, 15 Jan 2018 04:22:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3AA328A05; Mon, 15 Jan 2018 04:22:57 +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 04AD928904 for ; Mon, 15 Jan 2018 04:22:57 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 9AAC7267323; Mon, 15 Jan 2018 05:22:25 +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 A8EC0267332; Mon, 15 Jan 2018 05:22:21 +0100 (CET) Received: from mail-pl0-f66.google.com (mail-pl0-f66.google.com [209.85.160.66]) by alsa0.perex.cz (Postfix) with ESMTP id E950B26731A for ; Mon, 15 Jan 2018 05:22:16 +0100 (CET) Received: by mail-pl0-f66.google.com with SMTP id 62so2805381pld.7 for ; Sun, 14 Jan 2018 20:22:16 -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=pMm8js0M3AuhPdMzRIX1JggCyxkrbFC8eqDpKkcthqs=; b=FbZuLiQgjSekEwMqPAC3Fb9jWOrilEwKPAafYryE4nnlyYgE9ae/xuLztqrZ0SzDSz Fdqmm03cTImf2LihFIAtSxIw4klc1IklnN51wo21BUDOOavWpOgYQLPUmU/9XPIj1rhk dB0ATqLOe8A1OPrRbRz44sQEE8/zTAwskX59LjJw1oK8k2SKAVDERjpeRvXqjG7p4xBY NilRIwGqMHK9WabqwY67tLh2SYIRNS5GaJBREWzRrtnxKcbmEMs+Qyg205AUu8VFxL+f diCT3EuCZ2Nm3XbE2wF4ZOZgCZ8peik+FTnaLqsYCRQb0HkQqyxfxlVihxap89OWUsFt Qb2A== 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=pMm8js0M3AuhPdMzRIX1JggCyxkrbFC8eqDpKkcthqs=; b=f6pdMbjXOCgw8U1jJJ66IM7iCD0yXPDC54szlWkZtSKgiSxPx1rg9op2ClmxwvWuhg hWdWYsLB+dJnLAwgcpZRoWKQNv0W9zWWyW3eL00LjyrJknwDTWw9dnM3iur/Hk4dFDCg u4x9aPSJb8nEUZ5YDcejBhOA0oMJTm+U+wy+3/OQBJk/tj42FlUFtDiVB73BjXW4G/30 7OeLFkPems4e+gK/fpGEu9dBj+IjsGfkj9kk5IGp2lI85VGyRmcvFChT5KvUYrN0F6Fh qRGjI4HHm4ltX35HSmX9BFsWl7qAf55+6M2sKqqIavUyVFbYZAeVU3+Y0l+6cAFyNKUx +isQ== X-Gm-Message-State: AKGB3mIDz4+LMnUsVU/TV6lGCraj5sQesa+U+f9t3YuDCDdOUU5lR/ZN zwy3iY+b02WZTQJL6rp9zzs= X-Google-Smtp-Source: ACJfBos0RomJwA77vQI+wWd0IMyI9yZXbYXGMrtFYpjsQrDXsSaT/prC7WQCqBS+vQYxZu1K+ZBQgw== X-Received: by 10.159.203.138 with SMTP id ay10mr33891141plb.105.1515990135588; Sun, 14 Jan 2018 20:22:15 -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 v7sm17011018pgs.83.2018.01.14.20.22.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 14 Jan 2018 20:22:15 -0800 (PST) From: Nicolin Chen To: timur@tabi.org, broonie@kernel.org, mail@maciej.szmigiero.name Date: Sun, 14 Jan 2018 20:21:11 -0800 Message-Id: <1515990087-11598-2-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515990087-11598-1-git-send-email-nicoleotsuka@gmail.com> References: <1515990087-11598-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 v3 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 --- 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 */