Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1668652pxj; Wed, 19 May 2021 11:03:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTgLFu6KORUyXmgzEfEFhXAswghr2qxXrbmvz+F8CYWdfobsYZcgTxUq29ofzL1dQ0i/Py X-Received: by 2002:a5e:a604:: with SMTP id q4mr807779ioi.178.1621447410270; Wed, 19 May 2021 11:03:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621447410; cv=none; d=google.com; s=arc-20160816; b=GAxFQOP+56jYNu/FWDvWoxE/82t7esuXtk6cXROUZ0E8RhY3F4suqAe1dz583xOvMp sWweLgZIvIF/sDqVMkHOzLbVx4OKg4xDzJM6OcvvMQsVOCF6mhV8jkHwBZrWrJE7qYAW G/MbrQ3NkGH9byP2EsgCmUoTPJY2gYwMAcCQgJ5Y2h7hGg0IExwV0ejQkfhgobLUrvfF /7+yTRbd2C1IJZ4t20NsOHpYyfYJUVkTbs4cFi+ArPBEOjsfaOaipqThociLlGpkmnKT avsRkcRbXA8qPGQ1Vt/lr0sPCTMOnEOix9L39qB1OUGdPQ/ZH8yRfvGao2T1L1CZnlp5 0JIw== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=7Sckujdr/MUrRcfixI6ejt/MVF6L5Iz73xeOn7LMPVI=; b=MF/04e9yUHBniZcBd2KLyXAI7ZrCW0cPwty71Jlh5XF6diPVO66ThxbIOCfbV/p4rm 0q6wPTYbdAqMnoWCycXnwaBillvaTuZCAEJnGzqesJfEoG5m+xRlRlO96yYArGBykpDV Bl/pP4tA+d8oFdNhqmWHpcwWLZQKNWNmN8GK8IY67Jm/oX08CEKX33uUcY852Aunwjxa jfDen6yE3F97Md7xo9PHFyk4WqSuExcIuRUsggcwAHicvU1y+f46ckIleOS4w7DZprb6 EOHIBZ9Fcun7OTBZjV4rIoL5Taiupzf3OWX0P/eMSL5h8201TyDg6TjheIhAwAKKQSBu BDZg== 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a10si354632ilv.110.2021.05.19.11.03.12; Wed, 19 May 2021 11:03:30 -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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244492AbhERMLs (ORCPT + 99 others); Tue, 18 May 2021 08:11:48 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:3019 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233638AbhERMLm (ORCPT ); Tue, 18 May 2021 08:11:42 -0400 Received: from dggems705-chm.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FkvsK6kj1zlg8D; Tue, 18 May 2021 20:08:05 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by dggems705-chm.china.huawei.com (10.3.19.182) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 18 May 2021 20:10:20 +0800 Received: from localhost (10.52.121.12) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 18 May 2021 13:10:18 +0100 Date: Tue, 18 May 2021 13:08:33 +0100 From: Jonathan Cameron To: Lucas Stankus CC: Alexandru Ardelean , Lars-Peter Clausen , "Hennerich, Michael" , Jonathan Cameron , Greg Kroah-Hartman , linux-iio , , LKML Subject: Re: [PATCH 2/2] staging: iio: cdc: ad7746: avoid overwrite of num_channels Message-ID: <20210518130833.00001807@Huawei.com> In-Reply-To: References: <09e65d3a235febfc4c3ee172b573ba8c9cde94b8.1620766020.git.lucas.p.stankus@gmail.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.52.121.12] X-ClientProxiedBy: lhreml725-chm.china.huawei.com (10.201.108.76) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 17 May 2021 21:55:20 -0300 Lucas Stankus wrote: > On Wed, May 12, 2021 at 2:20 PM 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] > > As Jonathan said, this bug was already fixed and the patch will be dropped, > but thank you for the review. > > This was my first bug fix in the kernel, so sorry for the absence of a > Fixes tag, I'll make sure to add one next time. > Wasn't already fixed - I just applied this patch without PATCH 1/2 so now it is ;) Jonathan > > > > > so, maybe something like: > > > > Fixes: 83e416f458d53 ("staging: iio: adc: Replace, rewrite ad7745 from > > scratch.") > > > > > indio_dev->modes = INDIO_DIRECT_MODE; > > > > > > if (pdata) { > > > -- > > > 2.31.1 > > >