From patchwork Wed Apr 12 12:47:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 82464 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp306995vqo; Wed, 12 Apr 2023 06:03:00 -0700 (PDT) X-Google-Smtp-Source: AKy350YtJDbZkah4lopPHNv2C98d7o9n1trlXmq4zSdJqpg7bkNsYklhK7xtzt7h9+eIT26FRE7W X-Received: by 2002:a17:90a:4b4a:b0:23d:3698:8ed3 with SMTP id o10-20020a17090a4b4a00b0023d36988ed3mr2496988pjl.22.1681304579882; Wed, 12 Apr 2023 06:02:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681304579; cv=pass; d=google.com; s=arc-20160816; b=LexTcus8mYsS74StgOf0xyP1Fc8jPbY7I9K+XVZoUudcHcKdtOZEyB0t4mp5jSJ0ub CHmclb4vjpR12UoaEglGyw5J348910nXmMrMVN5FSa3BKf/fw8Pi4WsQLIbAF2cYd/Pk gmZjKdrfkN5Tk4MlBxDoKXReXpUBiUjumxr8Nw0DuKqSvvHomTPe2HPFD3KDcFnI0AWM BE3N2U+P2M3aSkwi0+Yoz+KABjpJzzl6nbvj0VIXiWxO1dGEYElxxGuCIqgPhKgrM+9F fPCoZe7Pi2OE1tBPekaxAbyvDPP4JUZBWww7G3h/ynsx9sfHuMgc9iuZcLIks4G9LQka XJzA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TS/rSogzg/Yo2bKWcqE9w9nBxu5/lORMaffud/S49gM=; b=kS10ATJDBvWqIwyzjYZ1zYKH2aqy+CqwVO66YF/2MDDvi05d6JR5MqPRDBVO9P3jia P4+BaMCZfd1rVlgF6hVyDYr8jyYFL6ELDgrchxA2Xmh90eldqPUfGHPAA+YmsXqvheuP LI7yfZGuJkVrjq878MVFzU37Lt3xV/rvquqpq1mS5J9XzRI90yGGiDJRoJifRP8lWolD tkAFkheIcrAUC+n1FoqU3ZWmzvouR3Vggcsf+iqzts6rNt8U8U3ApRhEEg91MWmLz7yj z1GSx0jT0WH0YsXXh69+Hus59Hi0e7PbIk+czmAzoRlkv60z2MHdtMYOkMVaZ0LzaoYy EDig== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Xo3gjmJb; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r15-20020a63440f000000b0051b28ed8e0asi2666221pga.540.2023.04.12.06.02.47; Wed, 12 Apr 2023 06:02:59 -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=@nxp.com header.s=selector2 header.b=Xo3gjmJb; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229862AbjDLMth (ORCPT + 99 others); Wed, 12 Apr 2023 08:49:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229916AbjDLMt1 (ORCPT ); Wed, 12 Apr 2023 08:49:27 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2071.outbound.protection.outlook.com [40.107.22.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75504A247; Wed, 12 Apr 2023 05:48:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oZmHlne/1AMHZTzSZ3wWq/3WPWcBbEp7zqtMWt8gIu3UvP6i55TFU7z4Khc8pxvi/lX84kxlKThDR1LVGMSMflzBkIcDYGgCDnCiozTH0ZBciaeAN27gmjpBTkEAOc8SdinfSSgp9KODGifsY37lUkb9z56U7cngVfxFvudBeGy5lIsPIpDkFyTtWONjFuwTe4ZFL0dYZiuLP2A2PDolhS5IHE9GnW2S+eMoaYsEoURNcKQrIgN+92iuh83RPyljeZKDkjaWYyBYolWqK8ddkBpwfWdGYXOhvCvxO/P3N5FmT/d9Qc+2mSu8qPjaZiOB+19T1VFJf06FgHoh8/Xcaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TS/rSogzg/Yo2bKWcqE9w9nBxu5/lORMaffud/S49gM=; b=E5/V+MZukHaiimv7oH7gmK6a/s0E17NlGcEl64kv/Oc/tzgITWIFn4f0Z29zegRJDV2i38TBS4v3urVWS6sMR/miTv5HcLbKapj3ryhdFT9gvxaAhmAz/HG8enrwuf7sfnyy43KP/0I+PgwlCvbBlpRgXD9pcx57OcWysM7HlpuOV7UIaUEVSQ29XxuMS6ibRyyl8Sz5jdqR7W98YxxLBsqvQ/o0Gik9R9Mve67ImhfJlPLKUJ59mLGp5rde5aJFUU+QFfDb/ilX03QV8nBbPOvji9MM/E8DbAaqdsGItcaPYO8Un+95Ozif8jRZ11Q+ygnq/Lk916CYUJkCz+jpbQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TS/rSogzg/Yo2bKWcqE9w9nBxu5/lORMaffud/S49gM=; b=Xo3gjmJbB5JaPV02+o2AHV3fTddDh2iRkxd57m10cMBKDzCZ81xseP0ICG11sKj4u4ioTqhlMJuY3h0wVSssayzeSOejgUrWJYJjDJmTC4UIjZA1la9zFukuv9jBgnaoxXlZlMiKbgfS2rybtBPYyQIjY7B7gi/T5vEoRyveCbM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM7PR04MB6888.eurprd04.prod.outlook.com (2603:10a6:20b:107::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Wed, 12 Apr 2023 12:47:53 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Wed, 12 Apr 2023 12:47:53 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/8] net: mscc: ocelot: strengthen type of "u32 reg" in I/O accessors Date: Wed, 12 Apr 2023 15:47:30 +0300 Message-Id: <20230412124737.2243527-2-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230412124737.2243527-1-vladimir.oltean@nxp.com> References: <20230412124737.2243527-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:800:5f::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM7PR04MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f545d4f-2964-4339-9159-08db3b54218a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QcHQw5o2+uT+Jtm13MuvVHyurbhGED/+yTtSo/zrOTYmua6HZW1dNPLGfsCvzerby/pQrKZ0UsgYlp2eFfSr7WNS2io2Y63DFhjyzd8jC4aNufaECm7GNZUH4zvffdbQnNYe65Kgl0GRvGYewcY9nwHRRAE4WK4FP9ZRYixtsfi9up87BQh34IIJJg6YUSuZgiW/qFzfdYgtDgx0fr6fMorYX72yZC4nNT3OVI8i01v/fy47X0/tl7uZf2hC3gSXISKT/A/RzAysKOk1Ki/gG2JDSkmjAe69Yo6gv8d2hJu6n9csnzL1WTa2Rg4yE/qRtkyrWqbAK3CkSK5sNRDTjqOH/UQNXpKcIX2xIVCnrUIEGs14ZXxZ3G/PbIzgIVrFr5+5JJR2WgDItEltocBhJvoJtJTwPpLycMrcPBXjicIZXfc/ztmyBnp+Nc/EzsCi9LOk7lfmVCILbRaXUuLDRFkFge0REIav1NWVl9cZ/oVi4EWBpgp4NEQPheDX+2xVafI6byXg7CxHZdjLPSCkSsuH0LnAD+58tg7NkKeSeUpqOd4kfJmGH1AK0bvgtKVr1UOAyCCcB2OC80UTqgtwwWRpBrVCcgXVYuuBZhpLGyzJBA3vORohssAMjoOGRT1Ja5f9kVjkHb8lmh3Vt+vOjQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(478600001)(52116002)(86362001)(83380400001)(6512007)(36756003)(38350700002)(2616005)(38100700002)(316002)(2906002)(1076003)(6506007)(26005)(54906003)(44832011)(186003)(5660300002)(66476007)(6486002)(6666004)(6916009)(8936002)(66556008)(41300700001)(8676002)(7416002)(66946007)(4326008)(461764006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: USUQaetkCJgbivOyoInY1K5sK05tmLp++lKE9xREVPxUUw/6hQCRNUvksmpnMYWaWSYVnkwCG37cbnuDVeuzK1Sclwh37oWhLF2Wmw5Z4LFc9oNlrxXK+OoNdwKK2R//84ChXJNXC5NMH5NO90VDS7oGaEZVCCwwsUUe5Ed+dyd3hHaQXrxMM9LsF9ZMqSNDrYLCWQ6jkXKNEybn2D60zVBUQuhGEY5Yn2htCDeG2NHJaIqFq/ipw73FEkPisRil1DMsOjDDdu9uWp1KBizfBXi1dNayNUWcke8W+TtwJiVlDfHaFhhWv3/Uf+T479c2Kh1z5s5iYS4VdmtInPJAh8ecJZwoekyIMP2fC+0DMXsynZWfUSBOimBuTwfPErR6HVNaUDl0s5FOQZVDJ+4S2oGL2M6Z1TCgDvJgXhB3Zx65HLGhKQZyI+lB5MoMCEOH5VAqW87XTNp2+qePCg6PmxSyhVj8kSXdnVGj+85JoBXd71neRyXVHJq1s7F0lDVyHu0s8dHjhfaXpUzskPbpHU6mK8TypZcRpgKfjALiLLkywNPIJ9nadl4f9DwttbEHzF07Hxd8aG0MFzVWPjfJSI1N40SEaKgbHJQ4sJBDAWLbjHuYJBhcfaPmcchnMCA2LhsP5H584zpOssRb9kIUKZGu8BH96OYqF09mOBNxJlye3yI8dYlena3WHlE4AIRp4n3saUfxHM0fX6g0ebpZFdHttobFqDeBar4nhV5s/PL+QtmOJ3kJ9xJsVRNIXq2WRB2954lRqQXz5YjtCiiG2aThahmYWnmyR1J7OGkV/MMJwRk3ZTwwEQHF6GZDcc3ten9n3mTjR5H1eRGlHrU6Z0EpyrjNf5j5yEoYYVRDJpum5a7X6KXiyjS8pYuESllils6/y3XyN9V7gu2CQ1C3li09rzBEiql8EEcUcyiLlwjoL03xIWP2Vl8u8tLg/kSB4CKBVUcV7KVtWHyjci+GOtuNnvqZxfvT+guTLIsOpetqxBgIg9TGIeGX5cK/eMeXeOedW2iVTgsxDbwM+pc8FvPl9LhiIJEZxx2+9E6RoYTh6P3Cl/JcX9HCwdrZs3R5RHy3C9AUxGkfBTKYtYCqdBkCUgW4LQI0GChy1IpdGXd9aaSoi0MT78UvmWhcNFIKWjzd834J5gXwBVO4eSIIvpLgmCX7N359adnW/eFt6XgJPjSajZDZtJ/DIYkKYBadRfrUuq4MCRaQdAa5JCw60RhfB4Ey67ghOfkJivjoOpUgmxHKBlL/n6kOh/pYEE/TjpIUKQkFLq6Cdeb6A2yrYSpb11bhcBqjrWy5b6y9+urLYycZXJ8vvQpb9OsTmN1xX0uNaeCZDyvRRSQW7ZJ+MvBDEioXCsqYFkbjr2puFyE4Xwvqal6MrTIJrLUYU5Wf+dklXw70TqA6lA0RIaoR/NUjB2Ej3Bu8UFEZNaDVThhk/kO5I3Os1MjsYJFB8FWcTJ8MBfhMaqyXumcWsSiGWE8sLUsCkR4lE3Lj1FyjaMf7clIxxilPf7m9y8NSM6N94t3yvLhZgi64gyQSEihMQWH4GygLAThuZ2pxBxAAVGjTGWGKCM6DFM6+EJrRsuSGSg+uHSyesNTKwRDkV+eMiA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f545d4f-2964-4339-9159-08db3b54218a X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 12:47:53.1569 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uEm4a/peCv2KgroxUafTczSrn5DTXOeOvB+xd/nTw4UwjJZtNEGXIYYo9LlY6DkxSpom6YuQfwtSVBlKbF9/Cg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6888 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762975630936841210?= X-GMAIL-MSGID: =?utf-8?q?1762975630936841210?= The "u32 reg" argument that is passed to these functions is not a plain address, but rather a driver-specific encoding of another enum ocelot_target target in the upper bits, and an index into the u32 ocelot->map[target][] array in the lower bits. That encoded value takes the type "enum ocelot_reg" and is what is passed to these I/O functions, so let's actually use that to prevent type confusion. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- drivers/net/ethernet/mscc/ocelot_io.c | 20 +++++++++++--------- include/soc/mscc/ocelot.h | 20 +++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_io.c b/drivers/net/ethernet/mscc/ocelot_io.c index 2067382d0ee1..ddb96f32830d 100644 --- a/drivers/net/ethernet/mscc/ocelot_io.c +++ b/drivers/net/ethernet/mscc/ocelot_io.c @@ -10,8 +10,8 @@ #include "ocelot.h" -int __ocelot_bulk_read_ix(struct ocelot *ocelot, u32 reg, u32 offset, void *buf, - int count) +int __ocelot_bulk_read_ix(struct ocelot *ocelot, enum ocelot_reg reg, + u32 offset, void *buf, int count) { u16 target = reg >> TARGET_OFFSET; @@ -23,7 +23,7 @@ int __ocelot_bulk_read_ix(struct ocelot *ocelot, u32 reg, u32 offset, void *buf, } EXPORT_SYMBOL_GPL(__ocelot_bulk_read_ix); -u32 __ocelot_read_ix(struct ocelot *ocelot, u32 reg, u32 offset) +u32 __ocelot_read_ix(struct ocelot *ocelot, enum ocelot_reg reg, u32 offset) { u16 target = reg >> TARGET_OFFSET; u32 val; @@ -36,7 +36,8 @@ u32 __ocelot_read_ix(struct ocelot *ocelot, u32 reg, u32 offset) } EXPORT_SYMBOL_GPL(__ocelot_read_ix); -void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset) +void __ocelot_write_ix(struct ocelot *ocelot, u32 val, enum ocelot_reg reg, + u32 offset) { u16 target = reg >> TARGET_OFFSET; @@ -47,8 +48,8 @@ void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset) } EXPORT_SYMBOL_GPL(__ocelot_write_ix); -void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg, - u32 offset) +void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, + enum ocelot_reg reg, u32 offset) { u16 target = reg >> TARGET_OFFSET; @@ -60,7 +61,7 @@ void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg, } EXPORT_SYMBOL_GPL(__ocelot_rmw_ix); -u32 ocelot_port_readl(struct ocelot_port *port, u32 reg) +u32 ocelot_port_readl(struct ocelot_port *port, enum ocelot_reg reg) { struct ocelot *ocelot = port->ocelot; u16 target = reg >> TARGET_OFFSET; @@ -73,7 +74,7 @@ u32 ocelot_port_readl(struct ocelot_port *port, u32 reg) } EXPORT_SYMBOL_GPL(ocelot_port_readl); -void ocelot_port_writel(struct ocelot_port *port, u32 val, u32 reg) +void ocelot_port_writel(struct ocelot_port *port, u32 val, enum ocelot_reg reg) { struct ocelot *ocelot = port->ocelot; u16 target = reg >> TARGET_OFFSET; @@ -84,7 +85,8 @@ void ocelot_port_writel(struct ocelot_port *port, u32 val, u32 reg) } EXPORT_SYMBOL_GPL(ocelot_port_writel); -void ocelot_port_rmwl(struct ocelot_port *port, u32 val, u32 mask, u32 reg) +void ocelot_port_rmwl(struct ocelot_port *port, u32 val, u32 mask, + enum ocelot_reg reg) { u32 cur = ocelot_port_readl(port, reg); diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h index c0e40ceba50c..85505ac5e63e 100644 --- a/include/soc/mscc/ocelot.h +++ b/include/soc/mscc/ocelot.h @@ -943,15 +943,17 @@ struct ocelot_policer { __ocelot_target_write_ix(ocelot, target, val, reg, 0) /* I/O */ -u32 ocelot_port_readl(struct ocelot_port *port, u32 reg); -void ocelot_port_writel(struct ocelot_port *port, u32 val, u32 reg); -void ocelot_port_rmwl(struct ocelot_port *port, u32 val, u32 mask, u32 reg); -int __ocelot_bulk_read_ix(struct ocelot *ocelot, u32 reg, u32 offset, void *buf, - int count); -u32 __ocelot_read_ix(struct ocelot *ocelot, u32 reg, u32 offset); -void __ocelot_write_ix(struct ocelot *ocelot, u32 val, u32 reg, u32 offset); -void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, u32 reg, - u32 offset); +u32 ocelot_port_readl(struct ocelot_port *port, enum ocelot_reg reg); +void ocelot_port_writel(struct ocelot_port *port, u32 val, enum ocelot_reg reg); +void ocelot_port_rmwl(struct ocelot_port *port, u32 val, u32 mask, + enum ocelot_reg reg); +int __ocelot_bulk_read_ix(struct ocelot *ocelot, enum ocelot_reg reg, + u32 offset, void *buf, int count); +u32 __ocelot_read_ix(struct ocelot *ocelot, enum ocelot_reg reg, u32 offset); +void __ocelot_write_ix(struct ocelot *ocelot, u32 val, enum ocelot_reg reg, + u32 offset); +void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, + enum ocelot_reg reg, u32 offset); u32 __ocelot_target_read_ix(struct ocelot *ocelot, enum ocelot_target target, u32 reg, u32 offset); void __ocelot_target_write_ix(struct ocelot *ocelot, enum ocelot_target target, From patchwork Wed Apr 12 12:47:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 82468 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp308922vqo; Wed, 12 Apr 2023 06:05:06 -0700 (PDT) X-Google-Smtp-Source: AKy350bgS+aTS4BwId+E1NdjNwD+GWa9/aK4asfXANxhzmogVVigdhEHY4LU4NK3EaPcWBmH89lU X-Received: by 2002:a17:902:e549:b0:19a:f9b5:2f2f with SMTP id n9-20020a170902e54900b0019af9b52f2fmr22391301plf.55.1681304705980; Wed, 12 Apr 2023 06:05:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681304705; cv=pass; d=google.com; s=arc-20160816; b=f1lOEEUne4PgXFquRc/vu5B8C86wdw112WPbr+tTqJKSaIhyWPxS4S8M3RjRgk5MjM k5wLkp+YEyahTpbgh8v0cL42+DNqX27ed38YLDY05RB4Ro2WcmypfVUCUWcz4yO6EfV7 eg+PvRP5V7412L36c50Z9v2XRo/FDNp/fVOXv3FQtfVAnumezovrjJjYGv2j4LJhfpxo sEijQbxk33ATaBLdorGsBrjr7p2fWRKZcMAQSt3KGH1O0O3QAiCjXWeCL/EePth24yxJ QQYscf++n4hKEVFZN7/FKpjNYnD2kX34vfPo9uk6PN+TgVbE4KQhE7WvOx5PJAl2/Qkb FKaA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9AgmYtTYSgBMTncLhBRsN0OgZSSCzQeGJA13dHgv11c=; b=ODarrPBP2aIqebVpl8cqkeF7N1o9LZ4TEv04NOUI7G2qD/is8bs7EKL1aRPwa9VQ4G rbkTjaSctFBwPIAAUU4EW3vqVmkBE9H5ErEogNevW+uTQPTwh5KomF1dkPh1i4RGFBeS UrD3ezQa00Rx3knC3AvWTC6xMy8HPMmOqsYMy2nJ99Cl5BQ3YCHUvkPnBllhz3jU8+BA jyL5Ar73zegxFy0RCdlsqTNOU/oGRzmwYYC3jc3hkDSshgRrWUhjLwUR/JantIJEb7VJ 2GyAIlCaID2X05Jg4aZ6obHsBFJbhlWu6xWbNWEUYAlHMoQlrmTJwLt4RhGkYQCXfCSK s9ng== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=bBNTvobv; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c12-20020a170902f30c00b001a6567d42a4si4360777ple.478.2023.04.12.06.04.53; Wed, 12 Apr 2023 06:05:05 -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=@nxp.com header.s=selector2 header.b=bBNTvobv; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230201AbjDLMuV (ORCPT + 99 others); Wed, 12 Apr 2023 08:50:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230459AbjDLMtw (ORCPT ); Wed, 12 Apr 2023 08:49:52 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2066.outbound.protection.outlook.com [40.107.22.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F7827ABC; Wed, 12 Apr 2023 05:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mg/5Cw0OW97fxWn3q5KM34ttIuk75YEF+eJZiw+yIRY/wvut0I384ghrut7ayAyNHeYw+auomD6b5sSyrjd9bHOA2uU6cuQLXz1BT+lLd8I/L+1cYLSArw35OL3k3KbKpkGJ3lWKXVDQhttqCUyiUSJGWdrjh5fNqSi5RdYhCuSomzUjdJoyw53j/4RFawXucU/LWXyFu+wc80dGSFo+kkCf5mJBzV9LpYmQc4eGNknK8ISixWQtPDJ0fyNCMti4QnbBP9qYzoUzcgjBr3skQ/3Cz7e/+JDmfJ6947U0LyHTxRgJ+1YlnUbTTFlLeqPSjKquAt2oUWNV+H33Y4LgDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9AgmYtTYSgBMTncLhBRsN0OgZSSCzQeGJA13dHgv11c=; b=f90Y5Zgcaa0OQRfcrM32O1f10dea+vQqNGcvUB4bXar6ZCcP8vmx6VeyV2MKaSnTSLy9nHwQbeU7AnbuGdAY0uNEKhejcOck40bFwyhb7LhNSRVibxhP8jnfyo1hUwhgGckCen29/yJVUeAYUYfO6j2HGj5rbZGYdXIFBIPt4NH3vBzk9dT3IPREBf3lOocJ29GeEm+5BzSTVkjjv1CflqNIBtz+MjBSplKt9eEJtiBPRxnD2dXNo2JTIYvzx8fnNfbcVdJg1iEshPt7AMWDWPtw1L3ZkSJ5kocP74KgVdWRcZl4fMQNRb87gLJ3yCbVFwz34a/o65lx6Wh6Sdt7Zw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9AgmYtTYSgBMTncLhBRsN0OgZSSCzQeGJA13dHgv11c=; b=bBNTvobvBw6Rq3vKvE0Zm/iVaR+xDNJ9U5fd9xca/xPgQOx1EhJDVuRUV2WAe8qM4ho0SHzTbe1tLXkyDjhiZT9LuNR2Em+0HXw8xTtQfhxVxs1VnVcaRUF49mXh6OLY4BPnf2YU89+l4Oh39Rrasp7XoQZzTM3PCQ0MoIMc2/I= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM7PR04MB6888.eurprd04.prod.outlook.com (2603:10a6:20b:107::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Wed, 12 Apr 2023 12:47:54 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Wed, 12 Apr 2023 12:47:54 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , linux-kernel@vger.kernel.org Subject: [PATCH net-next 2/8] net: mscc: ocelot: refactor enum ocelot_reg decoding to helper Date: Wed, 12 Apr 2023 15:47:31 +0300 Message-Id: <20230412124737.2243527-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230412124737.2243527-1-vladimir.oltean@nxp.com> References: <20230412124737.2243527-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:800:5f::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM7PR04MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: b3041181-7461-4462-eac4-08db3b542227 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CPwosvh97F2fWPJOPzsZ5NvqsNE/muYefL56ei2bIhRVX2PPXMZSEG3GdkHkB3Mj1hg9LWmv4wNSOWCb89Z5vZYYpfAhxKS3vDlCg23NH+IoBA5Oq9YlwrGpiwN34ewz8sjs6CbcEhEb9hsYVS2wyL5JCZvMQe4WgVAtIw5lYXzBQj6I6zEA+0Yv9qaXHdkduaMaeFB9xq3WhYe+EtcyYg74uLZH+UfA8TwBeycAZjSsbVp2KPfaD9DSwtRA6IhXjEn2S2gZ1qEo6fIRAiBKfLy+pefTTr6bexlEifu/6qyOr8pSczDoEcyKxDS+utzdeIFVN/pfaTrWDzzpic9RDzVUJRhkF/lPyRFmOXYQQncYIzYjHCKVkHOI1uIFke7yB+0qjK4Ah0Ug3QeqGHyuHxwYMg2DLFHikZ30t5MNYhGgYD9N1jAVfXnJ3t++PJztSNVjnPOEbc/+9WCv0tmoNAPXw8wyEtkksPjKi+FJm4LyfAkKA8BV/IMogNGiiJsAwFbEh8xc2dgEMSZbl/AvQRQdtE+8HUgeSZvCzffcCmyrizfiDTQoClg6oHDR47aLWrHsjDiaut0hM39zzYwY6pge5De0Eat7J4NiFf0smTpqnnTz2R/FNNbattd7xtuA6K+Zm8yRSq2Pt59J++My9g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(478600001)(52116002)(86362001)(83380400001)(6512007)(36756003)(38350700002)(2616005)(38100700002)(316002)(2906002)(1076003)(6506007)(26005)(54906003)(44832011)(186003)(5660300002)(66476007)(6486002)(6666004)(6916009)(8936002)(66556008)(41300700001)(8676002)(7416002)(66946007)(4326008)(461764006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tXRUaxwndIu4IzyKPA+lWbRDKOpYFNW6pgjqD1wCehM6SYyynMsilF1iMpNlt9L/jBeA8jotBB/OL6Z/mexQFfhgZYS5v9Otnhp1UFs6xgQxLsFTpDj45r02NyCZgSgX3jm3gSuFqbgVp/8fETYeDg1i8U7kAAsC5xYmhJbI9143hHXEDmpoVetJCQh7vl7A0Zcp1Zt69Kke3HutfQuYDITfIq26SIBsukYKsmkzhCCb4L6Zl+BvgjJQ81wkujE/fsPgVLaDwXnh+0Mo51BWG+CQoK3BAfSVE1P2UcAgZg4mPQgfVlARhNLxfxvVrBAYKe07UyymhkqjdD9XFdxIwvow8S9BsLcf11emA5BXmFdFbc7C6aeg47JZXj+AF69lz6y4l/WwnoeK8YX2CpwVZAaq9VrInVkYvhz0AI0UOQXYE771QZ4GKfMTljiZ0W7OXd28NxxxPXkbk7F6A73jyulOXUxwBcuPWsehS3BRW2xC6+k6AgSe5mUQfxJNXyedIecLM/PQlaK3L6O7bVnikRqfshYfObxxCXUgqRaSN82tLDlFpL9SDLERwVlq0P/4XiHkaC7V8Ql9kukz2gZcvSshbwFdmEaHiKEOYam5buE7oMaNkGue147hG7brIBj5m0JdYhfMOfmSojVc7tIWT6rWMeRTjPHczSObVBRpvPCzQSlNqu+EbSfzQVWD6RGAi9XN/Euer1ATPImVrmZexYVw1l8EFEsc+6UCfKq6s/xhbCqCsTvpMh4iGQWidmuXYD0oFy/oCb9gyjuWELz4WLgvtjPq0xjudAgBn4RA632FbIwzF/gPGMHfrne3RUVpShhLHUAx6kxWl5+FFJrrjpk2nfvMjmlz/EL4z8N9OY60yycaOxCoRlPasuzkkerqrIVAT9sC3O6TS8VigGFfrPwv+iv7o8fHgdc/5eafqmzM1A8OTp072D2ad3cQhgke4yi7vzULqM0EXlVgmBqmMKGEJjQKgreJI8NM4jCGjsWd27vu57znZWSmF0MpjHSP+HokesDiYopKAxAqpggBmqLcd15uGv67b0yRUo1X60WW+1LdJw4xQwLLRku5bPqU5RPvEdYvqTEKvrooXaQE1uGuDJkgGPbRlKfwpdSz3SSE3jzYfJweWp0Cqwh7SUvhgxLqyKi4k/THOd/2SpR3o7ndaC+e429UAS8l2tJ5McNtkXM5hMSFXcN3LdxZUQnmOsVFjLzuHxhReBT7/AL1I+z0+6Ni2OA2tGdvZ4dYt+FUdA4a2N+DxzELAzB4ZfoA1RnL1HUfTwP1OucDTsY5YI4yvZWc2CFkgViQ6TeUco01tpg9CFqw2Oj5Aw6SQQma0/mHzEmL8c6asVTo9ka0o3zF1iDFrIwfJn0hPpnog1S+aSKgePEuI7hWbK5dWVK3otwcoWdQ+pnfynv4pvb9hfWvaFH2em7yzRKugn8/g41uosnfuzdTIQ3ikJEKLM7xe63UEVVcul2BawBL0+qIwAytJUTBjMVp1PqgHEXHJMU5H7/UYyDM8hnJ6Bg5tn9MHGpMC2yqdu12o2etVWYpvhzG/lp5LrOj7kC5EQJ1aHNqP9X4sNXpohAhmep9UrktXRndkp7Cm0fTqi5AofEGfQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3041181-7461-4462-eac4-08db3b542227 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 12:47:54.0838 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: +Xr4Ezt1M76M2tvVZ3e2978xpP3uSViKXocGAwND0uU8mJ/jGpC/VsP0l91zm4yy5+gaepC5I9IRnlick4lKbQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6888 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762975763347780237?= X-GMAIL-MSGID: =?utf-8?q?1762975763347780237?= ocelot_io.c duplicates the decoding of an enum ocelot_reg (which holds an enum ocelot_target in the upper bits and an index into a regmap array in the lower bits) 4 times. We'd like to reuse that logic once more, from ocelot.c. In order to do that, let's consolidate the existing 4 instances into a header accessible both by ocelot.c as well as by ocelot_io.c. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- drivers/net/ethernet/mscc/ocelot.h | 9 ++++++++ drivers/net/ethernet/mscc/ocelot_io.c | 30 ++++++++++++++------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot.h b/drivers/net/ethernet/mscc/ocelot.h index 9e0f2e4ed556..14440a3b04c3 100644 --- a/drivers/net/ethernet/mscc/ocelot.h +++ b/drivers/net/ethernet/mscc/ocelot.h @@ -74,6 +74,15 @@ struct ocelot_multicast { struct ocelot_pgid *pgid; }; +static inline void ocelot_reg_to_target_addr(struct ocelot *ocelot, + enum ocelot_reg reg, + enum ocelot_target *target, + u32 *addr) +{ + *target = reg >> TARGET_OFFSET; + *addr = ocelot->map[*target][reg & REG_MASK]; +} + int ocelot_bridge_num_find(struct ocelot *ocelot, const struct net_device *bridge); diff --git a/drivers/net/ethernet/mscc/ocelot_io.c b/drivers/net/ethernet/mscc/ocelot_io.c index ddb96f32830d..3aa7dc29ebe1 100644 --- a/drivers/net/ethernet/mscc/ocelot_io.c +++ b/drivers/net/ethernet/mscc/ocelot_io.c @@ -13,25 +13,26 @@ int __ocelot_bulk_read_ix(struct ocelot *ocelot, enum ocelot_reg reg, u32 offset, void *buf, int count) { - u16 target = reg >> TARGET_OFFSET; + enum ocelot_target target; + u32 addr; + ocelot_reg_to_target_addr(ocelot, reg, &target, &addr); WARN_ON(!target); - return regmap_bulk_read(ocelot->targets[target], - ocelot->map[target][reg & REG_MASK] + offset, + return regmap_bulk_read(ocelot->targets[target], addr + offset, buf, count); } EXPORT_SYMBOL_GPL(__ocelot_bulk_read_ix); u32 __ocelot_read_ix(struct ocelot *ocelot, enum ocelot_reg reg, u32 offset) { - u16 target = reg >> TARGET_OFFSET; - u32 val; + enum ocelot_target target; + u32 addr, val; + ocelot_reg_to_target_addr(ocelot, reg, &target, &addr); WARN_ON(!target); - regmap_read(ocelot->targets[target], - ocelot->map[target][reg & REG_MASK] + offset, &val); + regmap_read(ocelot->targets[target], addr + offset, &val); return val; } EXPORT_SYMBOL_GPL(__ocelot_read_ix); @@ -39,25 +40,26 @@ EXPORT_SYMBOL_GPL(__ocelot_read_ix); void __ocelot_write_ix(struct ocelot *ocelot, u32 val, enum ocelot_reg reg, u32 offset) { - u16 target = reg >> TARGET_OFFSET; + enum ocelot_target target; + u32 addr; + ocelot_reg_to_target_addr(ocelot, reg, &target, &addr); WARN_ON(!target); - regmap_write(ocelot->targets[target], - ocelot->map[target][reg & REG_MASK] + offset, val); + regmap_write(ocelot->targets[target], addr + offset, val); } EXPORT_SYMBOL_GPL(__ocelot_write_ix); void __ocelot_rmw_ix(struct ocelot *ocelot, u32 val, u32 mask, enum ocelot_reg reg, u32 offset) { - u16 target = reg >> TARGET_OFFSET; + enum ocelot_target target; + u32 addr; + ocelot_reg_to_target_addr(ocelot, reg, &target, &addr); WARN_ON(!target); - regmap_update_bits(ocelot->targets[target], - ocelot->map[target][reg & REG_MASK] + offset, - mask, val); + regmap_update_bits(ocelot->targets[target], addr + offset, mask, val); } EXPORT_SYMBOL_GPL(__ocelot_rmw_ix); From patchwork Wed Apr 12 12:47:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 82467 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp308506vqo; Wed, 12 Apr 2023 06:04:40 -0700 (PDT) X-Google-Smtp-Source: AKy350ZkAw9DCKtir1+9lNYS4GmgAg7WZu77zFHXoQO87ROliJG41EMTAKrIgZWL4WQp74Zs8MKf X-Received: by 2002:a17:902:ecc6:b0:1a1:b528:9bea with SMTP id a6-20020a170902ecc600b001a1b5289beamr24580777plh.50.1681304680355; Wed, 12 Apr 2023 06:04:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681304680; cv=pass; d=google.com; s=arc-20160816; b=YSOX0fNJaCwfgN4uW7J40DfFxIxE4NGZGyBucNVfYQFg4PHN+Xk+OWUeg2OMmzt50n B18DCvI4sc4q/WE1ZkoYJqyQ1Tsa5Beg5y91K2LH14RiEC/lZ+WrR6PZtXHUaZpFLlYF WlM/byqdzDKssC+0svFeEU8xI8GSgXo9uaCd0GCyK8aAGraPem4uzVjxi5icqj1eEvFC tEaYOszxUzgH+MTDgXcpqWvjrYb1hiHKp+JJHMWb5N5Z3VTi/fd1Vs7oDLqq6TpansBI LxNZALY1CeJ6eJH6EK/IoXdETNshW8Qw016pdMmzmOX1z3veLREbgbwcxdJSe/cujHxU aSYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9A3FkgECR+wOrtxS66iwjqK7z4EGPmIhtRTRgbu8FOI=; b=RT7sEb6IqAm6TBO1LwQAkEb6UE/kPE/LgxD1KrN53uBeQ/z1BiWAVmYeVQxHmxQGxO 9u2XVHXNGXlpvDFHZmM6iJwpTPWnbt7+77zla+6J8XX5Olu4FXCAh7Rl7f9ZkAgEZVqN yDDxjK75ObYQgEDaAwsdBS+lVhcWMDt6q4WmyxAL3jkbCpq0sF8os5UtkjIJsOHNOfMK B3U4XSCT3LsCyV8sV4jjD6SJqeBwgWxvXMIQx2DZDLFVqGWeV553D11Jy7J4bAmBWAkV wvzfnwwGAgO9gDqEV1lSbJFBSHznVRsoc/p5Syhcy19xdZMM6v7LKnpcnhhoSb5irjN5 2Yww== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="CaKN/sUs"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lb12-20020a170902fa4c00b001a515bbe3a5si13120806plb.592.2023.04.12.06.04.27; Wed, 12 Apr 2023 06:04:40 -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=@nxp.com header.s=selector2 header.b="CaKN/sUs"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231567AbjDLMue (ORCPT + 99 others); Wed, 12 Apr 2023 08:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231761AbjDLMuC (ORCPT ); Wed, 12 Apr 2023 08:50:02 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2058.outbound.protection.outlook.com [40.107.22.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D22878A71; Wed, 12 Apr 2023 05:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dzT0l9+xkQucwb8At2BunfW9yy/qT44gFcnvc9c0BO2mavXKUhKijS1V8keOPBtDFv4jt6e3uweYPt8R7w+zXY4ylWU6+ZKbtqdnXmIy0HaFuZD1B8lua7cnAH8lV4JwFLlpHmkJtbFeC8+QTyS/oTuxk/nZIVpG0w9WwCw4dMLqqIRK2Q2GfLrvnetnezoAFAokfMF7I5UBzchzw+tdPrO3DdTlDuVpkWaY5Z19tTMEBxpl0HhdxLKXjr/8aboSOZ+JBW4gPnLBwf82QD1Hrr8FiQD5ZTH35bAyngzfeLf3sLf5ygjGIxeSc9c0TEQiTknQqirMCSVL0Linv1ajtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9A3FkgECR+wOrtxS66iwjqK7z4EGPmIhtRTRgbu8FOI=; b=Iarnrli3YsHpXVAkC/g1j9jI3H351QjJyEtuC0l8gNmyr/447sK+aKy84OX0HTIO6lnDW8Ps2RNmm6gyHjRNh3JGA9VtGAWxSLbrlAfa2v2Uvl2x6A3wpPuL4y/bBOxkDDXnxGnw3EWNF9CtAFJ3VU4uLlaqmRVUeMnLXnkgOqLeQmAkw/rW/6dO43/uVCa6XeYkUjz2qbj5M9oaspzYYE5s/H5rrT9AqtYHXYZdTr7Gw9rqpGOflCiBhJdHDbcRCQPh/4RTNQhQqry0OJNH0U5NUg1uyVROVZOzone3GkrI6jHHNBneASiouKhOSJXi32JCdMKuCst3stgm8OBWCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9A3FkgECR+wOrtxS66iwjqK7z4EGPmIhtRTRgbu8FOI=; b=CaKN/sUswcriWoAGvpTDKiilLEOOvWZ1YxWyN560rURUL7QdaxTsq62N1ixZQmJjpAsb7yBTSHfI7ZxeaztzyWJ2wWBpdZQlBXjzoMfnJlsQDk740QPxn1HEj3nhwal322Hw/vBmEd8fbkIq9+EMEJBF341W+9MhSmkrj0B1PqM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM7PR04MB6888.eurprd04.prod.outlook.com (2603:10a6:20b:107::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Wed, 12 Apr 2023 12:47:55 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Wed, 12 Apr 2023 12:47:55 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , linux-kernel@vger.kernel.org Subject: [PATCH net-next 3/8] net: mscc: ocelot: debugging print for statistics regions Date: Wed, 12 Apr 2023 15:47:32 +0300 Message-Id: <20230412124737.2243527-4-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230412124737.2243527-1-vladimir.oltean@nxp.com> References: <20230412124737.2243527-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:800:5f::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM7PR04MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: 19106e46-226d-4f6a-588a-08db3b5422b9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hb7WzG5Iy4pCw+AbbV5bg/wwscGTOxjq3fDICDRbhXUXKncIn7shT6Z4I14zMHRjheK4J/XITfjEh/yhjVAP+aqAq7AUAF5kpNiwdRCx2viH3llImnKAQ8If1IDNda1yxs7xPHQdie1JbWlrrWOTs84k5BbTakxiUDZn90jTNcvOMKKLr3JiQGcyCcSKJRZONv8V9LxM7C8ZgFQxv3adcxxXCRrdTTk36Jpk/lQL8qBZJRcfmZ51b4ggpDSszxuyRz0tC1uvy+6KcatBwbO46z6hqif7wtu/GxrEPNoGVPQlboPfwMyQKHFeHcdg78g7twm2pDPrUCSB9kPTLZOxgqODqi4vHhP/9MLiiZKu9gV7pwjY1vJPsHkshGTv7OTdn1fNWyyicLC2KzQp6TH9/4Wcz4y4Ir8f9OrbMKSljPDPWAtCHB+eb0EcEeBA8lDOjIslKFgOIE5ilK9q+UrW8DRhuNeGxIXgoQ1GqTFtDZNLEa/3CDIswyE0wwDTsHZ4seoUlyytSyk+EgQDMMOl1WJnsNj0lZQPSXnMyWlbUR1gyc+g/WNoinyPWQwlfW/oVrP34ojWcdlgRCfypjuXobHlv2TTzzJqzfNizvzsVgFbcx3EXwKpxlkRoPy90+Jr X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(478600001)(52116002)(86362001)(6512007)(36756003)(38350700002)(2616005)(38100700002)(316002)(2906002)(1076003)(6506007)(26005)(54906003)(44832011)(186003)(5660300002)(66476007)(6486002)(6666004)(6916009)(8936002)(66556008)(41300700001)(8676002)(7416002)(66946007)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7kuLUF6uAuCOef+rAVgdEvGBtVqwpN7geWGr9u3Y11qtGjOTdjUDT6nYxuG6c9Y4EeiO83RT4HjiHfOA/SECPZWiX8TLoRNRAHb3CcTAYDterWwxxmhyDgxEyknaglO2CwQJj3k/ti4GKRvhzOy2w4kJdbtulnVOVrR9nx9codm7MUe/viuyODrgNYwPBjfWKJ6E8kqBmPN7yT+fdCxDav6AdIUzaC/MJ1ADmWGVanXuo3ZCMXMXAylmoSLW1j1aYYa0ViTQRTHbrIvIqx0CRrtZJZ9Bp+mQ8tsRjhyZsbo9bZ7QguTyHU49LltaGgtwh0UlJpEA9JXj85/Gpmi7LF6px7huLCC+rop94D3eRb5GIS+8lazmeqAzOCArN9cY1pmWITh7zniwGye/EGm3oKCGZLBMXnkiSOy53aIotTxnvN4SGZW+Xp5k6FrtJz+4e0xURffvFIh94ViUMpWBTOCftIUsquc8OkYrFEAZmzyKC3/zDRh4z6Jn+J7aHPNv3GT8nnBOM2T9kplLezvkctlPzAGz1Dt0YbnFeJ2R26eIvBPf/VWVbBr7OvaYZFFSurcCdlL2q4YSwGqAW2fWe5xtZDB72qaGaVU1JHjapR46EwKFXR4b36hSMZMqZQehUF5vHfmzeTag+r+m+J6V+FfVQnP8w/u89l9MYIt5trp3sjdWe9iMqlaVXIAiNKj2LcyYIdgTAEY2yIV+wsHRfPAaBtXStnJ3ztLVKPmZOIIESzxcGWNfRWY8Q7JctX9XXmCTyOIHYT6vs9FdwHxYRjELYlChDR4ISDPjfPv1p3SkxfeOgZ+j2zVy0NOd0lnaniEpGCHIjrlrX7XXo7olwsbgEvYrhner6A5JcxM13GHVIFisD2JO17pdgLOSdSVQlx+Wl8Nsb0d29hq+exdMElHbHTU9MRuKJI4jcx7zo3czydCCB1C6LGRiTYytZn1KYTBBU9rgbTEf3LSDY0hEQIcmkD+oDecUXmKygm07zS33nw6cPDI2mAm+0OAjz215nXsJa4zoF9b/+dkf/GrMJu/VaoTv+qNEOSBB74fwIc8LTt6IV+U1YYIPVt5C1ooYRX3uU12IIiwjoRbmaU5PP3WfP1AvI9GuYBeFQm+7aKpYIZfH9tcWK+JGh7NIx0jqEiRgNFLBGHCso0xt2RWjY14wXW41pJtoolfSR3304hMgNUYoW+UiRSGXtwISKJWzLttIkTKoUjq0u5a5oCZQq5bYbq3i0adaB5o8c+EInmOB5gMZorik+ar9+fVfEwW6xeryG2vKWah8B/f2ufUIxb0RQQ4UTc/tYPu1FZO1l/CjqivkJLZyJiFJuMBbpSfQVbp3nNmhEnNxguf5k11/f+WjagkXgCIyqViPpWto+zsW7TkHFsbN1yNwcKf8NvCAvgyzOv3nx4a+Vo2di7RPzZ7PZUZl096P/UkMLfBiRABzthnDYa7hC8LxmbrX6cY6FOGgEl68sHYPewVdt/e79paAqPWn9xTPx3Eo0+a53uZl7QhVcqLOflsPzZBViRH2g4tPIjJn3Xbu950HgZiQRNn+kgswNGrfJV2LQUH0dmpTNMHxrOS+7UfYjfyykrJ9bb6c076j19R1DGLU4xfxMw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 19106e46-226d-4f6a-588a-08db3b5422b9 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 12:47:55.0822 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: sh9hWutSYRWV9goJleANIHn0glIzBI4VYaUayBcuO0DMDhHk/CbNJruUVxpfbQsCpzXmRWbGN0frcXbcZmpJOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6888 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762975736128374954?= X-GMAIL-MSGID: =?utf-8?q?1762975736128374954?= To make it easier to debug future issues with statistics counters not getting aggregated properly into regions, like what happened in commit 6acc72a43eac ("net: mscc: ocelot: fix stats region batching"), add some dev_dbg() prints which show the regions that were dynamically determined. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- drivers/net/ethernet/mscc/ocelot_stats.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c index d0e6cd8dbe5c..b50d9d9f8023 100644 --- a/drivers/net/ethernet/mscc/ocelot_stats.c +++ b/drivers/net/ethernet/mscc/ocelot_stats.c @@ -925,6 +925,15 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot) } list_for_each_entry(region, &ocelot->stats_regions, node) { + enum ocelot_target target; + u32 addr; + + ocelot_reg_to_target_addr(ocelot, region->base, &target, + &addr); + + dev_dbg(ocelot->dev, + "region of %d contiguous counters starting with SYS:STAT:CNT[0x%03x]\n", + region->count, addr / 4); region->buf = devm_kcalloc(ocelot->dev, region->count, sizeof(*region->buf), GFP_KERNEL); if (!region->buf) From patchwork Wed Apr 12 12:47:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 82469 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp309355vqo; Wed, 12 Apr 2023 06:05:34 -0700 (PDT) X-Google-Smtp-Source: AKy350ZwWMcf2CXvKh7kwkvEFFsunCtYDXguWaT/tmLDhaoP5S5xJRMSNSagsuInSJribzceEzju X-Received: by 2002:a17:903:338e:b0:1a1:d215:ef0c with SMTP id kb14-20020a170903338e00b001a1d215ef0cmr16887426plb.16.1681304734321; Wed, 12 Apr 2023 06:05:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681304734; cv=pass; d=google.com; s=arc-20160816; b=u+8cTFrTwZWZ+H0ehn9vcLQfyizyFY5slZ6S2Tl+KSHu9ZwNlHh36jyj1s5KQ0MQjK p6zlT9u9Xi85JXy9IxzMK2QzN9bVMXEyGeTGC/3drURP525CZ0+2oQT3TGuyNcLYxaNi 5I+wcP51KiJWbmXIQw4u8Lf/NclA4p01+M3Vj/0pp78i/CyBPlGPyKM5cjeJSdn8SRcJ 8RnbfVNk3uyTQ1elvhzT2Rd2Agpuwg2Y6paoI/WUNKFPKCiBMaHLuGUNxwgRCvrHRn9r oldLj0aWtK24aSOlX4rsbR9SZgoWww3zcsWLoYe7TMkhSf8kGT/NXORwzfX80klJk7lH xYuw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UkfiAaeWtzu2DIh+22VbDXvIUPGPOEA6mt139v4rRdc=; b=JXlXKdMBhPZI3lCnZBA4Vj6YYCcD+vHQMHZaIDYW1ojGX8pWp2eW1HnZ5b/7jm57sJ /wI2YnblPYjJjrwCLeEVqmSjT5sYkSIiltVDu9KhU+pYeQkNHKfWB5v1HkNwia5CF/dC hSXOmQFwX+JBswmIsiuzOZ0ufvdLyO2c03mVssDMGDbzLzMG/aWNae+7QWWU+T0qIw4s vexHbFOxmiyA00fPqD0ducKPufG88zGYa8t5tjMzYkYyECbqrIH8szv2b4Y7cYFQumOc neGqbviLxlfzPFR6hBevtQ203m1B03G//rguaC8LESC+2npZlXo3QmNB0JrAa+3XlAI9 uMow== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=EfkaJ8pK; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c12-20020a170902f30c00b001a6567d42a4si4360777ple.478.2023.04.12.06.05.21; Wed, 12 Apr 2023 06:05:34 -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=@nxp.com header.s=selector2 header.b=EfkaJ8pK; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbjDLMuZ (ORCPT + 99 others); Wed, 12 Apr 2023 08:50:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231220AbjDLMtx (ORCPT ); Wed, 12 Apr 2023 08:49:53 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2071.outbound.protection.outlook.com [40.107.22.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FD1272BE; Wed, 12 Apr 2023 05:49:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HpVtFZp4WSxT7xI1L67qrkNkBqWt7K6CdJaEbD7XdTe4StAaCCQw1upzxhN++Ub/jHlmaR/7l4ngC4qZXGGOXY9jIQYIOus/yVHmcTug9ka27I2zPPuFT38kqLFcA2dcoolqNNx6uKAMCH8yy17m1SzPjFcpCjEImiwFE5wbdd0KQYks5wvpkzxRU6tTIrA8pCS6QuLFHF1WK7sji8b0T6UcVKRxsUz4vqV0DDZchi/6XMD4bRUUo8xwIO/uPUe2IOx7GFFaDICmNyxUF+cy6uSThJHyDgyftqDsdyI06kZHhQa9S3uLifs5Tez9Wv3+9B8teC88FY3H+3dIqm3brg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UkfiAaeWtzu2DIh+22VbDXvIUPGPOEA6mt139v4rRdc=; b=R7HtedqRgEiwUnUEV5feeRxVcQEk+LQRmtD54tBudeK268Bqqp7b2GK2ULUEavWcmpExgmNSbBcLTP5F/PBuZUvVpdnsCy8eIxgp1M36XPJU0UyqSCuwy7vAUCz4gMxA9ZE9aZ/QdK/ovaYZYihwVPhybhQyt+f74PccuxivqXTM4U0qBlV5dLg9e+R8nb4lhdg7+kwJpDAOuOoY/SGCg3qM+Hl4jL2LJc0gtyoP14nlRJkHPo1CqCjOjTmEyR+hmAC0p66RTNs3PVz6b93TNHcT7drZdLaUBdXrgm+aXmm+agr2tV+CF1P7DugxBy2RlvCd9VFPUX8yuT38ogEQSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UkfiAaeWtzu2DIh+22VbDXvIUPGPOEA6mt139v4rRdc=; b=EfkaJ8pKESYiNuVM5RUErMf4cRTWN0gyYdJhWmMC9qj98oTemhY3yMbU9291krozMXvJ38C/VZmm5zNE1bZeiZIYbGS9ScE2jLI7tZ1kQMQUc1ghWCU4yLn9elwQRHJKwFFIuTdXIu4ZsMnHP17w6Bade3+XlP32e0y5yPuQR9A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM7PR04MB6888.eurprd04.prod.outlook.com (2603:10a6:20b:107::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Wed, 12 Apr 2023 12:47:56 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Wed, 12 Apr 2023 12:47:56 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , linux-kernel@vger.kernel.org Subject: [PATCH net-next 4/8] net: mscc: ocelot: remove blank line at the end of ocelot_stats.c Date: Wed, 12 Apr 2023 15:47:33 +0300 Message-Id: <20230412124737.2243527-5-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230412124737.2243527-1-vladimir.oltean@nxp.com> References: <20230412124737.2243527-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:800:5f::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM7PR04MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: b19eff83-ebd3-4d37-eb85-08db3b542370 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iGV2iW2P2h/j0me3Cr+dSDV9aFRtt32XKb5BEQJu8HXHCJAK3hgTLyuedo9cTCQZCxRhhm3gLbqtkx7H62qkEzNtrij7M8OhqeytfuJ+jJFqT2jYC7j8G15aAri4Vtrh3SO94zYsfTnNZabETuw+q+f+9YtyrEkpAHcJ+8XMrqwPNTbxbFeVRAuhPe5TrIZv/J4yBlKBJ8UBh0TGSM/IebD0o3fw+i5LYT07zbgRctSzU6JVzQHKArYVXe5q2+k951dCG813wDFRH8EhSUctElUH90v0//yiosDkXkVRs3dOkfxpX2DHgdvSkAguItuIA8yVSjuUIMydy4Gu2fR51cAzlH+fUCPRFmqSFwkDxdX13GPMXJ1QOsC+e0tvYYootlSqMJkzh6PLbpEUqwTlwCKEr1wEds7k71+eWo97Mz8TV765ESCFecbXzj5/rHFRjeFkzEBu9s80cbjPP0mLelCVuvIdUB9cdGz/d2W4Yb/mbiCOSfZAitZId4jHWkNHhOCVUzX16cT/OE4ouoj3G6lqBcHcYWHOIUSWa3tqzh11Gwq1MuL5cxjtppvB6hLQsiwVHos8fFQV7cbyjOddSWw9u8nKwwm186Cpa6jKntfpb981+049wNIthtEHnT1b X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(478600001)(52116002)(86362001)(83380400001)(6512007)(36756003)(38350700002)(2616005)(38100700002)(316002)(2906002)(4744005)(1076003)(6506007)(26005)(54906003)(44832011)(186003)(5660300002)(66476007)(6486002)(6666004)(6916009)(8936002)(66556008)(41300700001)(8676002)(7416002)(66946007)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6/TUqMAweglwJtqBPzd1/ecujvdXb33vhMb/+hJYv0I0WU6UJiRBrqCuOMBxjSf54i4w8iI7Xz3z3kyKNUOUj/Bh31mO2+0dle9eFHst3SoavgMdRwbimM1r1LaV/MZSbAJu5ECSeizS17ilnzDUo+C+x/m2fxJD0jmARUQoa8BmReS2mmS80Y9ho2ElnNHJ11Wgtj1Rd25/CDQTkAZ2fGoyksy0nZYgW51rK3KJiKBYEDLCKNL2JLYxDgtlLl/WqR7Tuzr/ChCAoEZwvMZN+Y9Dfu0DxN6nLY2Xz1Sx7P4EnW8elglA7cS/RXjT9zmUmB5xBtuwDrOSrFZaUcAtm/t5VDmVUuF6KoxBMe+LkMp451UejWYv89bVzBFEcoli4GQoROkmsUuxZ3fTaPRnyLUynm5DyA8uQIRrDD55Hn53PhOx9Pfx8fibGkuZv7H8lCjm1dQaZPJZhzRIZHS40OIprUfJuUeI2+aQsI1IzYMh8m7HYdUcVqqyONRSOEAlS6cj1YiCMII7flxqKFz0S6iDKVuhE9RcQY7yp8keWPH0GxKzSu2ME4J5vDaIXUYihbhubrIJ90HHiFi+r2yAorpF3J3/+v3IRsrRHqwkA7MzfV5EYpu8RzhJhYbag4Z7LLGBTmyHb1Uvmee+UfsG8w7BrvWKlLE5ekhpWml8rIXABMuIbmfs1h2/FF8gLE4Ps5KUpXR1LTOrDLXu0VzU6AH1EtOO3WEeoTO6tB3JK5xd6ZEh7qVRpKZvHC8vXtPy3Heu6GcT2B4xzQ5Lt8DryraSUpHzusOgmlamcfHxtB3vx1yrnbp9ahR6Mkm1X1CP4jwQdh6MGcDUUQ6B8m3A/D071DBMyiw9BRO6NHcpvwTaKxzJ3vB8KG3osJE3pVI02FaCP/bQBglY5WJxUWGe/lYfgE0+rASlnwWvkFI/cWrEqCgkQpOOSlVA9o4FxE1RmIC5Vj/3vGM3T/bLUESBuc31eiKbmDuR97TsEo6+gCOPQj7bOSl93BP07H2xdnmE2pBYC8URCjlTcrE+hXGu3xCsIo61YtIpCkB04ODQUPVXQcCTy2pY26VUT5hchHdj4G0yjsrGYM4QMbP9h6srkzjntGXKSE38l4G1lXXg/31bCBIpqwCj8e2Nd6cl+3k29aS8sX9Ott9AHU+kXZTaADoffLogrX9Gkca9hInSrQkSWESbx/FbOw9yFZ/DoEek164pntZQXFU/pQo0CcQQsZTbJ4Bdxawam36vxpbQO060CcHqA41diBPMkWYEXhNUbH8ag2dKLEKUK8k0K8gBYDdfOW5ENNZYmfy8BiZfa4hvsptUicKTvQs2bnNgEoI7kV4rBGfEnZAIaYPQWhiwd5Oo4F0FDBjfpEoLZt4hW1t675H0u43v5ExzXJk20Iu+ZSrqpycTwFu+VjEdzmTwdv5xP0jbNlQmS9f8wjib1jpGdYJ90XCD+64Cx+GfSTmKFrcB6FK+lN0BxjLtg+RXpNdIcIcE6ItmtLU2FgLeMoEYM+OuV1rzCklOwa3zWdmUSpHmAcHHcCkqv7BsbjscIx1xnoddCyEh7vy8roSWkDqddmcc4VROc3L0c6F/KXe3cQii3s+tE3SIUfO6XVSjIg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b19eff83-ebd3-4d37-eb85-08db3b542370 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 12:47:56.3025 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gPdQ2NDdMedgfteV+4u3ug+v3Oe5U4aOQ+qkH2Z1volhoLP0y9P9y0NUqdru1A94KeJMn9czSvgsEfSwqaBReA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6888 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762975793192132713?= X-GMAIL-MSGID: =?utf-8?q?1762975793192132713?= Commit a3bb8f521fd8 ("net: mscc: ocelot: remove unnecessary exposure of stats structures") made an unnecessary change which was to add a new line at the end of ocelot_stats.c. Remove it. Signed-off-by: Vladimir Oltean Acked-by: Colin Foster Reviewed-by: Jacob Keller --- drivers/net/ethernet/mscc/ocelot_stats.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c index b50d9d9f8023..99a14a942600 100644 --- a/drivers/net/ethernet/mscc/ocelot_stats.c +++ b/drivers/net/ethernet/mscc/ocelot_stats.c @@ -981,4 +981,3 @@ void ocelot_stats_deinit(struct ocelot *ocelot) cancel_delayed_work(&ocelot->stats_work); destroy_workqueue(ocelot->stats_queue); } - From patchwork Wed Apr 12 12:47:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 82470 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp310347vqo; Wed, 12 Apr 2023 06:06:39 -0700 (PDT) X-Google-Smtp-Source: AKy350ay6erxTqW9SGTinsueIvT75krJKY8BtEcUTmPAFHp2UlmvlvX8/DNmanhUitgjnxu7F03h X-Received: by 2002:a05:6a20:be27:b0:eb:eba8:9705 with SMTP id ge39-20020a056a20be2700b000ebeba89705mr759945pzb.16.1681304798837; Wed, 12 Apr 2023 06:06:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681304798; cv=pass; d=google.com; s=arc-20160816; b=mxXbivVYkq+0c+egoBC/X6ImhDhfs442E/kIlGI2a9JGmBhFTogXGVsSvOL3b/cC4j MS51FqhpeiZJteZbTQ18/6w9kaC6/LD2n+rA2DFTbBhtix4h6uaICmHENd1lg1BZBPsW 1zrzEF6xmetIfptV5QQeSFMQvL9BMZ+aBrb2GtNq1chHzUGA714Nls9Eg7DC2JM0WO4K RA29Os1VTxZLyJreepHVW6I6F1VJDlptnrw+/3MVK2dqlshUjuGTo7VN49BR0ndrvRi0 G43uZQW9M9TPk1GF2YIrwXp4UqJMRXrmxiSqwSdTGtNg/zYntM17mt9LfFz9FEoe4MeB 0c8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=6T4+lWflBLs8QRBOwrTdASAf83R3d0iOinQW9i9yQME=; b=jByerxfRZv8v4LlJRQBJm7aEkhOMj8cA/OIk/4CAjtiqD1GP2piAjW40DnUEyfo9Ex r6//ggYqd9GpfrjxeeWoFBBi5kaJyaTWMyzrnaSekzXB65PpBsku3XnXx5tdcXwn3qds 8RtkvyS0Kq7BHHMbLi4KZSGBnad0Itj+31YevnyR1zjCID0dAJYL0N0Gcai1Xp0FkUg0 U8zAi71TO9mZsVuip3c/iaA80NTc5FsKG3RsQIFoRiuolSoRpa326g/I0/4HABbjKhez WCv8TG0ncPBFZlIs5loJpGUDsRjjEFfPk/FZZ1ThW5xZFNVcWdjcVRSGJruUR/gMo7V2 7otA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=KsjVqRP6; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s37-20020a635265000000b00502f344050csi3847962pgl.313.2023.04.12.06.06.25; Wed, 12 Apr 2023 06:06:38 -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=@nxp.com header.s=selector2 header.b=KsjVqRP6; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231409AbjDLMu2 (ORCPT + 99 others); Wed, 12 Apr 2023 08:50:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231485AbjDLMtz (ORCPT ); Wed, 12 Apr 2023 08:49:55 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2061a.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::61a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2091D868D; Wed, 12 Apr 2023 05:49:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kmqq86Z2Yn+vrf3z7yoC+nky8TzCQ+hXrVFKIdrBm3CisDhieiQLXTsY7antS2ao5xEbgFU3UsPFxk+gXvoanDkhiNoQZO8TVf7Zabk1z3Lr5yDInCz3kThph5f3QYFaWYjE6MFLa4YSkT4qGCG9JCiwbyMNNMgotHEKPf2fBDNl1YMRWQb2CM+entvEjNrgzsurmuplfLRc5egTb9w+zgl+T9pCGPjGBw24FIAHy8/1GYz5omA7UzuGAijDksEZAer0ZmCT/yjWwKDGqRaxWjri6Fk2talWLpZX3ZREXJkhacUOUsm4hoILyl1IP346cZXtRwZ7HFcJy4m/YHmrjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6T4+lWflBLs8QRBOwrTdASAf83R3d0iOinQW9i9yQME=; b=hmGS0uHoy+jXS+NYx73m/fGc9OCbDkWyFp0hZkuzC/tNorHsxdo3dXtJ0P+NVxKpC8LR/fExryIh9bMMx1Wd7kxfNMXjAJETNmDRf85N9As62FG/qjWdI73YajQKP6ZTN6ikseMY+UpWcoRiIRjvwo3YlWNrBuhUIyfF/gydujTV00q/JSheZUfD0RnoI1TcZeWnt4Wrx1KSVfGRH2hOwe36+EetvwdwSJE/PrGSt4sLF8x1q8KQvWRbI61JBgGtjWYhcFLhlkU+L3BGE/gmduJQJtABQdtVLtql3hi/fSd0K6OjKhhPTRrS6y2BqI1wRrvRyfq31qfQ8R9ZGJzhCg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6T4+lWflBLs8QRBOwrTdASAf83R3d0iOinQW9i9yQME=; b=KsjVqRP63BDvj4gfOnhq1gqFXaUdCXDkFQyUqU9nd8fY2p15/FDYsBeFKnTA0Lbdx0VpWf2ZzFWY3sHyfX57iXkZUvMesOm3WSwF5vtmsj4RO2+aJMsrWx1JoXTdWztVtLs078Bn5Ab0GJ36AVd4p37aQeFiFGT764CdWrBbn1U= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM7PR04MB6888.eurprd04.prod.outlook.com (2603:10a6:20b:107::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Wed, 12 Apr 2023 12:47:57 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Wed, 12 Apr 2023 12:47:57 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , linux-kernel@vger.kernel.org Subject: [PATCH net-next 5/8] net: dsa: felix: remove confusing/incorrect comment from felix_setup() Date: Wed, 12 Apr 2023 15:47:34 +0300 Message-Id: <20230412124737.2243527-6-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230412124737.2243527-1-vladimir.oltean@nxp.com> References: <20230412124737.2243527-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:800:5f::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM7PR04MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: e1da837a-b138-44b1-1dfa-08db3b542407 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6GYP1/dcv5m4EK0fgplSaQp8HrPo2eVK1ddNkWomsKvmrVoq/AM5BaHrFRHSOs4FhX/+Ij/44dsvst0YSviCTHZFWqpyDkzKQS3fHceJUI2Ny8DfsUmFK87T7N3QtTQEbSEXUFoiTaMeNynjH+bASXLRgUdbV7ZbAPGsoDA6Nt+ohvJuRB5ThF01GN5cDuRjm38rnTRD20yUoaZW+vTwJx0f/Z33fpuHjn+WBdwwOIMaSnGK//naw+kvFZKx6HFzLkyx4FfYpKmhlmDKMImipuFa1CNNJTa75WAllPKN317Kl1nU/q81j787FORtMMZu9wvFb/+R5ElfzEXqap4pK3PmD5H95/1GtCL1JQdTTyfuEv7ozxv9PJ0LSCJrJxG08hVICKXdjwbUcCI/o2szuAhlpy8YsmWmyB/S+rm/4qM2bDjTXWT6rcH2p1VRqnBlWUq+8o9Hw9e70pX7PP5SrBut4iO34d9/4RUs/bw0LxvA+pdcOcy7D6pr0115QLuglidryZ692aGCQjGDc/Qu/sUGbQApFIyLAYGo2n0eSwOT/NRykafbs1HW2Ql430tkxYGS2+IGfrhUK4Ml+jVyuwOMk+Q90oEEhYqJy0nxCOYFQmwUOGuPbOLPPsRId9Bn X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(478600001)(52116002)(86362001)(83380400001)(6512007)(36756003)(38350700002)(2616005)(38100700002)(316002)(2906002)(1076003)(6506007)(26005)(54906003)(44832011)(186003)(5660300002)(66476007)(6486002)(6666004)(6916009)(8936002)(66556008)(41300700001)(8676002)(7416002)(66946007)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: LQAXkWz4eReDrWcNYG3CMaYlLZGFYUqxO+Og4GX7MAFkF2A+SCApXvixYX+zOk3CG+iGvwjwD79eCEuYiWYJu+UgLCnplrXpxnYSGBhnzbG+upIhDc2FEDvowibhg6Owb1qMgT0A3MUeX2kruEzXU+VeHb0O8un81VxfhnNpLM0dwfh5mwSAhL+Q5J0zbujKKkslTZJG6o35t/74EZ9WiIgzGDFYyzJhQXTp4wsQuw/1ULKs5/baNZRlGkodTqiY6OBFtNgaKY0X7FWpygUbm/zrojs482/hq7sxRsrhkKkXlOzNPsRFZbk+bJkO8dZ86vTFNDTkoW4y1xtzj/3n21Tll7BMLelXbH+WQGkzZJNlT4CXXU5KSeEHcq2iJqi9tYKPlq8bmDLMUZFsxhfVsD/xg4SpR1KUlWfGDfzSmYo+d3dz10Oivqc4O1bIMGjRibUG/7MEof4oHiO9s75sRm2N9JCvDWK8FwQBSPIdKBrpMFiSkxCpNl5W6n8XdyaY7kOVob0OKZAYcMsN2e/u2rw/JQ96gDgIWbsCef6nQFVz4Q1LtOBrwME2VnGL5bLv04d3gCifvP5EaNlozUfgzspapdFYol8ERWfaet1xLSbHCRQMV8fWXus6EyBM6MjNbdqAEVtHVMGO8d++JaLGB+v9TijPDS4ocqc6E1kif4yrjv3hmUTsB3Ro38S6iNVK2I+EJrkhaQ0XcUHES4dzoI2wmdOFfoY9XFlogpa29bxMKM56YU0HdFjGJZeU53+apRonxD/f4a7LWA7vpG1zdhBBY+gnwnLdNOtsDN3cAL0eGAHnMuLovbrdW11nmPmdyJMbMbGbifKuArbK84n8nUQBmF7sXSuu59fi+y+SuAg9aBEOcbUyliq5YgTSQhwXtyJCuXrirbtXUM1kRbLiZ6QhTTOu+1dHzuSU38ea8JX3nwPMjo91zKyqtmSww2vho+UAGyJILn6sy8qnPvtx56bvubCfHw0fRwfwsaiNwVcDm7Trd1oZhiuYd1qWN7RMljxa85q1PKTBWxe3kWPqhWYxtUXZtprPegOmrlsDC3WymQKheWrEWhtfak+ivKhsuv4x5BIQEI7aqG/rcHqrHqm7+3L6UV/q94oVf4PSYTCe9HtcHjz0fDwFQJK/YCVO1FZGp5OkTa6HC7avjzbeiSLpX8Ax6rlGB0wBs085b+9U/JVKzDgS5KYXPrDmlqvt/h23P1lx1tc3nN0sAEiKg7vMg85YQjsGCTnd5x1C6RWGE43CRLyliMrP7tn9S3hG/K7EnTEu6vspQ/e1R2c13wwkwrEpL28vdqzx82uEvBn7nXk5hM0p4wVrnsyx7nLLW6R5Lcv/AIDD+3BkLQv1X2tcjqjcjVD6o6+KJEYwwsAQlsamKL3noVW4EJJ+WHmadBaGrzeLmztd0bxoWevFepLIB1K3qmBwDbk7U4XQf329rs/HDOnN+V+XzRnfMSZRUoeaNndG7HRWS+l0WrzzeVKgfaVvZOE65pbCK0Zg6LuaTI7T0TMcxfmUsqioST89rs2kXrFCuxDmjcYA7eMKSHyqC6g90c9AS2nU/NmAa1DXJd0FW7CLmVFm3ujNY3549kYwVWMPrZdbtLpdZuI9Tg== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e1da837a-b138-44b1-1dfa-08db3b542407 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 12:47:57.2774 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jWECevEO4sCscfSMPAI9V+mcXhXs0jttNgHJVA/rVG53svh1lMSAI5eYxWo+Z+Olm1U0tS57NeY7ypojpxFkNw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6888 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,SPF_HELO_PASS, T_SPF_PERMERROR,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762975861007700129?= X-GMAIL-MSGID: =?utf-8?q?1762975861007700129?= That comment was written prior to knowing that what I was actually seeing was a manifestation of the bug fixed in commit b4024c9e5c57 ("felix: Fix initialization of ioremap resources"). There isn't any particular reason now why the hardware initialization is done in felix_setup(), so just delete that comment to avoid spreading misinformation. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- drivers/net/dsa/ocelot/felix.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 6dcebcfd71e7..80861ac090ae 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -1550,11 +1550,6 @@ static int felix_connect_tag_protocol(struct dsa_switch *ds, } } -/* Hardware initialization done here so that we can allocate structures with - * devm without fear of dsa_register_switch returning -EPROBE_DEFER and causing - * us to allocate structures twice (leak memory) and map PCI memory twice - * (which will not work). - */ static int felix_setup(struct dsa_switch *ds) { struct ocelot *ocelot = ds->priv; From patchwork Wed Apr 12 12:47:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 82472 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp312127vqo; Wed, 12 Apr 2023 06:08:24 -0700 (PDT) X-Google-Smtp-Source: AKy350bBFQgXSzm19eO3+MjlQmcfcovAoTWdF/rXCxw0sGJXuR4z15YKV+NMoDi44HmGSVxZMnwz X-Received: by 2002:aa7:9ec5:0:b0:63a:b035:8bf2 with SMTP id r5-20020aa79ec5000000b0063ab0358bf2mr8557708pfq.4.1681304904129; Wed, 12 Apr 2023 06:08:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681304904; cv=pass; d=google.com; s=arc-20160816; b=IaMpAZXbyqN4MQCkeHVbpStEBD/dLkg3sap4iaNAVxaJdiWTufRI6m7F8TC8r/Gcn/ YRebVFETeblxFDurPOfowRHw1gjOsNJfnmfHXbSc3XmuicKFJNEu4dHbXkTyxXzrAI+x kN/3TSuOqMeS0MqWgcZ1PZNHrjGTo+jZ0QZi4VwIIn56iv+imyvJpcp/3iWNaNZFxpWZ leCDlPjdNnLrG/6qYe+EopgTH+gTvNqBmkS/19oxrD5YYE3ldcqhNNvpS+QA6xsyonO+ Txo8pA+npGaxfgKk5HzWjwrlU1K+MudqMI/n1+PEsdzkkvkTTwUal0gWIReciJZMo05T 6Yhw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Edo4YSD6AKS3MQf0k+r4USSRl1cHKHtSqXCo8dExYJ4=; b=b2QljYvrkkdeTijFlaAW9nz5faJdquMaEcInSaNTG1CSC19pGr8LC2hTY8qzAw8q9x cepty/xXxfWoIbQTP9BSsIPqX8mKkCpzorcwdb/zQ6GQjw5xHES1Ml41sR5LzmI4IYmd GE3YQwMSHC0B/8S03Gsu8/XsnN9pkau/WCXjPFsKI1IPGcDKf43dY5zliyd/MusfgG2B xtEDO01ZSNoayp3+HxmoOsQnx4N6u8DyyO5K5IanP/kO5603CJnfug/UETvMejpSKR52 sAmhVYFmkPWfTK+BjmRO/z/o4xux4avFMbndr/k2kG3HJEqsMQ3KH8sB4vY8LHDsP/LR qzRA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=f2lfyvmS; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e29-20020aa798dd000000b00625e7f9b859si16573899pfm.339.2023.04.12.06.08.10; Wed, 12 Apr 2023 06:08:24 -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=@nxp.com header.s=selector2 header.b=f2lfyvmS; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231569AbjDLMuh (ORCPT + 99 others); Wed, 12 Apr 2023 08:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229578AbjDLMuQ (ORCPT ); Wed, 12 Apr 2023 08:50:16 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2066.outbound.protection.outlook.com [40.107.22.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B47017DAF; Wed, 12 Apr 2023 05:49:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CwUjx2YpoqH8cbcPD8uK83WF/Vfax87KZgVS0NgoWY9Xow34GREJvt4C9RcvsQ45eGbrXMYiuMcstNMu/+i+O4MKrzBNL1zU4KW7EnODEy7mlxUdQbEfZ7nNzhQGny6u/n20roJff/WbUkuj3+sERouTpTEUGQoLGTYxZNZFVpMkq028BGVr9TkVFmeKz0dNTzkypH9FcBSagweuELXpZ1p5I3tzKjWLQjFZYeSsXGW1TT8e1PTaIv7QyDrbwJH5bh+vF0T/2eQGmJitilB2qRWIgiKf4adW6G8bKU5qZn5FssF8LI3wloRj1dXHPzUl4dUpI/MulSqaKE9XrAvV/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Edo4YSD6AKS3MQf0k+r4USSRl1cHKHtSqXCo8dExYJ4=; b=oZKwASxVjWHXfHrB1NCEulHPdUPRS0KYOHx9zOHO7w2z4m2KLCBuvL8STWahsfgFofXv0vg4RMK1AB/RVv/WznRjAbbzxwCr60kpKD2Hdfh8+GDz8QED0OvuHjPMPg34J/Mduf904qzicW2+BVxt23fvCkz7MWP9AZqZNycHsNnOMBkr5TIw+Gj5QQh5w6C2HGP7gBriV34ch9mUtg7pZssKZgbJn5gukusMyxV+5DgXh6hYD7AJ8Msy2Eg5Fp66acyEzo3of4v4fuhOvVqCqr/A8FDQ4yJcoSyvvvDJEKvLdQW89zZrtne3Rj0baWxzGbzTjFvPYyZ+OtMfO8WZlA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Edo4YSD6AKS3MQf0k+r4USSRl1cHKHtSqXCo8dExYJ4=; b=f2lfyvmSwPJBfGzqDdV/0lDpULST+TtD2KXZqQPXyERoHIXWvN5pamJJNBNhoaHseEiGwy2x0EMkEAxPEAP2LFFuHJJdBTAVyxM7g14zD9RrPtcxb/hMa6Duz8Qc+uyK6Id/K14wuGGYfTtcbnd9mFwmXkTPJAp5r9cRBtJCR3s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM7PR04MB6888.eurprd04.prod.outlook.com (2603:10a6:20b:107::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Wed, 12 Apr 2023 12:47:58 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Wed, 12 Apr 2023 12:47:58 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , linux-kernel@vger.kernel.org Subject: [PATCH net-next 6/8] net: mscc: ocelot: strengthen type of "u32 reg" and "u32 base" in ocelot_stats.c Date: Wed, 12 Apr 2023 15:47:35 +0300 Message-Id: <20230412124737.2243527-7-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230412124737.2243527-1-vladimir.oltean@nxp.com> References: <20230412124737.2243527-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:800:5f::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM7PR04MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b0e9fa4-cd98-4880-5061-08db3b54249d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HGcd8HlKG3sK3iBapxtUFrzYkVDaBK8fZhrr+eLVfl+dOEjDx4cj3mA5SMuGEWMSgmMD2ypoaFYqEvSK6l8UP4P4l43jjuKqEsKNzIP/c7yv0LObKv/Sf/09u9SAcd7We2xmL9V/x4x2pPEmY31zH2yAKfREn8xivGD+pSJ8CdoA6DRbtSntw1YSCkGSrQ+W+9GcSJUhRVrlEb/5HqY5IRoAMXWCBEwaEpufDpe0RGeIBR+DipaPdVyXDuRe1jm8jutXkJfL+QwOszLCgHNbbJtas1IVYllpECd9vgb71Bxl31AJ8ZxFbecKwKSZsk+GqcKfFSSIIovR/7+ee7iyWamgBak2Jkzs0k6ReFpDPdvmIJMW04uaqODTKqKtXZHERVkI1MV6sW1t/4kWnvgonmD+Uqo3cxwS6UnAttIOtcHBL4I2oSm6DBcub+BnRngbwl0V0O9atgQnx9A66mTe7yTymVZoHxw3N1f9i5qQwRJM3eZmsjq/706fnMqUtClDLOohnG4SMG+nxENBisppHkXshX92uj+NG6zGPCItWbe0x2Ajwy58Ah5MfqeN2z/YJKnJ2YxlVVIHNil8tIEFaUwHKdPZmKKSeT+2yrTnybXtLNtTWxPWF+QJlge2SdEG X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(478600001)(52116002)(86362001)(83380400001)(6512007)(36756003)(38350700002)(2616005)(38100700002)(316002)(2906002)(1076003)(6506007)(26005)(54906003)(44832011)(186003)(5660300002)(66476007)(6486002)(6666004)(6916009)(8936002)(66556008)(41300700001)(8676002)(7416002)(66946007)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8dhO3YkryxswivNc4FA0Y4SYjkuME6L0u8nqFiV4jFgsAxZ+39Hyj5CnrHphgImHouXsZrKkMAWQx9Wvn0eWxlYVrQ3gpC/0eRtdIUQC5ucy0Ko71AynVffQG88L88vAaJpCVQnqdSbbxAQMGEtiXB+dJ//DHKaej7OFkiZ7oK+LffFHv399zScNhMLLlO3Aul8+SZJvCmmJJbjMcqM/g49SXejrBeYe1/sxtc/zj6Ap+ZPZSSpm/G3EQPgIUAu4QttqnzBM0rnIsVAEWY6slvt6qDls+jxnX0u0utUh8mPqUceYIQzG2yePGjmrdECibiBchQ7lYV6L0qQR+b2vdO95o0nor/sDkMLQ8LW5dwNR/EsOSQtkMg8Cxje7NrRuh62Ne3ii6+fN3nAHldnlezcgVl1NwXfXQ+TetlgJREKgbovGMoYwDNZA1MotE02aHjwvxP6TIjJe6ZyXiutYfdiRq3PedSGsH6g3mQ5gBnYTwQn1b62372Mkj7oMJ/Uvj9uppjWogvuYA7Whx2ZdvlR98SZrxvijWL1KzSgXs3wAyoXK4b8LuZmsLFA9Kf8irzgD17vg5y7wMRkEBKp8lwzkzPjdHf7tVfeGduTL4PUNSJ7tqHncd8l4JgCVBOoKWGPTR3u1XJeXUTerKXMQ6VNhdhblxgHN2Y13mVD5q/G2THC8/cOJ4ENjLIf4ACiMW3EIIwmwiNQAtBkhBmKdOq3dnazLamjQM85/cQimhOu9Bm48XMbNaelaJg4Mr4hDu/yAa79bxscmEdmUIZzJEhNjmVHnyiteTKG1M5hXz02AAPc+lPNbgSHyM9cc93YyqUVBQcWbXwgKaIQhsfJvBfW0hSIKL9diqPm1aaL36d+dpjzzJMeFLJPNaieeUc06I4EpAi+hir7VPOilU9sa5deVhZAwagH6nwioSxDDVG5clRsQf2jeulH6YRyZRN8sOgRHtdMdH4S5KNjaLyjCVT6HtOQ88+5lNLRv+kN1f0o/KsezlUi1GyOqqs5GF2y7JJVlf3I3IeUDum/tE3TvhTxvUWLomELXStjgWraiXS75A02eFm00YMGdiorJ3kfiyyrDlyHgcHkSSoar4u1ocRr4BfcA0/axd7Cmt/aVDZneGWw1d5IFO0Ly+pC6qiLiBzmCIa29gTAdCNK9uvt6rp0Ag9FxImw7pSev28gQVR2LL4JlGta/jzhSvKKRUReNXMucwhyouKAV1YKI4eLJtnMKqaoh+8LOne7NgXNpEhTz4vfAvV3+5mOIMu1kVCWvDA26g3bvGh0QQwFODcspGbkVXwyl4GfjH9g3oL76JmGaa+9PbC7PHL8W1/VsYq/ZJSeQznYvUNJhP86oFfrbuqfVLcMhwI6BFMKQibntvzQWyxbG0277sKh2l2ZI7RbML2KU37owOu5rFZ7CCuqnHIgLSHjNS+cu2A1c43fNsXbCqgKeuYEFSp2tnjolQe7BVC3lKGUxFjnr8BlNxHYuNt7ulsZBXmPAyoN6iZkfzo8pNR8sf4R2lSDOpC03OYejnCD8afxYXMyuuOXBaQ8sPd5NL1CNWiVCjqU2wRkcFclb/07V66ecdHWmROXlqGo4CiMF9aQY1F95l6ESjF64WA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b0e9fa4-cd98-4880-5061-08db3b54249d X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 12:47:58.2457 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HsT6Mb40c5sQltI1xQ/VkBzIgtH40Ys4XmXmCDhRrbzBs5i6tRTEoZqKMXNGEzOe5OPb/klT0G6dSm2z7YQt/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6888 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762975970694455084?= X-GMAIL-MSGID: =?utf-8?q?1762975970694455084?= Use the specific enum ocelot_reg to make it clear that the region registers are encoded and not plain addresses. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- drivers/net/ethernet/mscc/ocelot_stats.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c index 99a14a942600..a381e326cb2b 100644 --- a/drivers/net/ethernet/mscc/ocelot_stats.c +++ b/drivers/net/ethernet/mscc/ocelot_stats.c @@ -145,7 +145,7 @@ enum ocelot_stat { }; struct ocelot_stat_layout { - u32 reg; + enum ocelot_reg reg; char name[ETH_GSTRING_LEN]; }; @@ -257,7 +257,7 @@ struct ocelot_stat_layout { struct ocelot_stats_region { struct list_head node; - u32 base; + enum ocelot_reg base; enum ocelot_stat first_stat; int count; u32 *buf; @@ -889,7 +889,7 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot) { struct ocelot_stats_region *region = NULL; const struct ocelot_stat_layout *layout; - unsigned int last = 0; + enum ocelot_reg last = 0; int i; INIT_LIST_HEAD(&ocelot->stats_regions); From patchwork Wed Apr 12 12:47:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 82461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp300364vqo; Wed, 12 Apr 2023 05:52:40 -0700 (PDT) X-Google-Smtp-Source: AKy350Zj9R+BSm0FK+AJ+oN3rFYbwH2XHNmMELIVr6wf0anJr2WNAxwImCpW5DH7L7GD1qzkdyi/ X-Received: by 2002:a17:90a:1c8f:b0:23d:4a40:e794 with SMTP id t15-20020a17090a1c8f00b0023d4a40e794mr3030160pjt.10.1681303960012; Wed, 12 Apr 2023 05:52:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681303959; cv=pass; d=google.com; s=arc-20160816; b=TKKV0bLwTfYypV8w4pgTgGXjoah/yJoEFFLCH6ABMNki7ljORTAGVr/TIQ5EYMVgAI 12dsurjInMBLsDoD8rfy1fzs8oM6IntmD+JTbMKVIxmy15hCV7uHMraDhlHTCGcMOhrq cnEY3f0C9BBRmlHnxXBYy2hV3RMSVLcArrl4vjf4Jy7r+RlKhBAXDBEy41vMhGE42N01 RFO0InmSxrAWXfvjygRoGogVFk8hdThLOKhIAqqbkMmccDtTYMLjySsKH1G+WWtLBEpj bGea1kcwLZaMoc55BZfsrKvdQSoT0t6Q0oP6lY+AUiyjrWZ0Qubhiz4/I+5b7rJ65pFM +7ZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=x0dzRqtPSO85rjzAqEo8rc0SJ1W5x9A0rEVVF5pPY4M=; b=A7WGzGoCoVsKzlSC19zctOOEXCfuDXHY/v1O2wFwQ1jJbfsFzwxTEVzSJJBQLtqn3e /5PfDI6hPtAfcYzU3Ay+15qvJoA/Kvqw19eSUww4M9gRnFPRlAGKwhLfh0JRF3jmaC8q GlgNLvW+FshC2zeMQwFttUv76LKSQVj3evUH8THxsPIuYQ/lQtgkR/l2ddxpx1HWpMYs T5qF36e07oU1rN/CqMbj9a4Eg3IQGj9r8uuRelIC2z4Bxn+A7WbDPX2lfEPjmF1r5RyR u+Rwmbh6zHw/bKWJ7LZBDHkI3lL9u4IuLWYlvz+JKc2FSrzWMOT3ZdCh5yEA1eY5WtyR aJTw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="P/wrJAh+"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t5-20020a17090a950500b0024664356ef7si1814770pjo.152.2023.04.12.05.52.27; Wed, 12 Apr 2023 05:52:39 -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=@nxp.com header.s=selector2 header.b="P/wrJAh+"; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231377AbjDLMuo (ORCPT + 99 others); Wed, 12 Apr 2023 08:50:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229946AbjDLMuR (ORCPT ); Wed, 12 Apr 2023 08:50:17 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2071.outbound.protection.outlook.com [40.107.22.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 535A29F; Wed, 12 Apr 2023 05:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jwQVAFCjtwrbnaApOPFK6LFOhqErZw/7pq8kVxub8G7NeDXd+EbbILgT2RnHwxc7Lbjd4td8IBaLtFf9F8FbFbj+xDfllq7ZGHcTxa6Xjyx7XwJiIBAq6Yycypu/b4kLF/Z6vN7ZSxDvztXBbkWhlGn9XehQ/IjmFi+GZhEOs0joKlHb3PO9ctLqKg0UpHjnYu/miu2flrrx5LbA9b0EEPllxPu2XhlzzlM2HL1ftTEIvXA6W7Pu4ojw7f63ooeFwE4XfbdEvV8G4j2I2E8I2NgXgGcqhMx+XpYHHxYjAf0q7jemUBWQh70Vu+pBZ6xa9JapHluAqeM2uMBmdKqANA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=x0dzRqtPSO85rjzAqEo8rc0SJ1W5x9A0rEVVF5pPY4M=; b=Q6xBlLrddJwcw+XrdVXmSCPrXNvzoecTIxegDOlflIPiMj2etAQhBewoLl6kdxzSC+2lV5QNP6KT5hCPG9PgNTVYRZXlvhdgdV1hzxo6tq8fPi8vH81FbojYLZLuRNNIZtEzVvCloXhemQXGDnJ4M0QyidfTkeQ2i06BRTN+IkzX/xQMS8jC9/gAmoOMj1eajXEgUa1b6fqXwym97lWz3guzBPqGSk1KmglIdv1U20rwP19XqUHSREVdkqngTlQNiACNtBOYsyHyxcWr6qbnIwo0nHT53bqrR1N8hlxQEOaCt0RE/zE9zcsZEfGG0OJWIN7SMlf/+MvCUh6Pd5bhhg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x0dzRqtPSO85rjzAqEo8rc0SJ1W5x9A0rEVVF5pPY4M=; b=P/wrJAh+dFMmvFN90M1G93o6RIPXvdelEWjYmItZy7oiP08Ngiwu0+7zIS80iv8MvUAqzviYk2Td6t9EVNl0HIz9D48FhM+T1I/l5pjn4hpVhaMILAEFxZIEDmvKkWlUgPbp43RlUXq60m6JhHdFlFjzK5nibugzyTZhcx3k0xM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM7PR04MB6888.eurprd04.prod.outlook.com (2603:10a6:20b:107::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Wed, 12 Apr 2023 12:47:59 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Wed, 12 Apr 2023 12:47:59 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , linux-kernel@vger.kernel.org Subject: [PATCH net-next 7/8] net: mscc: ocelot: strengthen type of "int i" in ocelot_stats.c Date: Wed, 12 Apr 2023 15:47:36 +0300 Message-Id: <20230412124737.2243527-8-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230412124737.2243527-1-vladimir.oltean@nxp.com> References: <20230412124737.2243527-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:800:5f::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM7PR04MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: 4f8d8014-7a77-4d6c-be60-08db3b54252e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xQlkxqbmf112VmdEIT63tOyXzcG3sJ99GN/6ABkm31zkjXij2B7LKRvEWxXzla6EkXIs6t4n3M4DIRN+82RjbDCok4D9/bcjP5FdrVMqeKdYUm+7RdhDYXLI5I0TZ8lnLRtZYj1Nevt0vK98kWeTIOb09EiY/Rw2D7/Q/biZ+tzQ0AaTbly+T+dm//qOj1GiDqFCLIvPx7XGC/e+YRViMqOHzBvTEX0JVEheS6YA7Z1DYMHV4eJncJs+nKFxXUFWm+qB/adVgu3Iy7ZG+eO2+bLmsJlu/B8mB9GFWyE3l9d2KCgdHzGhZ9RQMh9eTJhErDDGi6RlP++FXSeeeTaH3z0jsRqMHE+3xAUAqxGKz3bnljjvVI5IuvxrT/OZoGNrsJp4RNCNWF2C75qKqDlZu2fC9vADm7X7ToLvBlCAfTf5tx0u7LtcSPgUXrEwYCPMzqfLPozowI/nif6nJWwVaq/elTV/KX3Kw8soNmygnatF40ns7ZF2zhJdtJjoNp/r/Ylk9e1dLjNPSlH5/VzmmtJkr67yXTrQsCLz0SX4YQnyqcelaXh81zmzfNM6MFB3C6aDo89/AclRYOe8yJLA/qacYmtihB/xBZXlzRSUovLOWdFLUSMlU2tCjavWjW9E X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(478600001)(52116002)(86362001)(83380400001)(6512007)(36756003)(38350700002)(2616005)(38100700002)(316002)(2906002)(1076003)(6506007)(26005)(54906003)(44832011)(186003)(5660300002)(66476007)(6486002)(6666004)(6916009)(8936002)(66556008)(41300700001)(8676002)(7416002)(66946007)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iVgiBARO8K1FAnB8J8k5WgUB+N2YZ9XSbwMOPCEGw3yJVat1Qy4KsHETJGy401rk/0Eti9vFD73GpVnj20AcZyQm+1HIdvubt4hx/O160CfJkE0DOlhLi1qouADAzflMUZ+meEiObxcCOIkTBKqy/n7qZa8h8iyH3WhNcx1X2aRCS0Hx/vKvL4MLj8NBg7dcH4CHjEVXUNsFu1E2aEA367z3oX5iyue+Mz1ZzXxABipUTPuxzdIUgzcHyBycfVcJ5MunhvnbksJxCspEQqa67p9ZTp+kjLjMwSzsHua8eJCpVvY6brokHTFVQkL8DwEzMngFCqKMKNMHmjEyMVGDJVbluOndevXmpIIe32fBkXFZaiSXJMQ5qOfMVe4tIV+PXY31HqOHSjq2xpCJj7b6Il5Xls1dEI7mR9R/7TyETIjd2HIONnzzb9jjamOEjNmZUs7wkZS5MCWDaW/ZeqM+K8dfQ4T+Oe0tCmeDaELZEzcxk6NFaC4Pj/mG3PbEZhk5r8U4waXy7daRTB8uYUpj4vwik5MRtwR/S8wLo/+CQ7GxwDt+uzniChLcNMSzc6u1PD1CkBdXXEJnYZ7lWQ9NvApNq0kqGC0NklEaylQrAf9BsHcqVSqJ4XDk4l+6rTqX+RKXHYWV4Fsm+gF+wYgMdI6O8Bt3sFjri58QSP1A99H+GAeDs7lTMfIzjBJr6ILabxpu4xOHtjKLNHaswXlisowA/rXWPRam4ydF3tyKcubMOEIXYOkdXMbl0+I0wHY/lblsSbU+boAgSKUzGQZrTaxwVSsCgNds158u7Ukd2yISOWkv67D762XjXZr4dnWTdTmAwqrs7QYJt73T04gxKXHOWfUnp3G7l3n+B4hH3fK4g+VcJRxcBoO5VPKebV1OPFD5+1O7TR7hoI0E/TGryslJN2nrNZlH4Q9Y6WQpuPGPY2lRLE3dliuIu0v2FOZAiJG3txLKaQ3966LWC3lnHl+2dPFqj/+nvy2O6IKaozdmy00M7UqUw3mkcpSlBZty4G8NIVzrEZDPlVL1RDPoXo8L0pBMcS8SGifzXxkkQMPCJXRK40Kq43HGbUwIfH0tVd1+ToIuYh4imkR95C4ZThBHwzT50VWtMAwszVjPuJwK6b+Sov56ynTmCi+DhmdU9V6JZs8J2LFC49gyuIastwJB2urZnL+BhNdxImcgB78Z1QDpCbpBuk8NBnAUB51CscorDsFJFf6UrHEaRbQcNt+oCx0wfNwnFGvAlaHmTkuzdp/BedgqHuDACCm5qVAJLNMQa1HI+Y24xLYj13RxcBG91wdW+jFQYJH9pAGHYWuWWqvvP8bfF7h7Mpa+LhXSzrSC/ioDyREmU+tuBqc8Q6zYoamLsuhdDQUF3QMLm/xUHnwK0xIRROuWG1KS0CdWlhM8D3vk/4AQ8apAfrHpcoU9D56pmwP3Bzs45PEaRiKnqRKASflf6D43y7/aT2id54OgPfnYfUKn2QVHRvWgMAv/yGEuCna0zuzIJVgscFXUYrQDjTZNZY0skbuxDbG20AJydzEQSgWveiJee8/keDUbNk85z+KgTArOipn9HOKKpICee3/751loNjyAMEPDVOy2mmW5NeCvYBR0o00uHA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f8d8014-7a77-4d6c-be60-08db3b54252e X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 12:47:59.2064 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iaRinoSMQnHBn+96J6O8PhbLgYHZSx/2MzdLdVqEr8Jr8pI2nxc3i6LhjQrmOLruG/5TVSoiiW/Fof0Tc0AS8g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6888 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762974981083494041?= X-GMAIL-MSGID: =?utf-8?q?1762974981083494041?= The "int i" used to index the struct ocelot_stat_layout array actually has a specific type: enum ocelot_stat. Use it, so that the WARN() comment from ocelot_prepare_stats_regions() makes more sense. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- drivers/net/ethernet/mscc/ocelot_stats.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c index a381e326cb2b..e82c9d9d0ad3 100644 --- a/drivers/net/ethernet/mscc/ocelot_stats.c +++ b/drivers/net/ethernet/mscc/ocelot_stats.c @@ -395,7 +395,7 @@ static void ocelot_check_stats_work(struct work_struct *work) void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data) { const struct ocelot_stat_layout *layout; - int i; + enum ocelot_stat i; if (sset != ETH_SS_STATS) return; @@ -442,7 +442,8 @@ static void ocelot_port_stats_run(struct ocelot *ocelot, int port, void *priv, int ocelot_get_sset_count(struct ocelot *ocelot, int port, int sset) { const struct ocelot_stat_layout *layout; - int i, num_stats = 0; + enum ocelot_stat i; + int num_stats = 0; if (sset != ETH_SS_STATS) return -EOPNOTSUPP; @@ -461,8 +462,8 @@ static void ocelot_port_ethtool_stats_cb(struct ocelot *ocelot, int port, void *priv) { const struct ocelot_stat_layout *layout; + enum ocelot_stat i; u64 *data = priv; - int i; layout = ocelot_get_stats_layout(ocelot); @@ -890,7 +891,7 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot) struct ocelot_stats_region *region = NULL; const struct ocelot_stat_layout *layout; enum ocelot_reg last = 0; - int i; + enum ocelot_stat i; INIT_LIST_HEAD(&ocelot->stats_regions); From patchwork Wed Apr 12 12:47:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 82465 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp307876vqo; Wed, 12 Apr 2023 06:03:58 -0700 (PDT) X-Google-Smtp-Source: AKy350bFukz3WO00feQW3JpfhegEePJ5/2pnTzh1O1rPlJsMpt1gzW7cdYwQNwETSmorsICA5803 X-Received: by 2002:a17:902:ce8c:b0:1a6:7ed8:84f7 with SMTP id f12-20020a170902ce8c00b001a67ed884f7mr158511plg.20.1681304637850; Wed, 12 Apr 2023 06:03:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681304637; cv=pass; d=google.com; s=arc-20160816; b=1HrLkDeiQUU1c7xIxTTX+fRofl/gQFjO1ge2G8r/pk2bswnG84dZXakKZ4oWAm+glZ hBZBN1O1F5B7M3WIUuLfIGY2AhdPT8/LDozSDpVbhmxN+5twFHARY0mB6NUuZtcU67Xx WDZAhNsE0Cb//6R8sMMpjZBT+TMzjlk1etoUid6c27GpAUPDYchBf4n/VBYZ2mUiCGgD o8+I7JSXh54Q9jlhDyZW/JxGakhUKvLJtsGUqqzkacmnKkZeGzkMTzU0Bzxu5lGJoCVI U0CIoaLkm5ntOV/YLhieEcMpqW31XRKdOjK99ejdtS10i6iOv4YJRkq3348eXA1zIR3w VC1A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NnmNMpuh9UU9gdg3p3oYozM1mlgGEylNuPOANWgIrlk=; b=eCW0KKKFwrXjvY8UW/j6LcTZpX+AniRxIAerMDurCN/nEOm7YD4UYv3wnxAFNwz6D9 Y05sj0JwXgyJC1W4p2Dt/XQ0kOWs0ZI21zQvRjO0LNjbxAYxJTTLUtFjR23Owqpg9VSC 8wi0ds3MUakGdWBufRMoFA+sHzWyy52D9I0IG9Amxyf4qQzga0uMUTjXdIl+DFM/D3Ir Hxpd1MDE9C+etFaOdpJmiWQC4i6vA6KX+5vq+ciRQwDq8Icj2SjaurW58mf2z3r1WRHu sno8DnrpC1wWV/tP81pqXLkvIp0D8zirKPQt7w0B5f0WOSyJ/eE9f+6Hw0L087ljQXXa FVKA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=XbsQ2sCn; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lh11-20020a170903290b00b001a654453ef3si4838978plb.54.2023.04.12.06.03.45; Wed, 12 Apr 2023 06:03:57 -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=@nxp.com header.s=selector2 header.b=XbsQ2sCn; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); 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=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbjDLMuk (ORCPT + 99 others); Wed, 12 Apr 2023 08:50:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230241AbjDLMuT (ORCPT ); Wed, 12 Apr 2023 08:50:19 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2061a.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::61a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF91A2136; Wed, 12 Apr 2023 05:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jGMSPVXm6YkJzMykY44BFuMGA/HG4yKPe4ggbaiVTK8lP+D0imAN2ZReL596i/s58wcYvBDFHLcED4zwm+5Nk0uCouLXBc2AX/P8mrdFUSTItysOrqP/k1CBZ3aYSipp3ExwIbYHT5ZyrUfvWJ6/tMHc9GHmBOyhr8k//FljQHJ0tIvEkUjozH1F2GCrgrE5Jt8l15tPXfMRfXfP7QouUSyJutMuO7OaavzZ5XlOzreuKqfJAuAfo9LGpUib29vIlTeRYnd7P10pw0nX1x1Wh0kMhJQxMOHslFNh5j/p8UnxuTTWN9V81hmIAjeDicT4yXCNeDsMS6NsgtxU6jRQoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NnmNMpuh9UU9gdg3p3oYozM1mlgGEylNuPOANWgIrlk=; b=jiRtfoVg+lHFFfni/AQeqwWB/1YcvauqT15/NJphTk60XUsmj6FLsmSQO3TR/HOqbXUFGUitwlanT0D33lvrXMCB989QoP4v2skMp4z0QGjvwqWjRA9kdyrl3Pe6Y/f2X8ZaDJ7jrbLu6xwYUd9gJ5AxrUSTmFqmt22q2h8Vp5nYuC5FERzAMo5u/QumA+57CwjL8NCTZq6zRWjf3Y/z+DcAVCGvSbjb7vB9lTkY6bikOcfNigQ3kTUA/9XCb2IAMgcpR8Seo2mu6Vdsf4E1J69fZCJq0SKRrmC8iv413Y1aQ40po1tCunmlUlciWzsz9sg76wlsjnKXKq5iT5DJlg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NnmNMpuh9UU9gdg3p3oYozM1mlgGEylNuPOANWgIrlk=; b=XbsQ2sCnJ7EnYUG6R2nAlUeqUxTiQJH51mFDuiW6lHe041QLDqGtkRpKehtExZWxIn8hpAdnjiQZ7i/unpDCSWllo2q7uQkA9kNtWMjzFEQRIOQ8QF5P4lrOn/q1KDh+e0fhL8eN4OA6m4/MjUO2zsQcqabLheCgo5kqCGwo4zY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by AM7PR04MB6888.eurprd04.prod.outlook.com (2603:10a6:20b:107::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Wed, 12 Apr 2023 12:48:00 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::55b1:d2dd:4327:912b%5]) with mapi id 15.20.6298.028; Wed, 12 Apr 2023 12:48:00 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , linux-kernel@vger.kernel.org Subject: [PATCH net-next 8/8] net: mscc: ocelot: fix ineffective WARN_ON() in ocelot_stats.c Date: Wed, 12 Apr 2023 15:47:37 +0300 Message-Id: <20230412124737.2243527-9-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230412124737.2243527-1-vladimir.oltean@nxp.com> References: <20230412124737.2243527-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: VI1PR0701CA0056.eurprd07.prod.outlook.com (2603:10a6:800:5f::18) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|AM7PR04MB6888:EE_ X-MS-Office365-Filtering-Correlation-Id: dcee1635-8bd0-42da-f09a-08db3b5425c4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sI8B/2z+QKPv91tuZa+AsdCwSSoRiIic8SUxjWatlgqLW06eHoRUnmd+/EdVfVOOhVHhLh32+qZzQG5vF5mlAOR94U8Zvg4rILmkcjofDvAFM8OX/aW1hthPyZ5fD88SDZdYyYUrrPfKTqDzdMZxXruko1NZC1SAERpdom2lyaVjIRt0HPtUM3c/8eYPo+MeEMPrYeXrTW0y+DrBUCvCCZw/BvV6eGmA/b2+pKUMgXHIblqpIK5Wwe886x0YoArOorJfVvPVgNpWTPSfq94OsV+UjUMHqjBtqyf5GZHb7bVmJyIqce9W8QmPzYngRTlUTIcEwtSR+ZslJWRbPEzgiRWj8vSfbN4r/xI6ZkjidAPX3JZ+86SGBf96jX293nj/rtBkfne0yvmWk5LfXtnbb+Cgy3/wBvWQREFlApo4BqhJn9oausPimc3Dz4THd3bOe2c2zgLRMbOxYteseQNIolaUtPziaQVwmtNl1bMLoozSXF4GftBVn0bWhyGsPwFzvloFGR/rhv91lIkIDwAF2fQUouRJqQCYilKGTm59qLLNYQw3tOP3BR0RHPOEnwj/qM3ZywtY7C8K2Qc2sZq80HIWdzcXbSLlr8QkCkjDLcnrpdXLKrsmrbkp9aUu4lCy X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(451199021)(478600001)(52116002)(86362001)(83380400001)(6512007)(36756003)(38350700002)(2616005)(38100700002)(316002)(2906002)(1076003)(6506007)(26005)(54906003)(44832011)(186003)(5660300002)(66476007)(6486002)(6666004)(6916009)(8936002)(66556008)(41300700001)(8676002)(7416002)(66946007)(4326008);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MvYcJ0w9mNfEqgWnkMszceoffGuplbqLs9tJOENUMKQ59ijPOchw6KHhhJfF2a7jaPZsuj4+W0pTtHeCeX/3V4e1cHfmPzk2fo2Ph1QSiX1Tm7BTVPM7U1KJZmOg2cLXUOyWfbSC8qKAcbEwgbI8cCzyHbJ837cA+qpVF3CEvY8AAK/OOfCakYJ8/SPuu+jOh8/jfF/BD7qcXIAHrRTRiNI25UMN3K3ArfnyiB1753zrp53ptgtGnwj7TMF6GAwAJKQi8z9VoBkh5G8mmsPMxRuKDWEXqsHUeFde/UBSvizp4yJq3McXFxvkWwcA9CvT3BUztxg4n3SNAlGilGnEDUpxOWwz16qLlwoHMWYMaEw7PVxhuGAQylO+ilSit9n/TohDZHSF073eL/legQ1fTRqUSNi/cK1iCJ7WTwrrU51BhtGQN9iqdwB+4sFPaIm2Bj04illGJhgq2U52vhL59KSYFgob9g4u3inNThc5fRZw7EvOl23Et+9aUVy/v6OUjLMwejM0soAnLOxJ0XG2rg7osCj4UlPtJF2xQwxga2Dggd0pqrCICh5Z+k/wNcFY9gkAs+dQpHWE8S5V+J18gzO3WipP4HtTw676cCa4IdFHVW6zMeHzV4JAC++eFZwSJB7Pt9lVDQklh1/sqzhfN/994e6BtBCqQYDaHp3+m4AGRXyHzLJ7Xy3sIITC+UzgSImbCtWON3U/bN9aRFLD9iOlM747VN6OicVmUmYTTUo7j2rGywl2tA5eAh1pLSXVR1ig3uh9mdAZhTx5A8Se+CdghlAViK1T9SnvOz0lwzEqrGPURU5Mf0IueBr6l3iq3nqSN2EbpoTMXHbaEUN5xGZgQ51SE/KpEimZQ1nTyJ1tFsNf+tE0JPu6ZWDc8E2rZImvTmbrLn8y3JdFn/ueLjavAWYeN8rW9EFli1wgcvP96Htg3TZWkHgNlq+jyPeUYGpuvipV7dbtGJEprIeaJJJhV3IoFr9DN72rrsc/fFs++p5I2A3gF2QtafMjrhD0LnQCBgWTbzaxQBxhIsopfu3BRuyA/Yjdq4HwZV6k4um/pvoisnXUiBaK6ftpJ39WMqnJEv9bA1KkyCHInYUZ5agrFws1X6ufQKsMEWb/YUcOF7UwuP/4JNed7ZIp6z2a9ZBWRjKGDpfNmZDiULGzw44t4QjdqQZEvAIVSAPP+71pOIjJC1OVzpL8EdOyOxeKmrMJutiIyHwGY/HfUSie0E4jTxHJh8cC5rvX7n2v9XySws9lsXxugr/aqw7U3P2vbcE9+loiOpXv//w1QWeMCxNKi0qf4WCeMwg5z3lxK8ptXFHmlArj7JRGEw6iYK8JARLgBv94vnwRciGwSi6RTjRWbYd8xejXU7y7QZDmjXmfqEFsanBsHLkMJdNFEyrCN4x4V6bMWJlnx8BrTzSOKsNGpQPlXZwrZsdjq8v4Iq0mjpLvG+nIqF7abhvsJ97sViS05CHy3tCuqOduN24sZg+6DTrkiYiZ5kHcnIP+QTvuVqNn/2pl0sjFxr043Mg8rWZC2zVjNFDSrhnKajeqK/TOKVHeYbhwDDkHIJ8r0LccQgbCsLXD4a2HOMp6ZH9tgXJ+HpygPO/JzYnpiM9i6w== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dcee1635-8bd0-42da-f09a-08db3b5425c4 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 12:48:00.2235 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8cfa9IPEp/YWY4gQmGA5dKPUw937HsLYWAZwwXIR/gTH4+dTROIycKmRKDKhK4zXlTfwzZoAhuli4DnpHIb5BA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6888 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,SPF_HELO_PASS, T_SPF_PERMERROR,URIBL_BLOCKED autolearn=no 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762975691870293545?= X-GMAIL-MSGID: =?utf-8?q?1762975691870293545?= Since it is hopefully now clear that, since "last" and "layout[i].reg" are enum types and not addresses, the existing WARN_ON() is ineffective in checking that the _addresses_ are sorted in the proper order. Signed-off-by: Vladimir Oltean Reviewed-by: Jacob Keller --- drivers/net/ethernet/mscc/ocelot_stats.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/mscc/ocelot_stats.c b/drivers/net/ethernet/mscc/ocelot_stats.c index e82c9d9d0ad3..5c55197c7327 100644 --- a/drivers/net/ethernet/mscc/ocelot_stats.c +++ b/drivers/net/ethernet/mscc/ocelot_stats.c @@ -901,6 +901,17 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot) if (!layout[i].reg) continue; + /* enum ocelot_stat must be kept sorted in the same order + * as the addresses behind layout[i].reg in order to have + * efficient bulking + */ + if (last) { + WARN(ocelot->map[SYS][last & REG_MASK] >= ocelot->map[SYS][layout[i].reg & REG_MASK], + "reg 0x%x had address 0x%x but reg 0x%x has address 0x%x, bulking broken!", + last, ocelot->map[SYS][last & REG_MASK], + layout[i].reg, ocelot->map[SYS][layout[i].reg & REG_MASK]); + } + if (region && ocelot->map[SYS][layout[i].reg & REG_MASK] == ocelot->map[SYS][last & REG_MASK] + 4) { region->count++; @@ -910,12 +921,6 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot) if (!region) return -ENOMEM; - /* enum ocelot_stat must be kept sorted in the same - * order as layout[i].reg in order to have efficient - * bulking - */ - WARN_ON(last >= layout[i].reg); - region->base = layout[i].reg; region->first_stat = i; region->count = 1;