Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp365434imm; Fri, 31 Aug 2018 02:32:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdafH6MjoGKtuHDre7LzdgBEkOWb/It96VSyqn6+i265bIhP6pZaGhIaIrXUQvzORTRW/XLx X-Received: by 2002:a63:2605:: with SMTP id m5-v6mr7690754pgm.225.1535707929977; Fri, 31 Aug 2018 02:32:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535707929; cv=none; d=google.com; s=arc-20160816; b=sZHFWEYbxzXHXQme6WzO75yalMauQyaUUyT4qQzW1yvYk9D0/Uwz6vD3rhjTdPK+Sk cB79SGbXYcEArEIupMMiZRqpMsm4edvbLtZuB8otrOiCKmX93cuFojsjfpPQkN6g4sV+ X8BCVL7BlDFDS5g9rkx1dRCtkbqXihqPmAfJGFfGhJzxn54+7fzIqHUeljRykt8Z7Dzj MIAxMLHO7w9+tJFndeKmWu8TsQE/7B+e3fQw3DGNa8/YFMgGciVSGjWLVQAfrmEXGNgE 8Wf5Qlhsz7EYT9anK1EnZQrXR1ses6LxYEl87UeAKZshMVdgLGXhaex2vrkiDhx169Zv 48xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=oqc3wX8JBE3xxl60w0r8Z7EC6M3lE33h9kTqazogcZI=; b=zfJsY5bAjGWVHTX6v2dkylZubFoGKup1CvfdxN5MwVdgyRV3Ls9b+3xQ4Ky20ICyAt VB2snjQY/vdJzEdFde248tVVB0sU8qEbj5+D7pjvVNeiG+x+sxCzuPEaLPB27Fm9DToX mxmuy1dOTAEQDspfElIi2hecJs/vM0xjQPvsl1KcIDpremnO8/Q3x77QJq/SThCda+LY FpomOKgt26Ckweaw3bst7/diJqI/v2/OHhh/1c7ff+EuopC9IEAhfIKsQq4UJQtlGqq0 QEdRtz46Pj4mWzTdyZLU3lCnBhGns8fnriDee8verajDLOcvfdEoGHV0HwJPR6MtIJ5m ZfGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E38PWl8l; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c3-v6si8228370plz.21.2018.08.31.02.31.55; Fri, 31 Aug 2018 02:32:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=E38PWl8l; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727707AbeHaNVQ (ORCPT + 99 others); Fri, 31 Aug 2018 09:21:16 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:54660 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727653AbeHaNVQ (ORCPT ); Fri, 31 Aug 2018 09:21:16 -0400 Received: by mail-it0-f65.google.com with SMTP id f14-v6so6269076ita.4 for ; Fri, 31 Aug 2018 02:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oqc3wX8JBE3xxl60w0r8Z7EC6M3lE33h9kTqazogcZI=; b=E38PWl8lGr9I+qJHEzz7ASNkjoDKOoUMmE2LHPMSJrtH61+QCkfCiI6PJQfpJpz3i+ QyRCvgVl9TzhRegOqRCaKhA5EPhVuBfbvDi4CKqf3ZODat2M+PmvbCL3mB/fnVWT7HxH XsQDzcxlsFg4/xM38iv08w2C6LUzWnw1LoFo4= 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=oqc3wX8JBE3xxl60w0r8Z7EC6M3lE33h9kTqazogcZI=; b=c1ZHlFeV9jsTT0SoISPcOr6KtqamN3mpnkQHj3Oe0dNpUHg9yzQsFjrRIFrdJ3/f3N SLOAKcIBUfGVHrwHPKEEJB+p+K4C1LBT9IJnE+Ih/FlWgOajNVz8j0/9vLL+sKVa6CQn Ev94ZML2ANNq9d4Kvhogsd5Z/eHQnP8gsoCnz2cBJZIh/ODzYIPimHm7aTD/eoNh93HC e/NIgdLTJfIQMu9ZwiBzh/y2q1WTLyV/7U8xyAfWuwrsfahmjIQ7upQX0MSZOm5kxzQM G5FzMoEte2Hduvo7jRHpqelco4x5pYFoIKXN+IT9l/2NujBcOWaSH1DaJZGxfhuxv810 jo7g== X-Gm-Message-State: APzg51DXJyUiOnZUzEH52MG+e8Vlv0sJlKben7rCgDYKdEXTraCZa4DY HyMFKfpK0yKZHlyXY3YlZKU5g28C2llQpidguNzxZg== X-Received: by 2002:a02:2505:: with SMTP id g5-v6mr11825626jag.112.1535706883400; Fri, 31 Aug 2018 02:14:43 -0700 (PDT) MIME-Version: 1.0 References: <20180820234341.5271-1-jmkrzyszt@gmail.com> <20180829204900.19390-1-jmkrzyszt@gmail.com> <20180829204900.19390-2-jmkrzyszt@gmail.com> In-Reply-To: <20180829204900.19390-2-jmkrzyszt@gmail.com> From: Linus Walleij Date: Fri, 31 Aug 2018 11:14:31 +0200 Message-ID: Subject: Re: [PATCH v5 1/4] gpiolib: Pass bitmaps, not integer arrays, to get/set array To: Janusz Krzysztofik Cc: Jonathan Corbet , Miguel Ojeda Sandonis , Peter Korsgaard , Peter Rosin , Ulf Hansson , Andrew Lunn , Florian Fainelli , "David S. Miller" , Dominik Brodowski , Greg KH , kishon@ti.com, Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald , Jiri Slaby , Willy Tarreau , Geert Uytterhoeven , linux-doc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-mmc , netdev , linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-serial@vger.kernel.org, "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 29, 2018 at 10:48 PM Janusz Krzysztofik wrote: So it's no secret that I strongly fancy this patch set. What would be great at this point is to have some people test that the drivers still work as expected, even better if they can do some benchmarking. > - values[PIN_DATA0 + i] = !!(val & BIT(i)); > - values[PIN_CTRL_RS] = rs; > + value_bitmap[0] = val; > + __assign_bit(PIN_CTRL_RS, value_bitmap, rs); > n = 9; > if (hd->pins[PIN_CTRL_RW]) { > - values[PIN_CTRL_RW] = 0; > + __clear_bit(PIN_CTRL_RW, value_bitmap); This seems fine to me, but I understand the comment that the code becomes harder to read. I think part of it is those __assign_bit() and __clear_bit() with the double-underscore of unclear meaning. The meaning is "non atomic" IIRC, so maybe I should move forward with my plan to send a sed script to Torvalds just renaming all of those to something sane in the next merge window. Like __assign_bit() -> assign_bit_nonatomic() Yours, Linus Walleij