From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D93BC4CEC6 for ; Thu, 12 Sep 2019 13:47:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 374702075C for ; Thu, 12 Sep 2019 13:47:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="RIBV709G"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JSBEkRcK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 374702075C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Pd9/LTqIEKX6Bh67Jg3BfUL6pN/DNhCuddkSB6luHP8=; b=RIBV709G8LGJT/ FIoRjvj6wKMcSP1RjsGNdmUXZIXZjHo0CKAG8zAECiMqQigxjvt9687AES0gnn13eat5s9aIMpyA0 YUIWiTIw4eq+gBn/wnc7XlMaEGVzHv0F8p7IQlJnwRVrz5mryzruzx5MtpXUxH8W+7cT0vpcTghFT wUY0jS+dlC18ZxJsBdW/JdS7qf6Dw+nmGTG3wvlylrJGaZJjAmVCm3FWQqJY3Calb0NdPkPEji+lZ QlrNs2b/b78rQX966MWRK5YkTdabWsceXpogi5imIkteLbxGXkMOUUQi2b9r0thVrAg+R0G5FP6CT sLMcVpZ/6X5eCyVH9Q2A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1i8PRC-0002lF-HQ; Thu, 12 Sep 2019 13:47:06 +0000 Received: from mail-lf1-x142.google.com ([2a00:1450:4864:20::142]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1i8PQu-0002X8-MP for linux-arm-kernel@lists.infradead.org; Thu, 12 Sep 2019 13:46:50 +0000 Received: by mail-lf1-x142.google.com with SMTP id w6so19439397lfl.2 for ; Thu, 12 Sep 2019 06:46:46 -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=IxAIHy7z7OjGzOcJLm7mV4i2e9Ufg5GWnfAL1EPdhuw=; b=JSBEkRcKpYsmirXMw0E6Xl530d2wdWrDWdOAI/GZtFqrGL028ZnO8g40fXoK8DLbKa iyJU/QeL+1kC957ltdQS8KLIjp3aKCBP+W4d6WmLXsUxZouOgMoapIgv2URetNzS/6nj eFHPABwGjSut9Ntg4wjUCs7HFTqx0iWn6+9IAzUPHez7JBtR1uVAGRq55GpFKIMSOAyA rr7djmdcaZuAQKkTX9Fc4+9pkM2bVBukkM28UGAzm6bEN7DqOf7Z3bDl2j4PQl7hBVAe c2yvHF4tVxjSluiXZkAohO5iDBA3ovZ7oSzBiMa/9b0Fz+ccMdmfGVjtGpnDdn5JCaR1 l6pA== 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=IxAIHy7z7OjGzOcJLm7mV4i2e9Ufg5GWnfAL1EPdhuw=; b=hEg9yiwxtXIo6mXyGvpxNCmC2x8KlyWLRJn6ewV0phmFeXyihGRnPoN6svq0CqLuY6 GMhkiSvlZofIkTKNChK6FqEvPSr3FSe5jgN3Vs8dAAQPf9dhndnabX0EZXCCcX+sD0Dh NnSCPvovts/ZAmnxJQH1hDUg3S+wYB634STyt2Plv8AUmlB55IpCBx0hZhKsbjTj7h6S iGZoYVFZwVlPtcOWyIboclLE/YSyWxA+1mFsL1Nv2oC0WcJ0713dmKmYzHs9mbxvE+TI NR7xQn/GCZ8WayR2AUkZ/8bHja0TXKeeuIhZm47l5nqzJleQiMbnBaG26GtRiaS8bvYP zujQ== X-Gm-Message-State: APjAAAVqL3XMgSQdbn1LcMDOgFjP03tT5riSoi3st8oF8kqugWGRvIw7 lkF7XuaC+Fw/lfVkdb67VUWbUslmzeJUXjp8uub5/BAvYOxK4w== X-Google-Smtp-Source: APXvYqxBQEhNgGyrV+aGEpNgiBh8jz3FwkP2/RjoOFz3uVnJ32fi19wRByEekPgtqxUvCFvqs36MWCHffuJdV5KoIcM= X-Received: by 2002:ac2:530e:: with SMTP id c14mr1145645lfh.165.1568296005240; Thu, 12 Sep 2019 06:46:45 -0700 (PDT) MIME-Version: 1.0 References: <20190905141304.22005-1-alexandre.belloni@bootlin.com> <20190911091101.GC21254@piout.net> In-Reply-To: <20190911091101.GC21254@piout.net> From: Linus Walleij Date: Thu, 12 Sep 2019 14:46:32 +0100 Message-ID: Subject: Re: [PATCH] pinctrl: at91-pio4: implement .get_multiple and .set_multiple To: Alexandre Belloni X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190912_064648_734939_FA45EB77 X-CRM114-Status: GOOD ( 14.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:GPIO SUBSYSTEM" , Ludovic Desroches , Linux ARM , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 11, 2019 at 10:11 AM Alexandre Belloni wrote: > On 11/09/2019 01:27:10+0100, Linus Walleij wrote: > > > +#if ATMEL_PIO_NPINS_PER_BANK != BITS_PER_LONG > > > > Should it not be > rather than != ? > > Realistically, the only case that could happen would be > ATMEL_PIO_NPINS_PER_BANK == 32 and BITS_PER_LONG ==64. so I would go for > ATMEL_PIO_NPINS_PER_BANK < BITS_PER_LONG OK I see. > > > + 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. > > I don't think we have multiplatform kernels that run both in 32 and 64 > bits. I don't believe ATMEL_PIO_NPINS_PER_BANK will ever change, it has > been 32 on all the atmel SoCs since 2001. So there is a bit missing from the commit message: the info that the same driver is being used on 32 and 64 bit builds, and that is the reason we allow compile-time ifdef things. Can you add this to the commit message, or maybe inline in the code, or both? It confused me so it will confuse others. Yours, Linus Walleij _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel