Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp135394rdb; Thu, 1 Feb 2024 04:34:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/IT10SFS6YfW5og6yZOjBcNyVpkwkjmD4TSyvHJck+E0LjMZtJSTAWedyB8ypqgG9BWFR X-Received: by 2002:a05:6808:3a16:b0:3bd:1fdc:eeaa with SMTP id gr22-20020a0568083a1600b003bd1fdceeaamr6526925oib.55.1706790844649; Thu, 01 Feb 2024 04:34:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706790844; cv=pass; d=google.com; s=arc-20160816; b=RIRnxJIbHwqUcPTulifhxaYowdCLdWDS3MxFkth9ay9PUr70Knac1AOy6qhNHUvMtl jjMzhyniARyL1GEDy1sYPOOB9SczwrGRHs0CZEFrLrfYiuLJcs5w0DLQhPHpRVQzTQS9 II6m11jllGWMTUh6VHHLXBDiqplDenmRyFJ1uZ9WSc8QogsU9IpOmc6ByI5fB8njyKBv 45LZICnzBm4i0n/asqEu+wBbkaLayHAeYgXxScO/1QdnjZ9I4HLhZQGAn1EGaqJnzM0x EGmk+d4PuWO4OhWpa1ThQUd+2EZrM0qzNKDcGASZn3MWQFQtAOcB5O6oVnztTM+70HtP L2jA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/5h4srct7CrITszYa5MfgpakJZoeexsDOnKXiUMjQg0=; fh=p/xkRM+sguiTkxhlGBvuZgC2C915r1Qct1PjZhc2YpY=; b=T8taIhlhgOluDX//j1C/JN2p+l/iHE8pTPEOe/IjLLcK+B/QUt1O9YGGmkZPSkK4I5 +RQgtmtWJrdUI8l+Kr8/i7BNRV/OMX7tbeHwn6AecqXK1YKvyOY//0mLjv2gSUmM8egm x08yJWkRk3OLKxg7kTijtvkzWNVshsknjLJYRrZh6AyLFdzgsFvKwRqx/0eVAEyp/FYX Ppqb6U3iPzL9aJfZxkxcB3gCEOZm3/s4AGJvttdKI7wfpuZVK1WPHKpC5lxXHdr9qC9v 1so/ZOAzhIWFd/YNzZEzTfSvNcmBFzgA1PLRmtL0C6X7QAkr42D1eOmxWJUQolr3lmDP XTvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R9Lm+VkL; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-48120-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48120-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCXqA4YwwqJieSwsEwzLu1DbACVweIcRYGXwaZRBfWkUdjWWEwart1yi+XtYqqaQYQ5cOPMphdXGgqDm6qClfHHBSV0dtRdfQt0SRPWw5Q== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bd6-20020a056a00278600b006dfed2328a1si796999pfb.382.2024.02.01.04.34.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 04:34:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48120-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=R9Lm+VkL; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-48120-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48120-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id A3C3B295C21 for ; Thu, 1 Feb 2024 12:27:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2E5A35B665; Thu, 1 Feb 2024 12:24:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="R9Lm+VkL" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.15]) (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 CC61C15F31F; Thu, 1 Feb 2024 12:24:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706790254; cv=none; b=s786pf+Njjr+mdrnFQ22Vt/s35X88nwoN2DdaceSKi1UsvU+6v0C0Ohb04CcozWdpMF3KsFA0OY1gopTbeKRoiq4/GxnWCcx57v8k/7unUr1sxxKbbKUyAgdHQtBR+1fRKcGp/2EEtSOlmunIPzm7oKMvFhzLiLGvvqhJ8Z37Lg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706790254; c=relaxed/simple; bh=RrkGElyKDU2amOPgV/R6WFmMaBoS19F9b8KUjyEMIuI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PITrRhVX/6OJpivrDjAKi+EMvsQ648UKm6G1QZQH/ty2/ZkDcu6mS7yMgKXfK90GKpuPsOLqQEW9clwr1wltUuCt/K7WjpPLyzQlBza1Xez4PmNw4xuTZ0TL1xDaMjG1p9w/0eckiYzh+cTUl/xNL85k1P6wkV7QqDHM+eapH8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=R9Lm+VkL; arc=none smtp.client-ip=198.175.65.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706790253; x=1738326253; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RrkGElyKDU2amOPgV/R6WFmMaBoS19F9b8KUjyEMIuI=; b=R9Lm+VkLaBp0EycZ0r6CQpXvBo9DdKj4Sr7CWOvgH418npjYK0ac1nPk HsXH02+L9wW86n6sydclap1cBB1SDX9rMHkN03oUQjR/F8PtzsfchV6lQ Pk1qv+2PqEVGGqWyo4PNvcf+PshzVyFKNfQChjTyYypU1gg+01OMdQ8Sv wzSQqfQI0Tyue7pP4nuqBsdkyooqCG9sJGhMBv0QZ2xsalAq4sgQO5Gaw K6P7WQx/oXdPnV8omQRBneJ9CY2NSq3TZtosO1QtpKW0A1qCO7Fq66WKT bnmZMUAAkRGBQxEP2AOcV3RshX68uovcEadFCKXbOIo55Ci9FHSInmedk w==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="3747031" X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="3747031" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2024 04:24:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,234,1701158400"; d="scan'208";a="4499111" Received: from newjersey.igk.intel.com ([10.102.20.203]) by orviesa004.jf.intel.com with ESMTP; 01 Feb 2024 04:24:08 -0800 From: Alexander Lobakin To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Lobakin , Michal Swiatkowski , Marcin Szycik , Wojciech Drewek , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Alexander Potapenko , Jiri Pirko , Ido Schimmel , Przemek Kitszel , Simon Horman , linux-btrfs@vger.kernel.org, dm-devel@redhat.com, ntfs3@lists.linux.dev, linux-s390@vger.kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next v5 08/21] s390/cio: rename bitmap_size() -> idset_bitmap_size() Date: Thu, 1 Feb 2024 13:22:03 +0100 Message-ID: <20240201122216.2634007-9-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240201122216.2634007-1-aleksander.lobakin@intel.com> References: <20240201122216.2634007-1-aleksander.lobakin@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit bitmap_size() is a pretty generic name and one may want to use it for a generic bitmap API function. At the same time, its logic is not "generic", i.e. it's not just `nbits -> size of bitmap in bytes` converter as it would be expected from its name. Add the prefix 'idset_' used throughout the file where the function resides. Reviewed-by: Przemek Kitszel Signed-off-by: Alexander Lobakin --- drivers/s390/cio/idset.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/s390/cio/idset.c b/drivers/s390/cio/idset.c index 45f9c0736be4..0a1105a483bf 100644 --- a/drivers/s390/cio/idset.c +++ b/drivers/s390/cio/idset.c @@ -16,7 +16,7 @@ struct idset { unsigned long bitmap[]; }; -static inline unsigned long bitmap_size(int num_ssid, int num_id) +static inline unsigned long idset_bitmap_size(int num_ssid, int num_id) { return BITS_TO_LONGS(num_ssid * num_id) * sizeof(unsigned long); } @@ -25,11 +25,12 @@ static struct idset *idset_new(int num_ssid, int num_id) { struct idset *set; - set = vmalloc(sizeof(struct idset) + bitmap_size(num_ssid, num_id)); + set = vmalloc(sizeof(struct idset) + + idset_bitmap_size(num_ssid, num_id)); if (set) { set->num_ssid = num_ssid; set->num_id = num_id; - memset(set->bitmap, 0, bitmap_size(num_ssid, num_id)); + memset(set->bitmap, 0, idset_bitmap_size(num_ssid, num_id)); } return set; } @@ -41,7 +42,8 @@ void idset_free(struct idset *set) void idset_fill(struct idset *set) { - memset(set->bitmap, 0xff, bitmap_size(set->num_ssid, set->num_id)); + memset(set->bitmap, 0xff, + idset_bitmap_size(set->num_ssid, set->num_id)); } static inline void idset_add(struct idset *set, int ssid, int id) -- 2.43.0