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

scripts: extract_dts_includes.py: refactor for better maintenance #8541

Merged
merged 1 commit into from
Jul 3, 2018

Conversation

b0661
Copy link
Collaborator

@b0661 b0661 commented Jun 23, 2018

Refactor for better maintenance and to ease future enhancements.

This is a cutout of PR #6761 (which is a cutout of #5799) that can be applied independently.

Signed-off-by: Bobby Noelte b0661n0e17e@gmail.com

Refactor for better maintenance and to ease future enhancements.

Signed-off-by: Bobby Noelte <b0661n0e17e@gmail.com>
@codecov-io
Copy link

codecov-io commented Jun 23, 2018

Codecov Report

Merging #8541 into master will decrease coverage by 0.68%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8541      +/-   ##
==========================================
- Coverage   63.92%   63.24%   -0.69%     
==========================================
  Files         427      441      +14     
  Lines       41100    45629    +4529     
  Branches     6939     8269    +1330     
==========================================
+ Hits        26275    28860    +2585     
- Misses      11678    13276    +1598     
- Partials     3147     3493     +346
Impacted Files Coverage Δ
subsys/net/ip/net_private.h 38.67% <0%> (-1.33%) ⬇️
include/bluetooth/bluetooth.h 0% <0%> (ø) ⬆️
include/net/dns_resolve.h 100% <0%> (ø) ⬆️
include/net/net_app.h 100% <0%> (ø) ⬆️
subsys/net/ip/ipv6.h 100% <0%> (ø) ⬆️
include/ptp_clock.h 100% <0%> (ø)
subsys/logging/log_output.c 2.89% <0%> (ø)
subsys/logging/log_list.c 100% <0%> (ø)
subsys/net/l2/ethernet/eth_stats.h 0% <0%> (ø)
subsys/net/l2/dummy.c 100% <0%> (ø)
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 54d1a60...981e3f3. Read the comment docs.

def __init__(self):
pass

def _extract_consumer(self, node_address, yaml, clocks, names, defs, def_label):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this module in the PR?
This is new material that would deserve a dedicated review with matching yaml files and examples.

Copy link
Collaborator Author

@b0661 b0661 Jun 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the clocks directive (eg. BUS, BITS) as before. extract_cells and extract_controller

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and this is actually a bit more than that as you added #clock-cells treatment.
I don't say this is not correct, but that this is more than the initial status of script features.

I've checked what was generated and it seems true to what was generated earlier.
What puzzles me is that there is more code than in initial function that was generic to other nodes..

# @param[out] defs Property definitions for each node address
# @param def_label Define label string of node owning the directive.
#
def extract(self, node_address, yaml, prop, names, defs, def_label):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defs is now global (defined in globals.py) , remove from parameters list.
Apply everywhere

Copy link
Collaborator Author

@b0661 b0661 Jun 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know that defs is in globals. But the interface was kept. See current version of extract_dts_inlcudes.py. Do you really want this new interface in a refactor only PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, my bad. This was done in my local branch bu not merged actually.
You can discard this comment

##
# @brief Extract directives in a default way
#
# @param node_address Address of node owning the clockxxx definition.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this comment is not accurate

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes should read clocks (clockxxx is for future use).

@erwango
Copy link
Member

erwango commented Jul 3, 2018

Approved. Let's get this merged

@galak galak merged commit 08216f5 into zephyrproject-rtos:master Jul 3, 2018
@b0661 b0661 deleted the pr_extract_refactor branch July 3, 2018 17:59
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.

5 participants