From nobody Tue Dec 23 18:08:07 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 0B6C81400D; Wed, 27 Mar 2024 15:25:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711553102; cv=none; b=nOSevnazffvd8g5ufrXqGypS3yN7xd5ljyxJaUGGU+GyWXMAydgws0kSRzOBQOrUqf9zDcWskPp+NNWI9+cyMTKG/qUM7PCYjaY0l0sStkVXeEVx3yLHOg6gafnyOeFkPtze/Jwzc0vj7e6eOGPNekCJJPtbQ5HUAYce1XbG5gk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711553102; c=relaxed/simple; bh=XhZ6bVaz0heja5pJ245+oQPmkJzjXm3j6Oh0rJdWTWc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gp/NcdZ9kALa4ZhqE+aKiyIVQ3F/T0iNouJTblGRaNxK7aEQdRUSApQHxrl7Bx3pA7DVyfz6XoEA6APjxa8Ir1gvy5N0rEHcF+q+y67V2lgbkwvw3n8hJP0KKOdm4ndlfSHTvYAvmp48unsJ3eSWoBdTn1+eq2yW6Iplby9vaDE= 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=ZPptjEno; arc=none smtp.client-ip=198.175.65.19 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZPptjEno" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711553101; x=1743089101; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XhZ6bVaz0heja5pJ245+oQPmkJzjXm3j6Oh0rJdWTWc=; b=ZPptjEnoSpHwwSobRErvwTCBJLIaeG6EXzQBh9vzbAEuA2TS4d4DVff8 yur+lRBQW2l33JbmXTz1V/Th/EETYriNY2HtWRm6x0fU0Kb6EEEh8mMrW bNYNOfWPmdpK3XOvgvrMYEU+q5WBO78GMedWIWkzY8x7QwpacFuu0zmMw m8ECsixV0Df5bvqAJomqtEg+bitusWFu3ArK+9f5zqC/cK+/nc/A4lL79 Is82E3Cqm9wmcWkNiE0shgRq6LeMgmGSdvyv7MgrgYwKVrqu8p9+LjE8c 1ah72DrgNx4qHsDp1l3QKWRrDyt4uu5VJxkDdluTK95Pok99V/o5FmQhX Q==; X-CSE-ConnectionGUID: YO4eBI5gQCiImOpIDp57SQ== X-CSE-MsgGUID: Py4TlDgmQqqRPPAHbLhhVg== X-IronPort-AV: E=McAfee;i="6600,9927,11026"; a="6518174" X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="6518174" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Mar 2024 08:25:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,159,1708416000"; d="scan'208";a="16414199" Received: from newjersey.igk.intel.com ([10.102.20.203]) by fmviesa008.fm.intel.com with ESMTP; 27 Mar 2024 08:24:57 -0700 From: Alexander Lobakin To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Alexander Lobakin , Yury Norov , Alexander Potapenko , nex.sw.ncis.osdt.itp.upstreaming@intel.com, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Przemek Kitszel , Peter Oberparleiter Subject: [PATCH net-next v6 08/21] s390/cio: rename bitmap_size() -> idset_bitmap_size() Date: Wed, 27 Mar 2024 16:23:45 +0100 Message-ID: <20240327152358.2368467-9-aleksander.lobakin@intel.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240327152358.2368467-1-aleksander.lobakin@intel.com> References: <20240327152358.2368467-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Acked-by: Peter Oberparleiter 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[]; }; =20 -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; =20 - set =3D vmalloc(sizeof(struct idset) + bitmap_size(num_ssid, num_id)); + set =3D vmalloc(sizeof(struct idset) + + idset_bitmap_size(num_ssid, num_id)); if (set) { set->num_ssid =3D num_ssid; set->num_id =3D 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) =20 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)); } =20 static inline void idset_add(struct idset *set, int ssid, int id) --=20 2.44.0