Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752793AbeADTmD (ORCPT + 1 other); Thu, 4 Jan 2018 14:42:03 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:34856 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751829AbeADTmB (ORCPT ); Thu, 4 Jan 2018 14:42:01 -0500 X-Google-Smtp-Source: ACJfBosxduUjv02TarBbrtCF8vlR4A7ICRB4YAXU46pc3wMNFXOQ+q+6AeK/LTrrzSCpyBnaCpQhDw== Date: Thu, 4 Jan 2018 11:42:14 -0800 From: Nicolin Chen To: "Maciej S. Szmigiero" Cc: timur@tabi.org, broonie@kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org, lgirdwood@gmail.com, fabio.estevam@nxp.com, caleb@crome.org, arnaud.mouiche@invoxia.com, lukma@denx.de, kernel@pengutronix.de Subject: Re: [PATCH v1 03/15] ASoC: fsl_ssi: Rename fsl_ssi_disable_val macro Message-ID: <20180104194213.GC27975@Asurada-Nvidia> References: <1513702819-42310-1-git-send-email-nicoleotsuka@gmail.com> <1513702819-42310-4-git-send-email-nicoleotsuka@gmail.com> <7509f512-1c7f-2fd2-e127-510106e2d9d5@maciej.szmigiero.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7509f512-1c7f-2fd2-e127-510106e2d9d5@maciej.szmigiero.name> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Mon, Jan 01, 2018 at 10:29:24PM +0100, Maciej S. Szmigiero wrote: > > @@ -445,16 +445,10 @@ static void fsl_ssi_config(struct fsl_ssi *ssi, bool enable, > > bool tx = &ssi->regvals[TX] == vals; > > + /* Check if the opposite stream is active */ > > + aactive = ssi->streams & BIT(!tx); > > I don't think that hardcoding an implicit assumption here that RX == 0, > TX == 1 is a good thing. > If in the future, for any reason, somebody changes values of these macros > this code will silently break. > > I would instead change this line into something like > "aactive = ssi->streams & (tx ? BIT(RX) : BIT(TX));" or similar. You have a point. I could add a "bool dir" to make it clear. Thanks.