Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp407671yba; Sun, 31 Mar 2019 02:35:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqPV7jObq7hN76LmB0lI3frYughYF4zJ9iv9VWoM+vDMyA9YnykTzFmJ2MFw88K1jlci+B X-Received: by 2002:a63:1749:: with SMTP id 9mr53195387pgx.94.1554024918748; Sun, 31 Mar 2019 02:35:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554024918; cv=none; d=google.com; s=arc-20160816; b=OLwiSwv5mWbdwLJrmxURaMv88r/CPaFk7ix96iVO9iSuzONMRaHd2BlZuotWJv5J7V rDLEyleCmb8jz5lFAW2kSRlNOrG42BetNFd7K+1eXFEhWoqEp7vrxOGufFuU+fg7utrR yMos3v+ajUBbyDzxnLD0Z4aWAa6FOo/R4Tkjv5teTraZuxBFfeBD6djvd9I5eCnSEVBa GGZhVIv0+8Pb29ZiKVHTn0KixA2Q1xoiR43jm4zD0FpDelErgEzqr2m2iObxYbTx9Z22 zIxYPcfifzWopTryxHjG+80ki07xhkTbXgwXnhSghgdfAEsIG1F4sPiQtDsceCEAQmxP 1Gig== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=g0dcEcr2GHhsfogP7+Hmx+cmsDQuDhamN/rJbWn0bts=; b=QgatX+nJpeufrbfT1gOAB1PzmvCIfIINqXskQYSO/fvZW/aGi3hJsAoA8UZKU++XwZ ZTf6nOh1lIG6xgcL3a7ZjhUOFDl93YixcSaaKH+Wpxc6PungiFRiM3bB1sBA+eY9FSUG b7pNSDY0UlOXae9L6F8GBtUxvDQJJU9Pyr61LsBc5grslJt4RcJ/ikz5k+kCxqrkQTJ/ 6J3HEop84t5lxaO5IQ8kXF1MwkmvRNCqFAC1BOMqmXYxz8p12k1mZH0erYAv3RmF0tym beH/qlZUByviUSe99Q884Vyh7U/4zStCJAoCs5DRqLgCERqEj1jC9L/Unh3lykXNobIC fjnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MHwmnKwP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r9si5959010pgp.193.2019.03.31.02.35.03; Sun, 31 Mar 2019 02:35:18 -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; dkim=pass header.i=@kernel.org header.s=default header.b=MHwmnKwP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727023AbfCaJe3 (ORCPT + 99 others); Sun, 31 Mar 2019 05:34:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:51934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbfCaJe2 (ORCPT ); Sun, 31 Mar 2019 05:34:28 -0400 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DBF06206DD; Sun, 31 Mar 2019 09:34:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554024867; bh=NQUdGp/T3VGM7e5Zo3SXY8ndPOL4xgKTuoXfmgaRSac=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=MHwmnKwPbhG41aMV3ubAM4VqCOqK/TXuAWh8GVv8r42fzjllO1cGAhx7nWe4w34hx HjXQsavJgxsF8J+QHIUahiym/KWMbKTWRF+0mVeJxn6zHVYlu+yaHVd8p4Nx8RSCcx IzmzloL41NhDM6NdCAKDsKqGHzZD9lMmFKdoNm0c= Date: Sun, 31 Mar 2019 10:34:21 +0100 From: Jonathan Cameron To: Cristian Sicilia Cc: Lars-Peter Clausen , Michael Hennerich , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/5] staging: iio: adc: ad7280a: Avoid precedence issues in macro Message-ID: <20190331103421.7e453618@archlinux> In-Reply-To: <5e81974355d8de3cdb3c7bc1d4b0cc0fab691872.1553447138.git.sicilia.cristian@gmail.com> References: <5e81974355d8de3cdb3c7bc1d4b0cc0fab691872.1553447138.git.sicilia.cristian@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 24 Mar 2019 18:23:12 +0100 Cristian Sicilia wrote: > Enclosing parameter with parenthesis due to avoid > possible precedence issue. > > Signed-off-by: Cristian Sicilia I've already applied this one. Thanks, Jonathan > --- > drivers/staging/iio/adc/ad7280a.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c > index 571535d..c2391f6 100644 > --- a/drivers/staging/iio/adc/ad7280a.c > +++ b/drivers/staging/iio/adc/ad7280a.c > @@ -97,9 +97,10 @@ > #define AD7280A_NUM_CH (AD7280A_AUX_ADC_6 - \ > AD7280A_CELL_VOLTAGE_1 + 1) > > -#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) ((d * AD7280A_CELLS_PER_DEV) + c) > -#define AD7280A_CALC_TEMP_CHAN_NUM(d, c) ((d * AD7280A_CELLS_PER_DEV) + \ > - c - AD7280A_CELLS_PER_DEV) > +#define AD7280A_CALC_VOLTAGE_CHAN_NUM(d, c) (((d) * AD7280A_CELLS_PER_DEV) + \ > + (c)) > +#define AD7280A_CALC_TEMP_CHAN_NUM(d, c) (((d) * AD7280A_CELLS_PER_DEV) + \ > + (c) - AD7280A_CELLS_PER_DEV) > > #define AD7280A_DEVADDR_MASTER 0 > #define AD7280A_DEVADDR_ALL 0x1F