Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp40541pxj; Thu, 13 May 2021 20:21:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzz5r3I2zNpEkkCYfoUSZVWgu9i7LaCBwy3V0bO8vOUJ9/WQLXDiZOQZ74LANFiJQj3P6dl X-Received: by 2002:a05:6e02:92c:: with SMTP id o12mr39200586ilt.256.1620962461357; Thu, 13 May 2021 20:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620962461; cv=none; d=google.com; s=arc-20160816; b=XMRwrPRViKLRFVtMjx6zxPsRKpO/V9He+y7Ew795HN+zY7ab/jCn6DREpjFrdlubpZ WbK8ciMsTlD6ofDYaoaz1iE/OHOGX+tlfA9LS9osMR6+JYo04cLz3g6lgO/fcWJlPy2P T97T9zWiD3+pUwppZtP8v7G00oIjM4D5kPQm6aTTx+d/6irFJtaWpyY/CxtwsL8rAD85 fCtR8yfK2zXlXJtcWjRQIaiwmFHf+GeqrFD1YeZhetkF6mTm6gBywC+M83JWgL1pq5I/ FgoZBdp6PaRnn8vdBZlZ+7AHQjpcH8C4daty/ratsbcKHn8Nvf43mVzq4f8niAFUvLJg Ntlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=KtY/sOo+nywX3pnE9q6nYX8p2A2pHeK5o8RpPaxBHis=; b=0Qz+nFIK4Oq6F9zZ+1syXCYF59xkoa88BBMLnf1K5UG1dEB1blBJxqvKdBeXy4DXAC nyaCkTVYrracVwLojPCEk+Q6IUf19tWYcnOt8FWOI+8+YeLP0mAyJE6dgWjaGkn3YXN9 CqVv6Oiq9pEir2Wtg+Mp1mhr/OA3imkRDyQwkqWFySWfsLVYbR6lI883fYr2e2Pq1RR0 pXfOxMRtmqBZTCzhM1ah7P9ySoJ7FxqE1/hgBM+7vWn1Le7LI63rX/XbWnx1FzZQfSFh f4Oed7rZaa+9z6TEQqgTDwGzMk6bZTDQla3ZFvARB9rnXDDtqEUK8dUY81m1JkRY100f aEWw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id c188si6177992iof.9.2021.05.13.20.20.49; Thu, 13 May 2021 20:21:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S232324AbhEMPwu (ORCPT + 99 others); Thu, 13 May 2021 11:52:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:45496 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232251AbhEMPwk (ORCPT ); Thu, 13 May 2021 11:52:40 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (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 B569961408; Thu, 13 May 2021 15:51:28 +0000 (UTC) Date: Thu, 13 May 2021 16:52:36 +0100 From: Jonathan Cameron To: Alexandru Ardelean Cc: Lucas Stankus , Lars-Peter Clausen , "Hennerich, Michael" , Greg Kroah-Hartman , linux-iio , linux-staging@lists.linux.dev, LKML Subject: Re: [PATCH 2/2] staging: iio: cdc: ad7746: avoid overwrite of num_channels Message-ID: <20210513165236.586b8beb@jic23-huawei> In-Reply-To: References: <09e65d3a235febfc4c3ee172b573ba8c9cde94b8.1620766020.git.lucas.p.stankus@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 May 2021 20:20:02 +0300 Alexandru Ardelean wrote: > On Tue, May 11, 2021 at 11:55 PM Lucas Stankus > wrote: > > > > AD7745 devices don't have the CIN2 pins and therefore can't handle related > > channels. Forcing the number of AD7746 channels may lead to enabling more > > channels than what the hardware actually supports. > > Avoid num_channels being overwritten after first assignment. > > > > Signed-off-by: Lucas Stankus > > --- > > drivers/staging/iio/cdc/ad7746.c | 1 - > > 1 file changed, 1 deletion(-) > > > > diff --git a/drivers/staging/iio/cdc/ad7746.c b/drivers/staging/iio/cdc/ad7746.c > > index e03d010b2f4c..9e0da43b2871 100644 > > --- a/drivers/staging/iio/cdc/ad7746.c > > +++ b/drivers/staging/iio/cdc/ad7746.c > > @@ -693,7 +693,6 @@ static int ad7746_probe(struct i2c_client *client, > > indio_dev->num_channels = ARRAY_SIZE(ad7746_channels); > > else > > indio_dev->num_channels = ARRAY_SIZE(ad7746_channels) - 2; > > - indio_dev->num_channels = ARRAY_SIZE(ad7746_channels); > > ohh; good catch > > this falls into the category of a fix, so a Fixes tag is required; > this looks so old, that i did not bother tracking it before > 83e416f458d53 [which is 2011] > > so, maybe something like: > > Fixes: 83e416f458d53 ("staging: iio: adc: Replace, rewrite ad7745 from > scratch.") ouch. Given I was queuing up some fixes I've added this one to the fixes-togreg branch of iio.git and marked it for stable. So drop this one from your v2 series with the changes requested in patch 1. Thanks, Jonathan > > > indio_dev->modes = INDIO_DIRECT_MODE; > > > > if (pdata) { > > -- > > 2.31.1 > >