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: 861109 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zL8Sp38d2z9sNc for ; Tue, 16 Jan 2018 10:19:38 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qgT5Ved9"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3zL8Sp17M5zF0TK for ; Tue, 16 Jan 2018 10:19:38 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qgT5Ved9"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::242; helo=mail-pl0-x242.google.com; envelope-from=nicoleotsuka@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="qgT5Ved9"; dkim-atps=neutral Received: from mail-pl0-x242.google.com (mail-pl0-x242.google.com [IPv6:2607:f8b0:400e:c01::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3zL8QD2xYBzF0YK for ; Tue, 16 Jan 2018 10:17:24 +1100 (AEDT) Received: by mail-pl0-x242.google.com with SMTP id f4so3336154plr.10 for ; Mon, 15 Jan 2018 15:17: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=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=lAFx/auECLcFPhCBM/ZygMO7TwJ79I6wg7Xu2dxtIfQCX2SSgEoty4ri+m7TS/4s4E 6mbn6om5EiXwvJixhGZSgOZIvOtUqu2gdkdJnMk1FUre4SBSjux6fy0IM7CSRpObcjU5 7UbLNanrtAKm48bZ7Hcm930tqtZN/aavHZ2JrrtHOg4S2p/Yt5FYWVCFfb45DHQpRSJ5 hXJQGOtXLDtSYwISTXFATlbhOlto4RJjbq9UrtSblkxC7Uwui6ZVQvix+T8JfrGaAnnl 47w8/Ylpe7QUxNDaSLK2kdLNK890VDGMhfmA8lU5rE4EZkxvBHn+aOPPHs9i8oZEWd4C kSrw== X-Gm-Message-State: AKwxytdIjUX7a18x1K3RhhXyHfRYAcBWEihb/1+qktPeCJPNNnt67T0L x4wzGX4LM8N9PX+ybFToPZ4= 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 Subject: [PATCH v4 01/17] ASoC: fsl_ssi: Redefine RX and TX macros 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> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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 */