U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <rv@rasmusvillemoes.dk>
To: "Simon Glass" <sjg@chromium.org>
Cc: <u-boot@lists.denx.de>,  "Tom Rini" <trini@konsulko.com>,
	 "Casey Connolly" <casey.connolly@linaro.org>
Subject: Re: [PATCH 6/8] string: add strcasestr()
Date: Wed, 08 Jul 2026 20:40:59 +0200	[thread overview]
Message-ID: <878q7luxxg.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <CAFLszTi58-YBJU=Z-Ab00xSTaaFGkibyogd4dP_whYv70MqOpQ@mail.gmail.com> (Simon Glass's message of "Thu, 02 Jul 2026 09:30:15 +0100")

On Thu, Jul 02 2026, "Simon Glass" <sjg@chromium.org> wrote:

> Hi Rasmus,
>
> On 2026-07-01T17:15:27, Rasmus Villemoes <rv@rasmusvillemoes.dk> wrote:
>> string: add strcasestr()
>>
>> While this is not likely needed by any 'real' driver code, a later
>> convenience addition to the 'config' command will need this. As usual,
>> the linker will throw it away if nothing actually uses it, so it
>> should have no size impact when not used.
>>
>> Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
>>
>> include/linux/string.h |  1 +
>>  lib/string.c           | 27 +++++++++++++++++++++++++++
>>  2 files changed, 28 insertions(+)
>
>> diff --git a/include/linux/string.h b/include/linux/string.h
>> @@ -77,6 +77,7 @@ extern __kernel_size_t strlen(const char *);
>>  #ifndef __HAVE_ARCH_STRNLEN
>>  extern __kernel_size_t strnlen(const char *,__kernel_size_t);
>>  #endif
>> +char *strcasestr(const char *, const char *);
>
> I've been trying to add proper function docs to newly added ones, so
> we can clearly see the behaviour. Despite these being well-known
> function, they sometimes differ in how they handle edge-conditions.
>
> Also you could group this with the strstr()/strnstr() declarations a
> few lines above, so it sits alongside its siblings.

Sure, I can move the declaration up. As for function docs, they exist,
but in string.c, which is also where the docs for str[n]str is (an
earlier patch had fixups for those). I see some kernel docs in
string.h, and I dunno which is preferred, but most, including the
sibling str[n]str ones, are in the .c file. So I'll leave it there.

Rasmus

  reply	other threads:[~2026-07-08 18:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 17:15 [PATCH 0/8] some string cleanup, and a tweak of the "config" command Rasmus Villemoes
2026-07-01 17:15 ` [PATCH 1/8] sh: clean up asm/string.h Rasmus Villemoes
2026-07-02  8:29   ` Simon Glass
2026-07-01 17:15 ` [PATCH 2/8] string: correct prototype of strchrnul() Rasmus Villemoes
2026-07-02  8:30   ` Simon Glass
2026-07-01 17:15 ` [PATCH 3/8] string: correct documentation for strstr and strnstr Rasmus Villemoes
2026-07-02  8:30   ` Simon Glass
2026-07-01 17:15 ` [PATCH 4/8] string: remove unused strswab() function Rasmus Villemoes
2026-07-02  8:30   ` Simon Glass
2026-07-01 17:15 ` [PATCH 5/8] string: remove more pointless __HAVE_ARCH_STR* Rasmus Villemoes
2026-07-02  8:30   ` Simon Glass
2026-07-01 17:15 ` [PATCH 6/8] string: add strcasestr() Rasmus Villemoes
2026-07-02  8:30   ` Simon Glass
2026-07-08 18:40     ` Rasmus Villemoes [this message]
2026-07-08 19:09       ` Tom Rini
2026-07-01 17:15 ` [PATCH 7/8] test: string: add test of new strcasestr() function Rasmus Villemoes
2026-07-02  8:30   ` Simon Glass
2026-07-01 17:15 ` [PATCH 8/8] cmd: config: allow simple filtering of output Rasmus Villemoes
2026-07-01 18:15   ` Tom Rini
2026-07-02  8:30   ` Simon Glass
2026-07-08 18:59     ` Rasmus Villemoes

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=878q7luxxg.fsf@rasmusvillemoes.dk \
    --to=rv@rasmusvillemoes.dk \
    --cc=casey.connolly@linaro.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.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