Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp329682rwb; Sat, 17 Sep 2022 06:06:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ngKVkOb7biLUU2AsABW/sLJl0qjrFUyHmdmTJZvr/WRWMVG7AfulkDDf3HHxxWHW6PSVl X-Received: by 2002:a05:6a00:14ce:b0:544:1ec7:2567 with SMTP id w14-20020a056a0014ce00b005441ec72567mr9416082pfu.24.1663419992111; Sat, 17 Sep 2022 06:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663419992; cv=none; d=google.com; s=arc-20160816; b=sO0+eb5vAOtiuGBBUSiJSt/zLLKFeU4aP2o3ndXKicUip9FcqkMU62OR+58hl+6ECt GdfLQ79tMV+WshxKJ5SpteREEcRUN0ArPV8cWJQT+Yw25esAW6mLEDrj5he0jHsO8VO6 aOZOBIK2uCByWHu1/zCjugLVBmGn2tTyVpJTlYwToX0l2bUqSVvUaqNpdxVYNGeoPvSd mV5buNPcQEcv9m12whd02vKjC3+FfLmcsLi0H/05f753c0BT/ImZa9PLDAnujFSMpqhO 0bTwTUeZIvzio5VcoqeqG5cHeblkgMu5WgO4U4wtZZxs3DLl1EjvwfRxicYRBV2U3LbG InCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SoRjgGhFKB6qK5SZ5FRfYbus4A+LpnAUALssenPcRNw=; b=tR5sNDJx93Rq10gyGJ4I7J5QXirriijlXykcs9LvYImZ4XmiP07GMj/UNPicVpZRap yyp45wYbp9nng2p6d17h+n+WCjKOmF/tNJikzs0tPi8FOxvc2uRFNzn+L7wAmNZJEq4X 5GeQxUvVnPwTX4LadJPg7wUhngHs8WrGFqAuUf/o24fcmvznp368LQa8NoR11qY2+RoC 86S5ifPNaRC6vqoC7TSF7mxrwr5ZiGHYEv1ll8kHgtTCKS4+K5aw1sG3IuolpBsSoDnW lj1mmcu0rZZR8bLzuYzCN7WYwJfH1gMgND5V7B8STlXbt6SswQw/qutMfYChHtlUuyyf az7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DRGeFDWw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a170902694900b0016d3240c41bsi23365898plt.159.2022.09.17.06.05.48; Sat, 17 Sep 2022 06:06:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DRGeFDWw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229498AbiIQMah (ORCPT + 99 others); Sat, 17 Sep 2022 08:30:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbiIQMad (ORCPT ); Sat, 17 Sep 2022 08:30:33 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA2DE1C135 for ; Sat, 17 Sep 2022 05:30:31 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id d17so16807244qko.13 for ; Sat, 17 Sep 2022 05:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=SoRjgGhFKB6qK5SZ5FRfYbus4A+LpnAUALssenPcRNw=; b=DRGeFDWw6ywgFiev+8bR2b/IIF8UK4365Ia9qU1CLMe37wREShyYJu7O9YobuPMtrN nUFJpUaptG9Ks8tSsq0PpDYb4etTC+mQKr4F4qsBWR4m+DYbBB+5EkjIgt4OBr8Z/Ba1 ZLiCXlUoDdQe5vhzwTn+cm/M5EpOsAdQ9IkzmQ+kDoD1yZErQvjsEsozb4Folq7iTbwF itDFXQhckBlxtCCkU8jFZjnnK9vlCKP+sSfcVP1Y1idof6rgPsYQgveRAjxd3OuJIQmR iPzjxicjXpT5MLk8HF9fncRj3itQf3Et92GTNcUtHepsJnmEqtj2vdddw3D5JRlLqj7p yp0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=SoRjgGhFKB6qK5SZ5FRfYbus4A+LpnAUALssenPcRNw=; b=Feo9zJkD6XrGADEHkxjrBRtx2M8mMhPYc1oHgzJlR1UCox0Y+AqPpQm1uICYVO8W51 W4FBGGfMGCd5T02pZaPpDuIYfjEpj0NURp37Vd5Vbyb2gRjrem6yWhwyQ10GLWs4N3se TF/mx+bcnluRK//j0Xdh/9xRHuGoNGVaSD0GEoEjo+xD6/Ipt7SpTiDoaZaIbmA9X9Vy 2Nt3gY/U5cMFa/ICzSYc+kX6amACRT5yJM8Q/KCyCzgov1u7HcctLnZ87TD1gutJKSpS dlVXZBXDgnYM7WMJJkHl1U8DnRLjyWXTHFhZJomp5wTWa1tY03LUame5cWfvkt9MF2mz toNg== X-Gm-Message-State: ACrzQf3AfY5zkViw9LpFXCsPkvNwRN4FjLb3xRkWvBsXk5pFMGxWZ6/o 1+AYqlArta7F5+XbIGeRH+oudw== X-Received: by 2002:a05:620a:404d:b0:6be:9818:ea49 with SMTP id i13-20020a05620a404d00b006be9818ea49mr7160919qko.197.1663417830909; Sat, 17 Sep 2022 05:30:30 -0700 (PDT) Received: from fedora (69-109-179-158.lightspeed.dybhfl.sbcglobal.net. [69.109.179.158]) by smtp.gmail.com with ESMTPSA id x8-20020ac85388000000b0035bafecff78sm6708160qtp.74.2022.09.17.05.30.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Sep 2022 05:30:30 -0700 (PDT) Date: Sat, 17 Sep 2022 08:30:28 -0400 From: William Breathitt Gray To: linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mranostay@ti.com, jpanis@baylibre.com, gwendal@chromium.org, bleung@chromium.org, groeck@chromium.org, jic23@kernel.org, david@lechnology.com, robertcnelson@gmail.com Subject: Re: [PATCH v2 4/4] counter: Introduce the COUNTER_COMP_ARRAY component type Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7cjrr8ZiGM7f26cT" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --7cjrr8ZiGM7f26cT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Sep 16, 2022 at 08:39:28PM -0400, William Breathitt Gray wrote: > +static int counter_array_attrs_create(struct device *const dev, > + struct counter_attribute_group *const group, > + const struct counter_comp *const comp, > + const enum counter_scope scope, > + void *const parent, const size_t id) > +{ > + const struct counter_array *const array = comp->priv; > + struct counter_comp ext = *comp; > + struct counter_array *element; > + size_t idx; > + int err; > + > + /* Create an attribute for each array element */ > + for (idx = 0; idx < array->length; idx++) { > + /* Set index for array element extension */ > + element = ext.priv; > + element->idx = idx; This is unintentionally overwriting the array length and thus skipping the subsequent array elements. Instead, element should be a copy of the array rather than a pointer to it. I'll fix this in a v3 release. William Breathitt Gray --7cjrr8ZiGM7f26cT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQSNN83d4NIlKPjon7a1SFbKvhIjKwUCYyW95AAKCRC1SFbKvhIj Kzx7AQDEzWxbBm3BxMXg8qMoL0Jgn5Swc8ZTmkDZsypU7P+klwEAl5icUdc8Qbii gVuh9WqOSMihHfqIY54MxQ02rLbgyQU= =tWcE -----END PGP SIGNATURE----- --7cjrr8ZiGM7f26cT--