Received: by 10.213.65.68 with SMTP id h4csp812590imn; Tue, 20 Mar 2018 16:26:06 -0700 (PDT) X-Google-Smtp-Source: AG47ELusw0RTXdKo9yVXHtmISwpG+IDWgAwEUYsmL5jqTzGjjvopUJx22j/pwzN+WgI/jT7sJoyP X-Received: by 10.99.108.2 with SMTP id h2mr13379504pgc.396.1521588366086; Tue, 20 Mar 2018 16:26:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521588366; cv=none; d=google.com; s=arc-20160816; b=lMwoISTAxD7JeVKErP/QrTDXGWrf23TGzKs2ZZfZIVYR2dzwggw6BANkEba/ovRlFd EJ1ROHI3evvHsmnJbYX9ODmdAPnTG8W5G+4oNw4bM/GQOZTkEDuu1C0epSnlh3qxXJqZ a3LhtjOmhvCLDgPQkJigXtvWorWfxUfYEJtIRuaozYFXBYxZrJUfuv3jyTzIkxfKonkn GQWH/vvb6CRq+cel3iDAkkjsoBxMj61ClAkpQ6KpFsiC64ulSkzMI7bcMz+Hd/nfYEfn dd6JhWSP5Pq1Gpn7DnBxXtonFp/J1jiCkPQFvZuBy5CCSFE0VXTRnWilxZ0Zp3c5wd4o v0yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=3q2aSVSj8Gz0m5qteoy/PdB99rJDWPLH89tKoHTi0Ms=; b=NSy+mUG+L7iQXt+LxRU1egHW0l1ES2kJrgp6iqizbXJUZLpIyDq1U6KyR2HQBIczUs yW/5IBNZNNNUDWATZrpyTc97pB4eJdhzPUvCIuSqograiZzNI9CY8e4expB7iQRGTMuW QFm5MXjuYS2qenC6fyvqSYyO65UfbuONwpo5RDpnDIAALVRAyDyBlT3xr5Qdw8oFaiXQ zQ/f1/TvITg7qiDxaX26ueDwKlOGnzKIvwkYrRKV5Gs4B+dNnHEDgB54ql78WLPGLB+H A87w7RbbE1+LD2u7k9nGB/JP+vsJYX0CTu1iUqmEmVuZbu7TnY5iiDAlF19Pt1y11t1j /jsw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w4si1852142pgo.305.2018.03.20.16.25.52; Tue, 20 Mar 2018 16:26:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751843AbeCTXYV (ORCPT + 99 others); Tue, 20 Mar 2018 19:24:21 -0400 Received: from mleia.com ([178.79.152.223]:59270 "EHLO mail.mleia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751781AbeCTXYU (ORCPT ); Tue, 20 Mar 2018 19:24:20 -0400 X-Greylist: delayed 398 seconds by postgrey-1.27 at vger.kernel.org; Tue, 20 Mar 2018 19:24:20 EDT Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 29A243FA0C0; Tue, 20 Mar 2018 23:24:19 +0000 (GMT) Subject: Re: [PATCH 2/3] i2c: mux: pca9541: namespace cleanup To: Peter Rosin , linux-kernel@vger.kernel.org Cc: Guenter Roeck , Wolfram Sang , Ken Chen , joel@jms.id.au, linux-i2c@vger.kernel.org References: <20180320061909.5775-1-chen.kenyy@inventec.com> <20180320093200.19179-1-peda@axentia.se> <20180320093200.19179-3-peda@axentia.se> From: Vladimir Zapolskiy Message-ID: Date: Wed, 21 Mar 2018 01:24:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180320093200.19179-3-peda@axentia.se> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20180320_232419_188635_A0212A53 X-CRM114-Status: GOOD ( 15.75 ) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On 03/20/2018 11:31 AM, Peter Rosin wrote: > In preparation for PCA9641 support, convert the mybus and busoff macros > to functions, and in the process prefix them with pca9541_. Also prefix > remaining chip specific macros with PCA9541_. > > Signed-off-by: Peter Rosin > --- > drivers/i2c/muxes/i2c-mux-pca9541.c | 26 +++++++++++++++++++------- > 1 file changed, 19 insertions(+), 7 deletions(-) > > diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c b/drivers/i2c/muxes/i2c-mux-pca9541.c > index ad168125d23d..47685eb4e0e9 100644 > --- a/drivers/i2c/muxes/i2c-mux-pca9541.c > +++ b/drivers/i2c/muxes/i2c-mux-pca9541.c > @@ -59,10 +59,8 @@ > #define PCA9541_ISTAT_MYTEST BIT(6) > #define PCA9541_ISTAT_NMYTEST BIT(7) > > -#define BUSON (PCA9541_CTL_BUSON | PCA9541_CTL_NBUSON) > -#define MYBUS (PCA9541_CTL_MYBUS | PCA9541_CTL_NMYBUS) > -#define mybus(x) (!((x) & MYBUS) || ((x) & MYBUS) == MYBUS) > -#define busoff(x) (!((x) & BUSON) || ((x) & BUSON) == BUSON) > +#define PCA9541_BUSON (PCA9541_CTL_BUSON | PCA9541_CTL_NBUSON) > +#define PCA9541_MYBUS (PCA9541_CTL_MYBUS | PCA9541_CTL_NMYBUS) > > /* arbitration timeouts, in jiffies */ > #define ARB_TIMEOUT (HZ / 8) /* 125 ms until forcing bus ownership */ > @@ -93,6 +91,20 @@ static const struct of_device_id pca9541_of_match[] = { > MODULE_DEVICE_TABLE(of, pca9541_of_match); > #endif > > +static int pca9541_mybus(int ctl) static inline? > +{ > + if (!(ctl & PCA9541_MYBUS)) > + return 1; > + return (ctl & PCA9541_MYBUS) == PCA9541_MYBUS; > +} > + > +static int pca9541_busoff(int ctl) static inline? > +{ > + if (!(ctl & PCA9541_BUSON)) > + return 1; > + return (ctl & PCA9541_BUSON) == PCA9541_BUSON; > +} Reviewed-by: Vladimir Zapolskiy -- With best wishes, Vladimir