-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: console: Kconfig: Remove redundant 'default n' properties #8577
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
drivers: console: Kconfig: Remove redundant 'default n' properties #8577
Conversation
Bool symbols implicitly default to 'n'. A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you want to override a 'default y' on the base definition of the symbol. It isn't used like that on any of these symbols though. Signed-off-by: Ulf Magnusson <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #8577 +/- ##
==========================================
- Coverage 63.97% 63.96% -0.01%
==========================================
Files 429 429
Lines 41290 41290
Branches 6957 6957
==========================================
- Hits 26414 26413 -1
- Misses 11719 11720 +1
Partials 3157 3157
Continue to review full report at Codecov.
|
pfalcon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bool symbols implicitly default to 'n'.
This may be obvious to the maintainer of kconfiglib, but not to mere humans, users of Zephyr. I don't think that we should optimize for the tool, but instead for humans, and those "default n" are useful documentation for them.
It's inconsistent now, which I think confuses people about how it works ("there's a I think that's how those I've updated the auto-generated documentation to say "No defaults. Implicitly defaults to Another motivation is wanting to get rid of Zephyr's prefer-later-defaults behavior and go back to standard Kconfig behavior. That will be smoother to implement with less redundant defaults. |
|
Put another way, with no |
Yes, that's how it works, with people. Having too much implicit stuff (to keep in mind) is counter-human. Humans try to deconfuse it with "explicit is better than implicit" principle.
Again, for humans, too much implicit stuff is more complex. Why for example you don't propose an alternative of having explicit "default n" and "default y" everywhere? Anyway, technical Kconfig-specific reasons you give seems to make sense. But nobody knows about them. You remove "default n", and here're are recent new patches which have them again: https://github.com/zephyrproject-rtos/zephyr/pull/8620/files#diff-29344602dce088feb8b8d20ad0d70ba0R46 , #7118 , etc. |
|
@pfalcon I was thinking of turning it into a style warning later. For the moment, it's mostly to investigate all the defaults to see which ones are essential. That will make it easier to turn them around later when getting rid of the prefer-later-defaults behavior. |
|
@ulfalizer: But you don't answer the main concern there - that you, effectively, make the changes behind other people's back, so they're not aware of your changes and keep doing it in the "has-been-normal" way.
I dread hearing this. We rely on ability to override one setting with another. And it's already worrying that a warning is issued in this case currently. I'm not sure how "defaults" relate to being able to override one value of an option to another, but in my list, directly, so it's all very worrying. Again, please consider keeping the Zephyr community in loop on your anticipated changes (the standard way to do that is sending RFC mail(s) to the devel mailing list). |
|
@pfalcon Instead of including the I'm still not sure what motivated that patch in the first place. Might've been a Kconfig misunderstanding, or some limitation in the C tools. Whoever originally added that patch to the C tools forgot to make the behavior consistent for other properties as well, so it's a bit of a mess now. At least @carlescufi and @SebastianBoe are in on the patch-removal thing. We'll make sure to tell people before the switch (unlike the original patch, which was completely undocumented until I documented it :P). |
|
Re. the |
|
@ulfalizer : I appreciate your detailed responses. And while your changes look as bordering on causing issues in cases you might not anticipate (e.g. in third-party projects integrating with Zephyr), I have to admit that so far they caused need to clean up stuff and didn't break anything. I trust that it'll be ok too. My suggestion to try to keep wider developer audience in loop via posting RFCs to the devel mailing list remains though. (You may not even get a reply, but you'll know that you did everything from your side - e.g. after such a post and no objections, you can go and give -1 to new PR introducing "default n"). Anyway, I'm removing my -1 here (especially given that this change was split among few PRs, the rest of which was already merged). |
Dismissing based on the discussion and the fact that this change is already done in other places.
|
@pfalcon @SebastianBoe suggested ignoring compatibility and telling people to switch the defaults around before upgrading to the Zephyr version that gets rid of the patch. That would make things a whole lot easier for sure. |
|
Hmm... one pretty simple solution would be to print a warning about the changed behavior whenever a third-party project is detected (should be possible somehow), and make the warning easy to disable (e.g. by Could keep the warning around for a release or two. That should be enough for people to see it, even if they don't check the mailing list. |
To clarify, my reference about 3rd-party projects is related to overriding of defaults rather than the topic of this patch. And in a 3rd-party project, I want to be able to put anything in prj.conf and don't get an error (e.g. because it overrides something which was "set" before). This is especially important, because many 3rd-party projects are interested in the general "OS" nature of Zephyr, not peculiarities like support of particular hardware or hardware's feature. As a third-party software developer, I want to provide my user with the ability to build a project for any hardware supported by Zephyr - and with a single config. (And this config may override option set for a particular hardware in Zephyr.) Hope that clarifies my concern. Anyway, that's a bit offtopic to discuss in this ticket. |
pfalcon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I'm set as the only reviewer so far, approving.
|
@pfalcon I added some documentation that explains the difference between Had to reverse-engineer it myself. Not exactly obvious. |
Bool symbols implicitly default to 'n'.
A 'default n' can make sense e.g. in a Kconfig.defconfig file, if you
want to override a 'default y' on the base definition of the symbol. It
isn't used like that on any of these symbols though.