* [PATCH] src: retain const qualifier from pointer
@ 2026-02-07 11:44 Rudi Heitbaum
2026-02-07 12:39 ` bluez.test.bot
2026-02-17 19:10 ` [PATCH] " patchwork-bot+bluetooth
0 siblings, 2 replies; 3+ messages in thread
From: Rudi Heitbaum @ 2026-02-07 11:44 UTC (permalink / raw)
To: linux-bluetooth; +Cc: rudi
Since glibc-2.43:
For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
pointers into their input arrays now have definitions as macros that
return a pointer to a const-qualified type when the in put argument
is a pointer to a const-qualified type.
https://lists.gnu.org/archive/html/info-gnu/2026-01/msg00005.html
fixes:
- warning: assignment discards 'const' qualifier from pointer target
type [-Wdiscarded-qualifiers]
---
src/shared/shell.c | 20 +++++++++++---------
src/textfile.c | 3 ++-
tools/hciattach_ath3k.c | 2 +-
3 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/src/shared/shell.c b/src/shared/shell.c
index f014d8f7c..78d58c513 100644
--- a/src/shared/shell.c
+++ b/src/shared/shell.c
@@ -525,6 +525,7 @@ static int cmd_exec(const struct bt_shell_menu_entry *entry,
wordexp_t w;
size_t len;
char *man, *opt;
+ const char *man2, *opt2;
int flags = WRDE_NOCMD;
bool optargs = false;
@@ -547,24 +548,24 @@ static int cmd_exec(const struct bt_shell_menu_entry *entry,
}
/* Find last mandatory arguments */
- man = strrchr(entry->arg, '>');
- if (!man) {
+ man2 = strrchr(entry->arg, '>');
+ if (!man2) {
opt = strdup(entry->arg);
goto optional;
}
- len = man - entry->arg;
+ len = man2 - entry->arg;
if (entry->arg[0] == '<')
man = strndup(entry->arg, len + 1);
else {
/* Find where mandatory arguments start */
- opt = strrchr(entry->arg, '<');
+ opt2 = strrchr(entry->arg, '<');
/* Skip if mandatory arguments are not in the right format */
- if (!opt || opt > man) {
+ if (!opt2 || opt2 > man2) {
opt = strdup(entry->arg);
goto optional;
}
- man = strndup(opt, man - opt + 1);
+ man = strndup(opt2, man2 - opt2 + 1);
optargs = true;
}
@@ -972,6 +973,7 @@ static char *cmd_generator(const char *text, int state)
static bool default_menu_enabled, menu_enabled, submenu_enabled;
static const struct bt_shell_menu *menu;
char *cmd;
+ const char *cmd2;
if (!state) {
index = 0;
@@ -1009,11 +1011,11 @@ static char *cmd_generator(const char *text, int state)
if (cmd || menu != data.main)
return cmd;
- cmd = strrchr(text, '.');
- if (!cmd)
+ cmd2 = strrchr(text, '.');
+ if (!cmd2)
return NULL;
- menu = find_menu(text, cmd - text, NULL);
+ menu = find_menu(text, cmd2 - text, NULL);
if (!menu)
return NULL;
diff --git a/src/textfile.c b/src/textfile.c
index 8188d2ebe..a83f40c4d 100644
--- a/src/textfile.c
+++ b/src/textfile.c
@@ -68,7 +68,8 @@ int create_filename(char *str, size_t size, const char *fmt, ...)
static int create_dirs(const char *filename, const mode_t mode)
{
struct stat st;
- char dir[PATH_MAX + 1], *prev, *next;
+ char dir[PATH_MAX + 1];
+ const char *prev, *next;
int err;
err = stat(filename, &st);
diff --git a/tools/hciattach_ath3k.c b/tools/hciattach_ath3k.c
index 0e4bbf04b..5dcee2e87 100644
--- a/tools/hciattach_ath3k.c
+++ b/tools/hciattach_ath3k.c
@@ -303,7 +303,7 @@ struct tag_info {
static inline int update_char_count(const char *buf)
{
- char *end_ptr;
+ const char *end_ptr;
if (strstr(buf, "[") == buf) {
end_ptr = strstr(buf, "]");
--
2.51.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: src: retain const qualifier from pointer
2026-02-07 11:44 [PATCH] src: retain const qualifier from pointer Rudi Heitbaum
@ 2026-02-07 12:39 ` bluez.test.bot
2026-02-17 19:10 ` [PATCH] " patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2026-02-07 12:39 UTC (permalink / raw)
To: linux-bluetooth, rudi
[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1051861
---Test result---
Test Summary:
CheckPatch PENDING 0.41 seconds
GitLint PENDING 0.36 seconds
BuildEll PASS 20.17 seconds
BluezMake PASS 653.50 seconds
MakeCheck PASS 18.47 seconds
MakeDistcheck PASS 242.36 seconds
CheckValgrind PASS 293.78 seconds
CheckSmatch WARNING 350.62 seconds
bluezmakeextell PASS 181.16 seconds
IncrementalBuild PENDING 0.38 seconds
ScanBuild PASS 1020.78 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):src/shared/shell.c: note: in included file (through /usr/include/readline/readline.h):
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] src: retain const qualifier from pointer
2026-02-07 11:44 [PATCH] src: retain const qualifier from pointer Rudi Heitbaum
2026-02-07 12:39 ` bluez.test.bot
@ 2026-02-17 19:10 ` patchwork-bot+bluetooth
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+bluetooth @ 2026-02-17 19:10 UTC (permalink / raw)
To: Rudi Heitbaum; +Cc: linux-bluetooth
Hello:
This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Sat, 7 Feb 2026 11:44:00 +0000 you wrote:
> Since glibc-2.43:
>
> For ISO C23, the functions bsearch, memchr, strchr, strpbrk, strrchr,
> strstr, wcschr, wcspbrk, wcsrchr, wcsstr and wmemchr that return
> pointers into their input arrays now have definitions as macros that
> return a pointer to a const-qualified type when the in put argument
> is a pointer to a const-qualified type.
>
> [...]
Here is the summary with links:
- src: retain const qualifier from pointer
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=450e99f0801f
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-17 19:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-07 11:44 [PATCH] src: retain const qualifier from pointer Rudi Heitbaum
2026-02-07 12:39 ` bluez.test.bot
2026-02-17 19:10 ` [PATCH] " patchwork-bot+bluetooth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox