[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YsJsaLy5PDzMOvTo@tuxmaker.boeblingen.de.ibm.com>
Date: Mon, 4 Jul 2022 06:28:24 +0200
From: Vineeth Vijayan <vneethv@...ux.ibm.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: agk@...hat.com, snitzer@...nel.org, dm-devel@...hat.com,
oberpar@...ux.ibm.com, hca@...ux.ibm.com, gor@...ux.ibm.com,
agordeev@...ux.ibm.com, borntraeger@...ux.ibm.com,
svens@...ux.ibm.com, almaz.alexandrovich@...agon-software.com,
yury.norov@...il.com, linux@...musvillemoes.dk,
linux-s390@...r.kernel.org, ntfs3@...ts.linux.dev,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 1/4] s390/cio: Rename bitmap_size() as idset_bitmap_size()
On Sat, Jul 02, 2022 at 08:29:09PM +0200, Christophe JAILLET wrote:
> In order to introduce a bitmap_size() function in the bitmap API, we have
> to rename functions with a similar name.
>
> Add a "idset_" prefix and change bitmap_size() into idset_bitmap_size().
>
> No functional change.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> drivers/s390/cio/idset.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/s390/cio/idset.c b/drivers/s390/cio/idset.c
> index 45f9c0736be4..e1e77fe080bf 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,11 @@ 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;
> }
Thank you CJ for this patchset.
As pointed out by others, it would be great to directly use tthe
bitmap-APIs instead of having an intermediate patch, which renames the
functions. As you mentioned, it is minimal, but the otherway would be
better for maintainability.
> @@ -41,7 +41,7 @@ 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.34.1
>
Powered by blists - more mailing lists