Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2314918img; Sun, 24 Mar 2019 05:38:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqyNsJi/+7uRNbFOpsQ+r4RVBd5TWHJNyuDkvtlYBsElrv3GKLZuLB03Rs2/zQsksDn3eD4x X-Received: by 2002:a63:2a8f:: with SMTP id q137mr18147339pgq.31.1553431097496; Sun, 24 Mar 2019 05:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553431097; cv=none; d=google.com; s=arc-20160816; b=bb6t3cIdGleNkLQh5V+pzDH3G484Yw+k5XJODMWwLV3QEzAva3fVyqznXaOjvN3yfT Evl89ubzVxuD+bA6VVHhVRdQQBFCykdq8dWE0meHLL9DnvV+JBkhfd+hS2bjFgnjNLhg xGIyJIU41GUQo+cpzViCRZMhFbwcC/FGBFaRODtYbfDtBkpvy9iqxDjehYMGvB3pBNdo hPlo83E0D5kjp+FvsF02m4aa4zFkS9Vkbb7k5BjqizidVfSRzD6CdLmAvADtpOLHR28B SeeNc1o4IsNlxhODM0vi63JPS2olK/EnFjCQ4sAQnT5pFQ/PbzHXHF4gbXK9aYGIymlg eIBw== 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=RSHqwByBK05eJZ719tOKuBx2qlINA2y6eHRQLY2GwHU=; b=UE2yfrD1SkvAtVPi/aEehAgf6RxSSK9zmzkHYLepF9HJxcAq8P4gssN3QSSTOGuSZY QkngyLEXTYNxAZjfQffO2oShfq6B18BRVJbdczolJ63emB6TayoutLGmj6hAj50TBVQE ookZMuPneyfOFHy4KMfLkPHSiVffEPvXtsSUyX5KAoTBpD0GEh1EYBtgA85ss0Oq/jh7 4i4evVT1cwUJK091tdY4N8UZCcZ7EaCNu1VY/7VvQ5U9EJ7MDdLQ2VrbLBmCT687pHGf N//069PyDTFS+gwfKzSZKDpaJYI9qdTGMeByU3KV+iF4nbh4Ofuq1mA4DN01ivlsNe9U nsnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g5kIZlrx; 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 bc4si11242517plb.119.2019.03.24.05.38.02; Sun, 24 Mar 2019 05:38:17 -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=g5kIZlrx; 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 S1728741AbfCXMh3 (ORCPT + 99 others); Sun, 24 Mar 2019 08:37:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:52074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726160AbfCXMh3 (ORCPT ); Sun, 24 Mar 2019 08:37:29 -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 6C9FB222D0; Sun, 24 Mar 2019 12:37:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553431048; bh=3cFgC6XcPsJZ+ORlRuEUi1U5PXE/Bu+9/b8HqjuqQgI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=g5kIZlrxUMfTm/6sLOiOEt7IbGLcExaNgo+k87BLSjbbZoC1KaILZGHpY4IbV+lp+ TMP5+PnNIhWY1PLKyBUV79m7KOy0pal+H1dT4SGK5FlwRbCN3dynAvAEH14s35HB2n jAdCWCE6zan0ggPyCqJZCcG7pgynTN2nF+0e6pPA= Date: Sun, 24 Mar 2019 12:37:23 +0000 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 v2 3/5] staging: iio: adc: Avoid precedence issues in macro Message-ID: <20190324123723.0f78bfd8@archlinux> In-Reply-To: References: 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 Sat, 23 Mar 2019 20:21:42 +0100 Cristian Sicilia wrote: > Enclosing parameter with parenthesis due to avoid > possible precedence issue. > > Signed-off-by: Cristian Sicilia Applied to the togreg branch of iio.git which will get first pushed out as testing for the autobuilders to play with it. 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 55b5879..d81a5bd 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