Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kconfig: Add dt_compat_any_not_has_prop function #82806

Conversation

decsny
Copy link
Member

@decsny decsny commented Dec 10, 2024

Add preprocessor function that returns 'y' if any enabled node with compat does NOT have a certain property. This is different from using dt_compat_any_has_prop to check that they ALL don't have the property.

Add preprocessor function that returns 'y' if any enabled node with
compat does NOT have a certain property. This is different from using
dt_compat_any_has_prop to check that they ALL don't have the property.

Signed-off-by: Declan Snyder <[email protected]>
@henrikbrixandersen
Copy link
Member

I find dt_compat_any_not_has_prop difficult to read. How about something like dt_compat_not_all_has_prop?

@decsny
Copy link
Member Author

decsny commented Dec 10, 2024

I find dt_compat_any_not_has_prop difficult to read. How about something like dt_compat_not_all_has_prop?

another option I was considering is to use the dt_compat_any_has_prop function and add a fourth boolean parameter to "invert" the logic? thoughts?

@henrikbrixandersen
Copy link
Member

I find dt_compat_any_not_has_prop difficult to read. How about something like dt_compat_not_all_has_prop?

another option I was considering is to use the dt_compat_any_has_prop function and add a fourth boolean parameter to "invert" the logic? thoughts?

I'd prefer separate functions instead of breaking the existing API.

@decsny
Copy link
Member Author

decsny commented Dec 16, 2024

I find dt_compat_any_not_has_prop difficult to read. How about something like dt_compat_not_all_has_prop?

another option I was considering is to use the dt_compat_any_has_prop function and add a fourth boolean parameter to "invert" the logic? thoughts?

I'd prefer separate functions instead of breaking the existing API.

How would that break the existing API? We have done something like this multiple times in the past with these kconfig functions by adding another optional parameter

@henrikbrixandersen
Copy link
Member

I find dt_compat_any_not_has_prop difficult to read. How about something like dt_compat_not_all_has_prop?

another option I was considering is to use the dt_compat_any_has_prop function and add a fourth boolean parameter to "invert" the logic? thoughts?

I'd prefer separate functions instead of breaking the existing API.

How would that break the existing API? We have done something like this multiple times in the past with these kconfig functions by adding another optional parameter

An optional parameter is something else. You didn't say "optional" in your original comment.

@kartben kartben merged commit cc620a3 into zephyrproject-rtos:main Dec 16, 2024
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants