Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp217586ybe; Tue, 10 Sep 2019 17:29:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9tUREQwuGuGRKZxYseuA3s5rSDPxHlfDVT0I8Qcf8lghWhq45H6KyTag7bFPwgt7FdIEZ X-Received: by 2002:a50:c90c:: with SMTP id o12mr17507531edh.126.1568161799238; Tue, 10 Sep 2019 17:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568161799; cv=none; d=google.com; s=arc-20160816; b=SZvgC7h93+FiDiena0+uMzsKebIG89lq3wnOhUbFLIEGiFXarmShbuI8rFML8eG3i5 7n+R2ek4BJCNAR288GEALN9XH72o5JMYghOXjojHTLXpoCiTToBt+3fmzxToHKHh/g24 N6PtE9AQ2YfT6RxtM3BXwuhEFFQQCPMh1gfapVQ0S9ztI3qqw9jOhdoux1NkcLk2Txnl doOdFTUrnX9JJZnS2WHVnigvy4+OlgDVg572w5VWaVT5gEfhqAoIWq5tgpPmeLH3Dby4 J+ClDIfPneuGlan2IxgnCh63biH2ERNQjNjtTor27Zsn/u1LxIO2nyUalttRoNHYQIOs Rlcg== 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; bh=WajEOxLInLugBAoDBpA/UZhycoI/rEzq/XTRSPCwG6E=; b=Qz/96OsiL4MaV2sw3m7fHfI4YzTJ3SqMdL65yQNCs7cGLk8u3kH2knA6sRHafNyQqY rD6LWhPzG+nXq19y92qsSdakBQJL4jIgG259acSK5UBi9RNr6rgq0BmD4mTAXNF7p2Io 4gSOS7O/QaN6Ap98SI2q886RovoEhCxGyYeMjEnj7RUOuZPU2GIOAWGt6cKTkhxQ9B6N zvvalNIo4mi2fvDOyfDzAnwVdZh9G47/L8s+6450pv2LCCyOg3LPrUZt0D2ipEfh4G6e H/joX2wKKfxUhSqpApAsL2jnyBU9f/PD5nIaa2PluiUIfmBxpFZDMJ8nNEmtvrpSe6Rr zGww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EzMngyN8; 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 z23si10269996eja.368.2019.09.10.17.29.35; Tue, 10 Sep 2019 17:29:59 -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=EzMngyN8; 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 S1726491AbfIKA1Z (ORCPT + 99 others); Tue, 10 Sep 2019 20:27:25 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:40573 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726126AbfIKA1Z (ORCPT ); Tue, 10 Sep 2019 20:27:25 -0400 Received: by mail-lf1-f65.google.com with SMTP id w18so3035960lfk.7 for ; Tue, 10 Sep 2019 17:27:22 -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=WajEOxLInLugBAoDBpA/UZhycoI/rEzq/XTRSPCwG6E=; b=EzMngyN8/VFtydsD0WIWfF50NQaPkM2eq8VQZ1+mbgQSlXsfBVGI+7MkTEJzrMepjE N5dzp3wn51b/B2O+rrJbqNGUKq5JuOmTT6211sd23WXSiR3zd2dGAm9f8pa0q1IGg2IK 7UUdZYscZWrzG/He/DIZfQEpeLTSwcEo3eedfyMyU6cEaPIfRhxowWNF6pc2dPeVa5X5 v3AHcOmN5viENhp+J71IZD/ZGQXMj0xOiHP+s7iSQW7MdcXBb3q+PaJlOw5FzNIHbjK7 mYXUmu9PfI0jRJ5VcJqvushgAmgG0XP8z+66xHsDuZzkpejBCpjVGlQGBPgYhkvRR1n8 BBEg== 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=WajEOxLInLugBAoDBpA/UZhycoI/rEzq/XTRSPCwG6E=; b=kNkhd4Yix95aHdtQ9TN8OZrHpKlsfsVOacQkGmDyALQHwyuEkj0/JOkYJ4bRtmq6bI d7wBVO+tnPSomm9vG5gxTyNVhIuNo3UmeFA8djlM3yOmLd8qDcemTSsgi3g7qldvstzD V7/Y2P97bvhnuHt3n32eJAOewU8jDzuna9iiE339nNxmuc35VYk41V2ZSjj4HgqrAbkf 42DWeXmzszeKybfJE9QciBt6lQl+Auu0z9ys97u13GxNi2t56qjFTbsSCM55Z5YScX7Q J9OJvKtVx+QXhi5GcV2fkxfXi72r+PrjV/AlvBX/73IdabLQmEl3dOoED3rF/a/8b3R8 VBcA== X-Gm-Message-State: APjAAAVt72P4ppljpKdHI7CqqTwouPPQu85BerccBZQeIsHSfWHETwMS 1AkM8dYf949aNJmzcSkd6dUdJ/3SUR8g0IRxHkkWQA== X-Received: by 2002:a19:14f:: with SMTP id 76mr21572482lfb.92.1568161641802; Tue, 10 Sep 2019 17:27:21 -0700 (PDT) MIME-Version: 1.0 References: <20190905141304.22005-1-alexandre.belloni@bootlin.com> In-Reply-To: <20190905141304.22005-1-alexandre.belloni@bootlin.com> From: Linus Walleij Date: Wed, 11 Sep 2019 01:27:10 +0100 Message-ID: Subject: Re: [PATCH] pinctrl: at91-pio4: implement .get_multiple and .set_multiple To: Alexandre Belloni Cc: Ludovic Desroches , Nicolas Ferre , "open list:GPIO SUBSYSTEM" , Linux ARM , "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 Thu, Sep 5, 2019 at 3:13 PM Alexandre Belloni wrote: > > Implement .get_multiple and .set_multiple to allow reading or setting > multiple pins simultaneously. Pins in the same bank will all be switched at > the same time, improving synchronization and performances. > > Signed-off-by: Alexandre Belloni Good initiative! > + for (bank = 0; bank < atmel_pioctrl->nbanks; bank++) {> + unsigned int word = bank; > + unsigned int offset = 0; > + unsigned int reg; > + > +#if ATMEL_PIO_NPINS_PER_BANK != BITS_PER_LONG Should it not be > rather than != ? > + word = BIT_WORD(bank * ATMEL_PIO_NPINS_PER_BANK); > + offset = bank * ATMEL_PIO_NPINS_PER_BANK % BITS_PER_LONG; > +#endif This doesn't look good for multiplatform kernels. We need to get rid of any compiletime constants like this. Not your fault I suppose it is already there, but this really need to be fixed. Any ideas? Yours, Linus Walleij