* [PATCH] tools/hex2hcd: fix musl compatibility
@ 2024-07-10 12:30 Rahul Sandhu
2024-07-10 14:17 ` bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Rahul Sandhu @ 2024-07-10 12:30 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Rahul Sandhu
The call to basename() relies on a GNU extension
to take a const char * vs a char *. Let's define
a trivial helper function to ensure compatibility
with musl.
Downstream gentoo bug: https://bugs.gentoo.org/926344
Fixes: #843
---
tools/hex2hcd.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/hex2hcd.c b/tools/hex2hcd.c
index e6dca5a81..42c95b759 100644
--- a/tools/hex2hcd.c
+++ b/tools/hex2hcd.c
@@ -285,6 +285,11 @@ static void ver_parse_file(const char *pathname)
prev->next = ver;
}
+static const char *helper_basename(const char *path) {
+ const char *base = strrchr(path, '/');
+ return base ? base + 1 : path;
+}
+
static void ver_parse_entry(const char *pathname)
{
struct stat st;
@@ -302,7 +307,7 @@ static void ver_parse_entry(const char *pathname)
}
if (S_ISREG(st.st_mode)) {
- ver_parse_file(basename(pathname));
+ ver_parse_file(helper_basename(pathname));
goto done;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: tools/hex2hcd: fix musl compatibility
2024-07-10 12:30 [PATCH] tools/hex2hcd: fix musl compatibility Rahul Sandhu
@ 2024-07-10 14:17 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2024-07-10 14:17 UTC (permalink / raw)
To: linux-bluetooth, rahul
[-- Attachment #1: Type: text/plain, Size: 2473 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=870104
---Test result---
Test Summary:
CheckPatch FAIL 0.71 seconds
GitLint PASS 0.87 seconds
BuildEll PASS 24.82 seconds
BluezMake PASS 1589.95 seconds
MakeCheck PASS 13.30 seconds
MakeDistcheck PASS 178.09 seconds
CheckValgrind PASS 254.21 seconds
CheckSmatch WARNING 356.62 seconds
bluezmakeextell PASS 120.00 seconds
IncrementalBuild PASS 1372.16 seconds
ScanBuild PASS 1008.59 seconds
Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
tools/hex2hcd: fix musl compatibility
ERROR:OPEN_BRACE: open brace '{' following function definitions go on the next line
#64: FILE: tools/hex2hcd.c:288:
+static const char *helper_basename(const char *path) {
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#65: FILE: tools/hex2hcd.c:289:
+ const char *base = strrchr(path, '/');$
WARNING:LINE_SPACING: Missing a blank line after declarations
#66: FILE: tools/hex2hcd.c:290:
+ const char *base = strrchr(path, '/');
+ return base ? base + 1 : path;
WARNING:LEADING_SPACE: please, no spaces at the start of a line
#66: FILE: tools/hex2hcd.c:290:
+ return base ? base + 1 : path;$
/github/workspace/src/src/13729245.patch total: 1 errors, 3 warnings, 19 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.
/github/workspace/src/src/13729245.patch has style problems, please review.
NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
tools/hex2hcd.c:135:26: warning: Variable length array is used.
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-07-10 14:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-10 12:30 [PATCH] tools/hex2hcd: fix musl compatibility Rahul Sandhu
2024-07-10 14:17 ` bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).