Received: by 2002:ab2:6991:0:b0:1f2:fff1:ace7 with SMTP id v17csp129819lqo; Wed, 27 Mar 2024 08:41:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUctXiuSJ/FK/sodZg6OncP6ahODfXjMjg8bnAE5rWteFBV8apv/xFITuyAUCFFIkBHI86dOTTPadSjdOamiQ1tZhyb36DpQbOoC/sCVw== X-Google-Smtp-Source: AGHT+IGK6wFMsNZ4BSttEeWXatQRLcbqOb3xWI8bS0IJ+PFkCbhClahYQ84XsN9CVryarfpZ4kXS X-Received: by 2002:a17:903:98f:b0:1e0:58e:88a8 with SMTP id mb15-20020a170903098f00b001e0058e88a8mr47507plb.52.1711554095138; Wed, 27 Mar 2024 08:41:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711554095; cv=pass; d=google.com; s=arc-20160816; b=JziGHmSZZ9LAd24zkf4n6bp5e+IajzLNfYag7TnQRyaQti1kTS2FLolVXTFSrR/Z3y 5eU7V7BpG2b/CLc3poUdh4qdaNR7O80/jLHMrhUwNrUwTqTg/SBaXr1w/y977umKUOsV 29rU9S00gA87h9BzlrkFSVjwtX6PefRnHHLP9A9uO0uy91AR0oUZP7eCxJEvv9I4N1p1 6jZBLZi7h9HY34n+YaW35Zddx20NK6jJ6ntFqCFcZ6LvMRTFdYwCM/z4tQKrnYq51YOC Sicwsrw93o2eS53CwxzbMrRt4Mm5ho1sWfhP+9kCjAa61s5AjrnUUXjusCKODXZMNDek YWFg== 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=pQfBPn2mNWu5L6yP9I9dNEGncIJwYujA6wr5jDK5vaI=; fh=iR3ciwCb5iDcrUQFpcV3e745qZHk3eZODSIng/BWkO0=; b=D1qwZk4QLg+n4pW4gIIb1xZfMb6x7WZIngIHJpttVBBPyQrZgUG2iJFOVNK1eNV+Uj vDu23KDBtzqXpGmiOnz8J6whcE8EnsNjX/2fQKclUfTO475sknhlIoUbCFOxSxiG0oT6 pn4JNNtZY3USK6ZQu32NdQtWgIkmzYnyBU2BHHCV0GtWftznPPMLm+f4KfUdbNUGLsTU KJPpwe39oc9YY1BpGtHCnW5EnbVxxMKfy3eFG7pz32aFQLf5wEPCDZo3fjz1YumCM9D1 QJEG2DZ/LgIcaDElZbaMFpTkMh4Vc1vrSMMHPtENXdUBxQKfSmwETdzXBX6ZQCyy6yP7 akyw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ZPptjEno; 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-121518-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121518-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s8-20020a170902ea0800b001ddda950756si10091594plg.99.2024.03.27.08.41.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 08:41:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-121518-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=ZPptjEno; 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-121518-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-121518-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 230DA2922D6 for ; Wed, 27 Mar 2024 15:33:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7A21D12A14E; Wed, 27 Mar 2024 15:25:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZPptjEno" 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 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: 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 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[]; }; -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.44.0