usb: host: add missing const qualifier#103579
Closed
fabiobaltieri wants to merge 1 commit intozephyrproject-rtos:mainfrom
Closed
usb: host: add missing const qualifier#103579fabiobaltieri wants to merge 1 commit intozephyrproject-rtos:mainfrom
fabiobaltieri wants to merge 1 commit intozephyrproject-rtos:mainfrom
Conversation
bdb5c11 to
b6e6913
Compare
b6e6913 to
4c6c956
Compare
Add missing const qualifier, fix build issue found when building with
clang:
$ export ZEPHYR_TOOLCHAIN_VARIANT=llvm
$ west build -p -b native_sim/native tests/subsys/usb/device_next
...
zephyrproject/zephyr/subsys/usb/host/usbh_desc.c:16:6: error:
conflicting types for 'usbh_desc_is_valid'
16 | bool usbh_desc_is_valid(const void *const desc,
| ^
zephyrproject/zephyr/subsys/usb/host/usbh_desc.h:92:12:
note: previous declaration is here
92 | const bool usbh_desc_is_valid(const void *const desc,
| ^
Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
4c6c956 to
bcc66ed
Compare
|
tmon-nordic
approved these changes
Feb 5, 2026
Contributor
tmon-nordic
left a comment
There was a problem hiding this comment.
I don't know whether this or #103585 is better.
Member
|
I don't see what is the point of adding const to an arithmetic value return.. but you guys in the USB side can decide what you prefer :) |
Member
Author
Yeah I've opened this without thinking too much about it, your fix make way more sense. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Add missing const qualifier, fix build issue found when building with clang:
$ export ZEPHYR_TOOLCHAIN_VARIANT=llvm
$ west build -p -b native_sim/native tests/subsys/usb/device_next ...
zephyrproject/zephyr/subsys/usb/host/usbh_desc.c:16:6: error: conflicting types for 'usbh_desc_is_valid'
16 | bool usbh_desc_is_valid(const void *const desc,
| ^
/home/fabiobaltieri/zephyrproject/zephyr/subsys/usb/host/usbh_desc.h:92:12:
note: previous declaration is here
92 | const bool usbh_desc_is_valid(const void *const desc,
| ^