Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp1152134lqs; Wed, 6 Mar 2024 07:44:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU/Wik9EwAEspGGGx/NW54cbcI6xrgCqt/IWSobqonRjpLzWEDPleLAlQt10LETi0A5RKmx7wgy3oslficPaK1BicuGRTT7u9aXkh8/Lg== X-Google-Smtp-Source: AGHT+IHYc28gQOddidg4139uW1FSpy0WuDEYJJlUMYNcFylPI8KbvyBNftJqOpvy/mQsVP8sfoqk X-Received: by 2002:a17:902:d903:b0:1dc:5efc:8498 with SMTP id c3-20020a170902d90300b001dc5efc8498mr4665317plz.56.1709739895844; Wed, 06 Mar 2024 07:44:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709739895; cv=pass; d=google.com; s=arc-20160816; b=BdNLI9tnpTdd2zwHykSYpVPSuzDfxQYVzUoxV24zW3fblvfsBgGeeG20kljh/Dk0HQ 6ucVz9VC4/eXHK6IXJeqjwnd4ZDtOIXGJYfZ+f1IDKM7Ixb+Ft49MU56LuGN0CGfo7nd Jmm5VA/dau21Nr7FZIFwtFJkM+kh3bXTitoucdIjXJKPSpMb4wsgFZcEjm4NcOVelFX7 pyo+5+S6ANLeBQP6de+BYRsKqus+6oUq0zZjK0mlYk1a6cgdB9GiVuGlcqm3StgMJKSK 1aRe275zUTZ7aEhGOx/jQl8UJy7u3E35oDNNzw/AnYg79hreTwBmo8Fy5VAjZWlIRHT3 Ktbw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=MYq2Ln/cYGg9mHiPcZf1m5ozgzbPmfufP7t0HGayXEU=; fh=iyFrHAa1nvVNcv0NXZMgV8yMCFDVLL9ReZmjzxphXWo=; b=g/NrXRT/wyKmqKwg2sAbg33Ipxe4mp5uGwKUpboZpQroo8FOlLUQbrCGya2tUCjEyW OInOaFdUwHih9aLcSzePKiJoeJVvkFUvNJcdEHny0MXx9M0n4xSFzwU10dyku5eIZijk QC7HgYp9ZH49JctA75bPxEySOvQR2T201XFfKMcROmVv7dy//viE5kUtMP4E5Ct5DHNx 7hUPOJrgjyWE8pi/ms98g/b0tUs9ci4za8neZn4XOl6sXjjps4tIFaVSGHGCkXFZjCgp 1nVSKYV66/HgJYvtNXhruQx9GZAloAry4NYJekkd4Zrcr9PO7BblcabYgTAKkNnQnDCW Bbnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OOcZi+Pv; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-94180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q1-20020a170902eb8100b001dc11f149d1si12387126plg.248.2024.03.06.07.44.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 07:44:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=OOcZi+Pv; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-94180-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94180-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CD2FFB223DB for ; Wed, 6 Mar 2024 15:43:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A686E135418; Wed, 6 Mar 2024 15:43:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="OOcZi+Pv" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7611B1353F5; Wed, 6 Mar 2024 15:43:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709739799; cv=none; b=TlqvQXj9eI8iVtN2/VI6gVGAxJEIdGZwwQWxPa/YmWIqurUg/S0hfkaOYF8J0MmJ3kTNoAJsNkPa3GimODxv9opLlfcfZtPvuQMOpsSpgGD0LaSSYa2+IY1coZkYQV+yeFgBP3GuN0QT1dOiAC5Kw+DtPEeacw9KkCMoJyOtaPU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709739799; c=relaxed/simple; bh=CdLAI+mWnl48rftVyLTtGfQFJM4I5eon+K0K+2xZeXo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=vFnPTHaxsAeCI8+bcbNohF5W8ETQCRLdwdX9ew0tbUTgbVMm9dm4UDKLL7GWH0AwDi7CJV2yYysMI6xVXYxPdn0E0WqqGHhA6RkWoxbfNizERrjOBFn/F5BJO9zFougK87dHJWPCtqwu2exzgZ1WdGCCrwCYv+EbAUxtp0DUFI4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=OOcZi+Pv; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id B42E140004; Wed, 6 Mar 2024 15:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709739795; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MYq2Ln/cYGg9mHiPcZf1m5ozgzbPmfufP7t0HGayXEU=; b=OOcZi+PvRqJOXRQte4KHieNLJdGYo88Y4btcN/OcBc+Ytvgx188h6khSW53VMo+IVL1Tay u+2U/0RkJwAtqKIPvBzY4bFONCgfSoJY4s+YpVRKnQGyrrVzRn2HbHNQZFI4T/3OkMddib tJ6TqyXn1Jub3h2Cpb6If3dUDcnSMk7sQB2B73LfCNfpOWoeDJEK+MbWdzE5nLKuMfAiQI qullN1y/jyU7TAOMbqMYUb8lb9hl70HdFalssK2GSF0o2yUC24gcAQEhvZwK40Mr8BpjZ4 kROknzsitHe6IaaPQt0kJNGoXx+itPF2FEtXJrgtUWpQJBF5q1TDhHIPxcTTIA== Date: Wed, 6 Mar 2024 16:43:11 +0100 From: Herve Codina To: Andy Shevchenko , Yury Norov Cc: Vadim Fedorenko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rasmus Villemoes , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Andrew Lunn , Mark Brown , Christophe Leroy , Thomas Petazzoni Subject: Re: [PATCH v6 4/5] net: wan: fsl_qmc_hdlc: Add runtime timeslots changes support Message-ID: <20240306164311.735ded83@bootlin.com> In-Reply-To: References: <20240306080726.167338-1-herve.codina@bootlin.com> <20240306080726.167338-5-herve.codina@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com Hi Andy, Yury, On Wed, 6 Mar 2024 15:43:04 +0200 Andy Shevchenko wrote: > On Wed, Mar 06, 2024 at 05:06:12AM -0800, Yury Norov wrote: > > On Wed, Mar 06, 2024 at 09:07:20AM +0100, Herve Codina wrote: > > ... > > > > + DECLARE_BITMAP(ts_mask_avail, 64); > > > + DECLARE_BITMAP(ts_mask, 64); > > > + DECLARE_BITMAP(map, 64); > > > > > + bitmap_from_u64(ts_mask_avail, ts_info->rx_ts_mask_avail); > > > + bitmap_from_u64(map, slot_map); > > > We've got a BITMAP_FROM_U64() for this: > > > > DECLARE_BITMAP(ts_mask_avail, 64) = { BITMAP_FROM_U64(ts_info->rx_ts_mask_avail) }; > > DECLARE_BITMAP(map, 64) = { BITMAP_FROM_U64(slot_map) }; > > This looks ugly. Can we rather provide a macro that does this under the hood? > > Roughly: > > #define DEFINE_BITMAP_64(name, src) \ > DECLARE_BITMAP(name, 64) = { BITMAP_FROM_U64(src) } > Well, the construction I used: DECLARE_BITMAP(foo, 64); ... bitmap_from_u64(foo, init_value); ... can be found in several places in the kernel. Having the DEFINE_BITMAP_64() macro can be a way to remove this construction but I am not sure that this should be done in this series. IMHO, a specific series introducing the macro and updating pieces of code in the kernel everywhere it is needed to replace this construction would make much more sense. Best regards, Hervé