From: sashiko-bot@kernel.org
To: "Alejandro Colomar" <alx@kernel.org>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] accel/habanalabs: Add missing const
Date: Wed, 25 Nov 2026 17:47:57 +0000 [thread overview]
Message-ID: <sashiko-outbox-233859@kernel.org> (raw)
In-Reply-To: <a284672589d00aa039a8c53ccf43bd1a5fd8e8f9.1795628340.git.alx@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] accel/habanalabs: missing const on ch in
extract_u32_until_given_char()
--
commit fd205b9061bdb9d6cd798164f715276c74b998b2
Author: Alejandro Colomar <alx@kernel.org>
accel/habanalabs: Add missing const
This commit adds const qualifiers to firmware version string pointers
derived from const char * inputs in firmware_if.c.
> diff --git a/drivers/accel/habanalabs/common/firmware_if.c b/drivers/accel/habanalabs/common/firmware_if.c
> index 29f5652d60433..69d39a8789d4c 100644
> --- a/drivers/accel/habanalabs/common/firmware_if.c
> +++ b/drivers/accel/habanalabs/common/firmware_if.c
[ ... ]
> @@ -112,7 +113,7 @@ static char *extract_fw_ver_from_str(const char *fw_str)
> *
> * Return: Upon success, return a pointer to the given_char in the string. Upon failure, return NULL
> */
> -static char *extract_u32_until_given_char(char *str, u32 *ver_num, char given_char)
> +static const char *extract_u32_until_given_char(const char *str, u32 *ver_num, char given_char)
> {
> char num_str[8] = {}, *ch;
[Severity: Low]
Should ch also be declared as const char *? It receives the result of
strchrnul(str, given_char) on the now-const str and is returned directly,
so leaving it non-const will trigger a -Wdiscarded-qualifiers warning once
strchrnul() preserves const.
--
Sashiko AI review · https://sashiko.dev/#/patchset/a284672589d00aa039a8c53ccf43bd1a5fd8e8f9.1795628340.git.alx@kernel.org?part=1
next prev parent reply other threads:[~2026-11-25 17:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 17:39 [PATCH] accel/habanalabs: Add missing const Alejandro Colomar
2026-11-25 17:47 ` sashiko-bot [this message]
2026-11-25 18:13 ` Alejandro Colomar
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=sashiko-outbox-233859@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=alx@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.