From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E487C433ED for ; Tue, 18 May 2021 00:50:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6FFC8613AF for ; Tue, 18 May 2021 00:50:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345198AbhERAvi (ORCPT ); Mon, 17 May 2021 20:51:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239944AbhERAvf (ORCPT ); Mon, 17 May 2021 20:51:35 -0400 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49B32C061573; Mon, 17 May 2021 17:50:17 -0700 (PDT) Received: by mail-ot1-x32a.google.com with SMTP id u19-20020a0568302493b02902d61b0d29adso7190718ots.10; Mon, 17 May 2021 17:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=11AmUmE+3jDAlknGZhIf8nvE4IgD55HSgs5v9hU/fF4=; b=Tk2IBTrjmD17gwRroO9Ojtyyjjd1yC1ZZgBrg1Nnt6MJpZcJFCn+VdYG051SeTsDG8 9mxyv2s3HDR4WUtZv1rISYfyAF8wDfQMW+Vy1wUNTkmc3seKUPvVeqr06Oem5zuckEh/ ugRxSBatwjf7lySgtcD0W6ghpwySNz9Jq60Xo/jnVsNrXpQA15gpyVGkpESRYyXf+GAm mKqy2TeZzGd71t9r8PZg0ymMaHbiojOd7xHvod+Kpw8PtKIvwJqocf96H9hbVFbSn56D K6OuQKSJ9uF6JCZF3R2X3i16wKTOpbCqpu50uzWGeBr6li3ovJmPiD22bXRZ/GlnQQe/ HvhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=11AmUmE+3jDAlknGZhIf8nvE4IgD55HSgs5v9hU/fF4=; b=AwYpFl+bALiK+c0O2xDQOwCsB5BsWa7h+lRU2G6JRIoua1zRGDxd7ufWD0pUvlpUVQ f+JdzmUa/2JyQPwD1HoQ/3v7dVK5bSy89cLlbM/KgbmscrSNDl+dt6VPUooHl1id8JDr dLJ7cQ5QAhBgpaRk5RvCuDC+uriW+SN3e8NdI0n4MouALhRMotfcbRmQ1MPxoicLa0cU xdOEZMPtN+8EXKxeXy8vHJDHryU3yyr52JQiBCJw6+7/I1GXkKxGw0UEBcesAARO+4Fy Mh7mpJCMq4KdBpkoWWHzRPIpwYmUrffG2kUz6E0tuGxLti06Qul7427FlFsgf2tFOTbq W75A== X-Gm-Message-State: AOAM533Vw3ChfKCk24psc8ev1wWnQvkC9j8nFGoANq8e246asZw9EaCJ vxPJvd8RFYodg0LshUQTqrDeGb6Po3U540pt9BM= X-Google-Smtp-Source: ABdhPJwZ2dpUPKMrdAnJ/MmTD2FuOZLOhqkq45t9sKkqK+2naDSw5gdLeR8tu8odGHw+D7NbcugPrzeJso28BA2wUiQ= X-Received: by 2002:a05:6830:10:: with SMTP id c16mr2025257otp.252.1621299016743; Mon, 17 May 2021 17:50:16 -0700 (PDT) MIME-Version: 1.0 References: <09e65d3a235febfc4c3ee172b573ba8c9cde94b8.1620766020.git.lucas.p.stankus@gmail.com> <20210513165236.586b8beb@jic23-huawei> In-Reply-To: <20210513165236.586b8beb@jic23-huawei> From: Lucas Stankus Date: Mon, 17 May 2021 21:49:41 -0300 Message-ID: Subject: Re: [PATCH 2/2] staging: iio: cdc: ad7746: avoid overwrite of num_channels To: Jonathan Cameron Cc: Alexandru Ardelean , Lars-Peter Clausen , "Hennerich, Michael" , Greg Kroah-Hartman , linux-iio , linux-staging@lists.linux.dev, LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 13, 2021 at 12:51 PM Jonathan Cameron wrote: > > 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 No problems, but I think I should've better checked the mailing list before sending the patch, it would have avoided the noise. Anyway, thanks for the review :) > > > > > > indio_dev->modes = INDIO_DIRECT_MODE; > > > > > > if (pdata) { > > > -- > > > 2.31.1 > > > >