From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Alexander Potapenko <glider@google.com>
Cc: catalin.marinas@arm.com, will@kernel.org, pcc@google.com,
andreyknvl@gmail.com, aleksander.lobakin@intel.com,
linux@rasmusvillemoes.dk, yury.norov@gmail.com,
alexandru.elisei@arm.com, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, eugenis@google.com,
syednwaris@gmail.com, william.gray@linaro.org,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v7 1/5] lib/bitmap: add bitmap_{read,write}()
Date: Wed, 11 Oct 2023 20:59:59 +0300 [thread overview]
Message-ID: <ZSbinxApgdd+aif2@smile.fi.intel.com> (raw)
In-Reply-To: <20231011172836.2579017-2-glider@google.com>
On Wed, Oct 11, 2023 at 07:28:31PM +0200, Alexander Potapenko wrote:
> From: Syed Nayyar Waris <syednwaris@gmail.com>
>
> The two new functions allow reading/writing values of length up to
> BITS_PER_LONG bits at arbitrary position in the bitmap.
>
> The code was taken from "bitops: Introduce the for_each_set_clump macro"
> by Syed Nayyar Waris with a number of changes and simplifications:
> - instead of using roundup(), which adds an unnecessary dependency
> on <linux/math.h>, we calculate space as BITS_PER_LONG-offset;
> - indentation is reduced by not using else-clauses (suggested by
> checkpatch for bitmap_get_value());
> - bitmap_get_value()/bitmap_set_value() are renamed to bitmap_read()
> and bitmap_write();
> - some redundant computations are omitted.
I realized that the corner case with these functions is when agnostic user
wants to read / write > 32 bits at a time without ifdeffery applied.
At bare minimum this has to be documented explicitly, that callers
may have an issue of the above calls on 32-bit platforms.
--
With Best Regards,
Andy Shevchenko
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Alexander Potapenko <glider@google.com>
Cc: catalin.marinas@arm.com, will@kernel.org, pcc@google.com,
andreyknvl@gmail.com, aleksander.lobakin@intel.com,
linux@rasmusvillemoes.dk, yury.norov@gmail.com,
alexandru.elisei@arm.com, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, eugenis@google.com,
syednwaris@gmail.com, william.gray@linaro.org,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v7 1/5] lib/bitmap: add bitmap_{read,write}()
Date: Wed, 11 Oct 2023 20:59:59 +0300 [thread overview]
Message-ID: <ZSbinxApgdd+aif2@smile.fi.intel.com> (raw)
In-Reply-To: <20231011172836.2579017-2-glider@google.com>
On Wed, Oct 11, 2023 at 07:28:31PM +0200, Alexander Potapenko wrote:
> From: Syed Nayyar Waris <syednwaris@gmail.com>
>
> The two new functions allow reading/writing values of length up to
> BITS_PER_LONG bits at arbitrary position in the bitmap.
>
> The code was taken from "bitops: Introduce the for_each_set_clump macro"
> by Syed Nayyar Waris with a number of changes and simplifications:
> - instead of using roundup(), which adds an unnecessary dependency
> on <linux/math.h>, we calculate space as BITS_PER_LONG-offset;
> - indentation is reduced by not using else-clauses (suggested by
> checkpatch for bitmap_get_value());
> - bitmap_get_value()/bitmap_set_value() are renamed to bitmap_read()
> and bitmap_write();
> - some redundant computations are omitted.
I realized that the corner case with these functions is when agnostic user
wants to read / write > 32 bits at a time without ifdeffery applied.
At bare minimum this has to be documented explicitly, that callers
may have an issue of the above calls on 32-bit platforms.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-10-11 18:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-11 17:28 [PATCH v7 0/5] Implement MTE tag compression for swapped pages Alexander Potapenko
2023-10-11 17:28 ` Alexander Potapenko
2023-10-11 17:28 ` [PATCH v7 1/5] lib/bitmap: add bitmap_{read,write}() Alexander Potapenko
2023-10-11 17:28 ` Alexander Potapenko
2023-10-11 17:59 ` Andy Shevchenko [this message]
2023-10-11 17:59 ` Andy Shevchenko
2023-10-12 12:55 ` Alexander Potapenko
2023-10-12 12:55 ` Alexander Potapenko
2023-10-11 17:28 ` [PATCH v7 2/5] lib/test_bitmap: add tests for bitmap_{read,write}() Alexander Potapenko
2023-10-11 17:28 ` Alexander Potapenko
2023-10-11 18:02 ` Andy Shevchenko
2023-10-11 18:02 ` Andy Shevchenko
2023-10-12 13:22 ` Alexander Potapenko
2023-10-12 13:22 ` Alexander Potapenko
2023-10-11 17:28 ` [PATCH v7 3/5] arm64: mte: implement CONFIG_ARM64_MTE_COMP Alexander Potapenko
2023-10-11 17:28 ` Alexander Potapenko
2023-10-11 17:28 ` [PATCH v7 4/5] arm64: mte: add a test for MTE tags compression Alexander Potapenko
2023-10-11 17:28 ` Alexander Potapenko
2023-10-11 17:28 ` [PATCH v7 5/5] arm64: mte: add compression support to mteswap.c Alexander Potapenko
2023-10-11 17:28 ` Alexander Potapenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZSbinxApgdd+aif2@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=alexandru.elisei@arm.com \
--cc=andreyknvl@gmail.com \
--cc=arnd@arndb.de \
--cc=catalin.marinas@arm.com \
--cc=eugenis@google.com \
--cc=glider@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rasmusvillemoes.dk \
--cc=pcc@google.com \
--cc=syednwaris@gmail.com \
--cc=will@kernel.org \
--cc=william.gray@linaro.org \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.