Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp593351ybt; Wed, 24 Jun 2020 06:43:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyH1L+dmVv26b0iDFMNVY7HqSbne607ip0WcxEQbKjwvdkUe75jE1p0YQNx2l0djd0N6ix X-Received: by 2002:a17:906:7247:: with SMTP id n7mr25048871ejk.105.1593006224159; Wed, 24 Jun 2020 06:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593006224; cv=none; d=google.com; s=arc-20160816; b=uD9tp6RCDUo/2k5QvTUqfFEz+KcxEWi9kkwQItDx2JSeld0flsRea/7VTE+JPom7/d Ik5uKDAxmkROXMMT1fWA3pqBsKZ4w3+WzioIB/737bMlK90NYnHhC918wumgjZQnNii9 FtKUN6mE7yoLabRmQUIjA47/SzPpbyZigLjXaLinWpJtRSzr04RB9jVycIad22FeRXdA ZYfZyT6meHdW+X5gGBncivgnwK8scMp7qhN1WAY5MXhNofFMca78U6UvH3J4eZ6FTMkS EUARJdCcMK/bojWk83pPgfOiTsp9JcTBWz09KCh/HK/kifMFKxvdPXWZJu/RitdK86dZ WOkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YjaRnLW/TeYDKRVMhHoc45hQDjzb3Lxd9P36OWV9xUg=; b=kbsLS/8rPt/ihaOEcEatEVxFjW7J3KOjNPosz3bFiWBXArjS8pwCVfZ0t+M9dCRsli ZrGYkcSOqFYHAX11E7SfLrCya5W9owMyT+B0IUjdznMe+5FMlJp70Zq2njsdWkz9udbo LuDVaS/t4uUUzyAUK1DT9o8nZBDARakZCbb+zLGXmrYKyyUX3dSddmzTTOvzXPgjxbWo mBOrHvrmaJmCB70NIUJ3EzcQCCZcTw9j7M1pjTX8N+i4pyDpIlPFKGqmf9g7GtvcljM+ 33ZG+HdmdQFpm2iX3vzDBzm9pd+/GiQ52RLlvPg9aAxp5QWL7+mjMspiwmL1YfraVBZg u7yw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RQJP9IMn; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si3186011edr.380.2020.06.24.06.43.20; Wed, 24 Jun 2020 06:43:44 -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=@gmail.com header.s=20161025 header.b=RQJP9IMn; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391027AbgFXNlZ (ORCPT + 99 others); Wed, 24 Jun 2020 09:41:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388453AbgFXNlT (ORCPT ); Wed, 24 Jun 2020 09:41:19 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8493FC061573; Wed, 24 Jun 2020 06:41:18 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id k1so1084581pls.2; Wed, 24 Jun 2020 06:41:18 -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:content-transfer-encoding; bh=YjaRnLW/TeYDKRVMhHoc45hQDjzb3Lxd9P36OWV9xUg=; b=RQJP9IMnZpBzbnT/jh+2pJW2cGqgsGVYUg+jHmUFrFaiyByppGTLqtmTHID5c5IeM8 2n9vlkn+Lp0Ig1u5TF0mXhg82+LHraV3/WjEnJABoyKbCCbvwgQBWqb/dBUglS5aJhGk RmnqImfrEqOZp2e46uO50u9GLGltFwksP9MqT8BoNY6HcuucvCFr99VhSrFxHFXfgxFq xCB85l5FVyZy9bl3eqgGsh0j3SHmWiI7WrflyVMbOQz6fcPcBgDu63sUxsBAAiWrwRkT BB7KGloNr+drMlgjuAKVpP31HqM/PwSEMQtyIvD3CYeZsC5M2LrFR+asVVpZLsP3F/l2 BIeQ== 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:content-transfer-encoding; bh=YjaRnLW/TeYDKRVMhHoc45hQDjzb3Lxd9P36OWV9xUg=; b=GqVXt/aAAStKo2pRaEnnaI/US9MV/wChnBYLITLsRFaJl3A6APmf90pEpBgrcUNoH9 FkFmFzoWa3Q+LsUFhWhZq7JJ379GTc5Nn0XtdIf6MNl9vlitQtDNcMRwtmAy/JZrGlJB uYSSUEI7Nf4ysbUx8dVzGITm7a8yrqgz7/aA+AVPSzbRqAZaUMkDrWZjbaoFzcBWmjC6 h4KSMMAqZuh1BONkYv8ijvbr9iNpUMMxdzICMRDuLCa7vCbGo9r/LOGLnb0alq1vuicF P4sA329IpzL+77N8MyNG33CMEgjfvFiS/B637rKK01+H+AAb4K2pMvfqkKvWluULbGRQ cTfg== X-Gm-Message-State: AOAM530qn1AnQeYHeNnKkPVAWowqXaP6fJkD6Oa93+SQ1zs/04i45avo sf84xzsKp7WKyZ81edLZ3CYE1rABlBFOwTuI/J0= X-Received: by 2002:a17:90a:b30d:: with SMTP id d13mr28213586pjr.181.1593006078101; Wed, 24 Jun 2020 06:41:18 -0700 (PDT) MIME-Version: 1.0 References: <20200623145748.28877-1-geert+renesas@glider.be> <20200623145748.28877-3-geert+renesas@glider.be> In-Reply-To: From: Andy Shevchenko Date: Wed, 24 Jun 2020 16:41:05 +0300 Message-ID: Subject: Re: [PATCH 2/2] gpio: aggregator: Use bitmap_parselist() for parsing GPIO offsets To: Bartosz Golaszewski Cc: Geert Uytterhoeven , Linus Walleij , linux-gpio , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 24, 2020 at 3:16 PM Bartosz Golaszewski wrote: > > wt., 23 cze 2020 o 16:57 Geert Uytterhoeven > napisa=C5=82(a): > > > > Replace the custom code to parse GPIO offsets and/or GPIO offset ranges > > by a call to bitmap_parselist(), and an iteration over the returned bit > > mask. > > > > This should have no impact on the format of the configuration parameter= s > > written to the "new_device" virtual file in sysfs. > > > > Suggested-by: Andy Shevchenko > > Signed-off-by: Geert Uytterhoeven > > --- > > I'm not super happy with the mask[] array, which is on the stack. > > But there is no real limit on the number of GPIO lines provided by a > > single gpiochip, except for the global ARCH_NR_GPIOS. > > Why not allocate it with bitmap_zalloc() then? I haven't got the original messages yet, so my thought is to actually extract a helper from gpiod_get_array_value_complex() or gpiod_set_array_value_complex() for bitmap allocation. But I didn't check if it's suitable here. So, bitmap_zalloc() would be help= ful. --=20 With Best Regards, Andy Shevchenko