-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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: ethernet: phy: mii: simplify if all are fixed link #87628
base: main
Are you sure you want to change the base?
drivers: ethernet: phy: mii: simplify if all are fixed link #87628
Conversation
add DT_ALL_INST_HAS_BOOL_STATUS_OKAY() macro. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
add test for DT_ALL_INST_HAS_BOOL_STATUS_OKAY() macro. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
add DT_ANY_INST_HAS_PROP_STATUS_OKAY() macro. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
69ee255
to
ec38b16
Compare
add test for DT_ALL_INST_HAS_PROP_STATUS_OKAY() macro. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
ec38b16
to
a4d3f76
Compare
a4d3f76
to
a5cc188
Compare
* @return Macro evaluates to `1,` if instance has the property, | ||
* otherwise it evaluates to literal nothing. | ||
*/ | ||
#define DT_ALL_INST_HAS_PROP_STATUS_OKAY__(idx, prop) \ |
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.
Sorry. This name is truly bizarre, why add an underscore at the end?
Edit
I think we should start with the name itself, otherwise, we can't define its fundamental behavior. At least at first glance, the underscore seems to exist solely to avoid duplicate naming.
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.
I just added these similar to the already existing DT_ANY_INST_HAS**
. These just use a kind af a reversed logic.
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.
I agree with @rruuaanng ; these names need to be revisited
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.
IF that name should be changed, we should also do that with the already merged DT_ANY_INST_HAS_PROP_STATUS_OKAY
and DT_ANY_INST_HAS_BOOL_STATUS_OKAY
.
Do you have a suggestion for the change or do we want to to the change in a later PR?
* | ||
* @return Evaluates to list of 1s (e.g: 1,1,1,) or nothing. | ||
*/ | ||
#define DT_ALL_INST_HAS_PROP_STATUS_OKAY_(prop) \ |
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.
+1
* @return Macro evaluates to `1,` if instance property value is 0, | ||
* otherwise it evaluates to literal nothing. | ||
*/ | ||
#define DT_ALL_INST_HAS_BOOL_STATUS_OKAY__(idx, prop) \ |
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.
+1
* | ||
* @return Evaluates to list of 1s (e.g: 1,1,1,) or nothing. | ||
*/ | ||
#define DT_ALL_INST_HAS_BOOL_STATUS_OKAY_(prop) \ |
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.
+1
a5cc188
to
f67d53f
Compare
If all instances are fixed link, remove code that is not needed for that. Signed-off-by: Fin Maaß <f.maass@vogl-electronic.com>
f67d53f
to
56f755d
Compare
* DT_ALL_INST_HAS_PROP_STATUS_OKAY(baz) // 0 | ||
* @endcode | ||
*/ | ||
#define DT_ALL_INST_HAS_PROP_STATUS_OKAY(prop) \ |
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.
actually maybe this would be better named as DT_ALL_INST_STATUS_OKAY_HAS_PROP
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.
I also like that a bit better, but there is already a DT_ANY_INST_HAS_PROP_STATUS_OKAY
with any instead of all, that is already in main and the last release, so I prefer to have it consistent.
If all instances are fixed link, remove code that is
not needed for that.