Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3696864imw; Mon, 11 Jul 2022 13:56:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vLFnTzOBL/RipsPKlpmW8mNr9mUH8Gh47wOU1zW4cYFpFEqQ4JncOs/7+9Me52ezG3MSQr X-Received: by 2002:a05:6a00:1308:b0:528:2ed8:7e3d with SMTP id j8-20020a056a00130800b005282ed87e3dmr20466973pfu.82.1657572978059; Mon, 11 Jul 2022 13:56:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657572978; cv=none; d=google.com; s=arc-20160816; b=gBcDB+I/rSNapTLrWiYua81e6voEb/qKvuL64RoF8W6dsa0rSZfvc8RqjoYlOdg0s8 VE1kTAxai4MeimtsR4AelGAAWWbPCYXL1RdxerGKAKMLcBQx4N9akvb/C3LD5t/gAYVO hpxVAyizXvhvuyCeFdhB1eZ8zHSQNQR9wvzoI447LgJFP151JdHizlJKXjEY0XdXcQrP kPdEtZySPdyyGXnZo1ibeSbS0kRaJHqTBsrH5D8dLzEV1NACxG0trOft3036GkMGWHgc wFSfdnYeMrsSE2bulNl3Xvrg5fbGn0B/As16Mf4IG1UHyPCmRrkK+KEHMM0ZPb/bB6nT 6+iw== 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=ShzjEhLEe0k5FQ6GyMvo3z3FN/ZLOq7ZYOFzyB6kD20=; b=v2ykgE25hEigo6bmXQW+lrJwxHHM5zL+XmMVRbCBDM5tv+CEOgiVm5ZP0tHQDJkw85 PKEzZRZ3LUhbu+L66cWP8rkvXcXqf04P4aZcie+NVDy3Qjsyjs9GAMTSBfIEcwbNt+EZ SjhUg5xw5YD3bLTJpI+MT1j054l8bM7nOaARmUbZKU3VuEH7W7bDEj/KqvBZefRnmHfx DTca5H8wkgClWUWNz/8QlSUGRCM7FZrs1JPM0Aq6SUfxReEEEj9FLYoScyDncEXQ2D07 08Y1jzDn7zbXOg1EK9n6oLyi9wqJz+W1BrDIPddHXfhLkM8XNspGYzNB3uBvDAvIwIgL 3hNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oIo3c7K7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f23-20020a656297000000b00415bb65d706si10726163pgv.748.2022.07.11.13.56.05; Mon, 11 Jul 2022 13:56:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oIo3c7K7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230306AbiGKUb5 (ORCPT + 99 others); Mon, 11 Jul 2022 16:31:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232050AbiGKUbg (ORCPT ); Mon, 11 Jul 2022 16:31:36 -0400 Received: from mail-yb1-xb2f.google.com (mail-yb1-xb2f.google.com [IPv6:2607:f8b0:4864:20::b2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E92F087354; Mon, 11 Jul 2022 13:29:50 -0700 (PDT) Received: by mail-yb1-xb2f.google.com with SMTP id f73so10592333yba.10; Mon, 11 Jul 2022 13:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ShzjEhLEe0k5FQ6GyMvo3z3FN/ZLOq7ZYOFzyB6kD20=; b=oIo3c7K7sfGKtX+P9CqNGT20A9gc1caPNVU/ahHOcNlb7iyuOBDC7JAr8+TGCGyYgF +2YWKr+UAr+2VNTEdOp0E5ijfyM0Svlzt90iUxi5A3IZReUU+VvaOKc4dZfmzWutTtXW BUCJ9j/z4c6RgwfbWluszvZ0+sxeG+8KglLi/ZYVTNPxbQDgvpCisDbvQflmgKVXmKYa 9WKuXWr7jmVCIjbYRRyb2Vok/JDbMHK4EBPOOcm/+WBbhBXpDqqAD+tGz46P+hklk9Pk GERqz9JVe1+01jjuv/hgK/sgmqPZRgZLu1mrMFMGE84OvfIbvDOcLJFL2IBEfuqA/40B f7nA== 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=ShzjEhLEe0k5FQ6GyMvo3z3FN/ZLOq7ZYOFzyB6kD20=; b=UooUyLCg/Cl5vphGNNxj/XlOJUn5ScuQBj0skcVA01KvG8qWXeFficcSd5Lk5vvzqn r3N7iA5MqSPxQO7YSMSRuZrOErtgMGOrwy7SMcAtVgYUCahQNxZ6qzEY7LmSznnGhaG0 uXQ/UJOuQTi9t5pNlCwLRBFU74d8n5VAyJGSgkUqMc+XqlsDf45XaDytJZwp+EMLpfV9 3C+QHop5k6ATu73ciJIi6ci1Kjwcq7mME/hjz0kLetGPHWifxozTyKLES4y8C+ccElgj 9swVCOekaLhNeWYkYHIRI0kHqHtW2+vSR0oq0byeRu4oQV5Gl4X1T2TFrhsreNtnuVPm Aftg== X-Gm-Message-State: AJIora9hSiOfNNgTpKUCn2M300crCjBTDcEOoGMdnd+H+fE8TxkKka9d gWNQWpjaDXF0WanlK2ZQYfjvrUvFFQGK83Uu5j4= X-Received: by 2002:a05:6902:1143:b0:66e:eb08:4c23 with SMTP id p3-20020a056902114300b0066eeb084c23mr13624745ybu.570.1657571390165; Mon, 11 Jul 2022 13:29:50 -0700 (PDT) MIME-Version: 1.0 References: <20220711192113.3522664-1-horatiu.vultur@microchip.com> <20220711192113.3522664-3-horatiu.vultur@microchip.com> <20220711202646.om65vrksyifvkfkw@soft-dev3-1.localhost> In-Reply-To: <20220711202646.om65vrksyifvkfkw@soft-dev3-1.localhost> From: Andy Shevchenko Date: Mon, 11 Jul 2022 22:29:13 +0200 Message-ID: Subject: Re: [PATCH v3 2/2] pinctrl: ocelot: Fix pincfg To: Horatiu Vultur Cc: "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List , Linus Walleij , kavyasree.kotagiri@microchip.com, Alexandre Belloni , Colin Foster , Microchip Linux Driver Support , Maxime Chevallier , Michael Walle Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 11, 2022 at 10:23 PM Horatiu Vultur wrote: > > The 07/11/2022 21:51, Andy Shevchenko wrote: > > > > On Mon, Jul 11, 2022 at 9:17 PM Horatiu Vultur > > wrote: > > > > > > The blamed commit changed to use regmaps instead of __iomem. But it > > > didn't update the register offsets to be at word offset, so it uses byte > > > offset. > > > Another issue with the same commit is that it has a limit of 32 registers > > > which is incorrect. The sparx5 has 64 while lan966x has 77. > > > > ... > > > > > -static struct regmap *ocelot_pinctrl_create_pincfg(struct platform_device *pdev) > > > +static struct regmap *ocelot_pinctrl_create_pincfg(struct ocelot_pinctrl *info, > > > + struct platform_device *pdev) > > > > const? > > > > And I would leave pdev to be the first parameter, if there are no > > other functions that have them like this. > > I will do that in the next version. > Just for my understanding/knowledge why is this desire to have const or > to keep the const? For non-POD types it's a good coding practice to reduce surface of attack, if any (the data will be located in the pages with RO flag set, and attempt to write will give you a page fault or other exception, it depends on architecture). Also a common sense, if you don't change data (which is actually initial configuration or so), then why shouldn't you use const? Note, in cases when it's not initial data, but runtime stuff (like really run time), const is obviously either can't or not needed to be used. -- With Best Regards, Andy Shevchenko