From: Rasmus Villemoes <ravi@prevas.dk>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
Alexander Sverdlin <alexander.sverdlin@siemens.com>,
Caleb Connolly <caleb.connolly@linaro.org>,
Francis Laniel <francis.laniel@amarulasolutions.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Ion Agorria <ion@agorria.com>,
Jerome Forissier <jerome.forissier@linaro.org>,
Marek Vasut <marex@denx.de>,
Martyn Welch <martyn.welch@collabora.com>,
Mattijs Korpershoek <mkorpershoek@baylibre.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Oliver Gaskell <Oliver.Gaskell@analog.com>,
Patrice Chotard <patrice.chotard@foss.st.com>,
Peter Robinson <pbrobinson@gmail.com>,
Quentin Schulz <quentin.schulz@cherry.de>,
Raymond Mao <raymond.mao@linaro.org>,
Robert Marko <robert.marko@sartura.hr>,
Sam Protsenko <semen.protsenko@linaro.org>,
Sughosh Ganu <sughosh.ganu@linaro.org>,
Sumit Garg <sumit.garg@linaro.org>,
Svyatoslav Ryhel <clamor95@gmail.com>,
Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH 0/8] membuff: Add tests and update to support a flag for empty/full
Date: Fri, 18 Oct 2024 09:05:21 +0200 [thread overview]
Message-ID: <87jze5ao26.fsf@prevas.dk> (raw)
In-Reply-To: <20241018030027.842749-1-sjg@chromium.org> (Simon Glass's message of "Thu, 17 Oct 2024 21:00:19 -0600")
On tor, okt 17 2024, Simon Glass <sjg@chromium.org> wrote:
>
> membuf: Support a flag for being full
>
No, that is the worst of all worlds, especially with it being a
build-time flag. The right implementation is the one where the head and
tail indices are free-running, where you get such a "flag" for
free, because you're not wasting the top bits of the indices.
https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/
If you want to do the churn of renaming anyway, I suggest doing it by
adding an implementation using the proper scheme under the new name,
switch users over, and dropping the old. IMO, this series as-is brings
no value (except for the tests, of course).
Rasmus
next prev parent reply other threads:[~2024-10-18 7:05 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-18 3:00 [PATCH 0/8] membuff: Add tests and update to support a flag for empty/full Simon Glass
2024-10-18 3:00 ` [PATCH 1/8] membuff: Rename functions to have membuf_ prefix Simon Glass
2025-03-04 15:37 ` Simon Glass
2024-10-18 3:00 ` [PATCH 2/8] membuff: Rename the files to membuf Simon Glass
2024-10-18 3:00 ` [PATCH 3/8] membuf: Rename struct Simon Glass
2025-03-04 15:37 ` Simon Glass
2024-10-18 3:00 ` [PATCH 4/8] membuf: Include stdbool Simon Glass
2025-03-04 15:37 ` Simon Glass
2024-10-18 3:00 ` [PATCH 5/8] membuf: Correct implementation of membuf_dispose() Simon Glass
2025-03-04 15:37 ` Simon Glass
2024-10-18 3:00 ` [PATCH 6/8] membuf: Add some tests Simon Glass
2025-03-04 15:37 ` Simon Glass
2024-10-18 3:00 ` [PATCH 7/8] membuf: Minor code-style improvements Simon Glass
2025-03-04 15:36 ` Simon Glass
2024-10-18 3:00 ` [PATCH 8/8] membuf: Support a flag for being full Simon Glass
2025-03-04 15:36 ` Simon Glass
2024-10-18 7:05 ` Rasmus Villemoes [this message]
2024-10-18 14:55 ` [PATCH 0/8] membuff: Add tests and update to support a flag for empty/full Simon Glass
2025-03-04 15:35 ` Simon Glass
2025-03-04 18:55 ` Rasmus Villemoes
2025-03-05 13:53 ` Simon Glass
2025-03-06 14:21 ` Rasmus Villemoes
2025-03-06 16:07 ` Simon Glass
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=87jze5ao26.fsf@prevas.dk \
--to=ravi@prevas.dk \
--cc=Oliver.Gaskell@analog.com \
--cc=alexander.sverdlin@siemens.com \
--cc=caleb.connolly@linaro.org \
--cc=clamor95@gmail.com \
--cc=francis.laniel@amarulasolutions.com \
--cc=ilias.apalodimas@linaro.org \
--cc=ion@agorria.com \
--cc=jerome.forissier@linaro.org \
--cc=marex@denx.de \
--cc=martyn.welch@collabora.com \
--cc=mkorpershoek@baylibre.com \
--cc=neil.armstrong@linaro.org \
--cc=patrice.chotard@foss.st.com \
--cc=pbrobinson@gmail.com \
--cc=quentin.schulz@cherry.de \
--cc=raymond.mao@linaro.org \
--cc=robert.marko@sartura.hr \
--cc=semen.protsenko@linaro.org \
--cc=sjg@chromium.org \
--cc=sughosh.ganu@linaro.org \
--cc=sumit.garg@linaro.org \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox