Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3505791pxb; Wed, 13 Oct 2021 07:22:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkLdAwLnQAzJxqBIrYCGxIvLJGkJ9VIGwyYLMBFguTdfk+n43nNePDMrRuzclxazs8thIQ X-Received: by 2002:a17:906:7d09:: with SMTP id u9mr21384953ejo.120.1634134962356; Wed, 13 Oct 2021 07:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634134962; cv=none; d=google.com; s=arc-20160816; b=CBBYLgHyw+sgOWRJGH6+wIOZLRv0E8ERDB0O8V360GkFHHxZHE0R9tO8iCBWt50DF/ nKoGhz+F27ppAObKmsRc1LSU7NwTxj7dm66gD3JHbnwzjsCk0ODsPCwaqT2bepAMLWLW lIAqg4W2x/EUsTdKQihQEaKtovwIdpb8HPy6ETd+HHivKwvOBm3+/C7w9ryWvssYNNZe EoPQWEBTFc0c9gnUfTVFgFhVee59II7j3MrnrGynPo4wvCzclhwEVvtgnJmQp+hEVK8w 924eSYoowqIefqDvZRPWvqFPOyapzKSGUvvhe1Nkx87buPwZFFsjYyMCUMYyg/GgvFIY FiXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=hyKByRZ/GuGOHDrRuueIn6LgYP5RDSup2vvE0IokD8s=; b=ChvN74RezYlVbELfzYa4sqwA8qI94w31qZ+NXvU1oxe4ycR4fAuPpsAuzQFeS0/fgk AVIwUjyWqwwhvGbmRwFpGKwcPMsoC7E6tKpzuHsg0u343pwDrglgYaNa4nYOnC8pyQbt rxb9/maYTesn2pWYvU346BVOzRRxYDbROFcoQy8g86YvlA5oRo1oHtsqljpZj/2eB+Wd afQUB0WnUmpd1oBVbctOtpRoSbmVbPAk8vd2c69NqTtYyPUu3tRaOPTp536RkUqlF1lr LfXGed4uim0EDnKp47GDOKeEy6hC6Kht6257lPFXlYIdQWj3yQpyOaGb5FrNHm3xvmeD eonA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=NGVzezf7; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si14494595edp.551.2021.10.13.07.22.17; Wed, 13 Oct 2021 07:22:42 -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; dkim=pass header.i=@baylibre-com.20210112.gappssmtp.com header.s=20210112 header.b=NGVzezf7; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231980AbhJMOWa (ORCPT + 99 others); Wed, 13 Oct 2021 10:22:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229562AbhJMOWa (ORCPT ); Wed, 13 Oct 2021 10:22:30 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0231C061570 for ; Wed, 13 Oct 2021 07:20:26 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id w10so6834402ybt.4 for ; Wed, 13 Oct 2021 07:20:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=hyKByRZ/GuGOHDrRuueIn6LgYP5RDSup2vvE0IokD8s=; b=NGVzezf7p6vJzoklIghoKhL+hht/BTn6fN63XbvwLmauHIhu+i5d6IBDzZvC2qqyYk uHeQhTjzYWS7OxYDmE8fkd48I89FwtnaXQEDsZeXGyMPGZg9aPbyHMDGuL/RTjtk3iPI 5OOJHX8tG4O/1Zdwb8tR9u3lFOgtRIib17pIhxnrgedf2YoHOUm/WJDao21wON8zlT1W 15TIF6h46SvTMavAPk1KFie9YtZPDQsqw+KDPM3C6qsvdOA0sJ4L9i9lexeRa7ES260L favwo//Q4VQfBbjKvTEhZX7xdGJcLkwl0uL7uAIjfamm2+I8WVT+6mQZtK1kyD2Eau6r qS5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hyKByRZ/GuGOHDrRuueIn6LgYP5RDSup2vvE0IokD8s=; b=PdRSS4b8dG9LoqX35UxDBsAEeXBCkzcu5w1n8vl3JFmC0f8zvWwkRSQfHlwq897d5f Da5oRIT3gJJ6pO0kF3as8DtAnP4P3BXrpnYhli26Rktd1taqztldV0KHpSELceXSmX4Z VawmkhSpZIL6sfrltqKA8eLAbcQPvNue7NDUrTRrKyPEMne7sriXnUw0Lwgy4IsjZ3qC BLOA9A9aIXEwnHHqElGjj8w0zIrfWJH2U2loVLxOWN99TZtfQljQmudDGyc1GuPo9B83 GA9PkuhOYJn2XnHyHj0tgi8qnWLfjF9b3RB7laJv9NGm1B1FgKXoDB5Vj4UQ1tTCDyUn Lxmw== X-Gm-Message-State: AOAM530+QVi3NVeLY/8UBO/ZYc8c5JNqn8c2KP0bWm5FggJeRSbT1phQ TvIT5pSMj2dp9FCopd46A+zZt51jgI7LdqQZphjezQ== X-Received: by 2002:a25:5402:: with SMTP id i2mr35635403ybb.312.1634134826062; Wed, 13 Oct 2021 07:20:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bartosz Golaszewski Date: Wed, 13 Oct 2021 16:20:15 +0200 Message-ID: Subject: Re: [PATCH] gpio: aggregator: Wrap access to gpiochip_fwd.tmp[] To: Geert Uytterhoeven Cc: Linus Walleij , Andy Shevchenko , linux-gpio , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 4, 2021 at 2:45 PM Geert Uytterhoeven wrote: > > The tmp[] member of the gpiochip_fwd structure is used to store both the > temporary values bitmap and the desc pointers for operations on multiple > GPIOs. As both are arrays with sizes unknown at compile-time, accessing > them requires offset calculations, which are currently duplicated in > gpio_fwd_get_multiple() and gpio_fwd_set_multiple(). > > Introduce (a) accessors for both arrays and (b) a macro to calculate the > needed storage size. This confines the layout of the tmp[] member into > a single spot, to ease maintenance. > > Signed-off-by: Geert Uytterhoeven > --- Applied, thanks! Bart