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

script.sh: parse-defs: C: index defs that have a CONFIG_ in their line #344

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tleb
Copy link
Member

@tleb tleb commented Oct 4, 2024

See commit message.
Fixes #343.

Take the pm_ptr() macro as example:

⟩ ctags -x --kinds-c=+p+x --extras='-{anonymous}' include/linux/pm.h | grep pm_ptr
pm_ptr           macro       475 include/linux/pm.h #define pm_ptr(_ptr) PTR_IF(IS_ENABLED(CONFIG_PM), (_ptr))

The previous grep would remove the pm_ptr() line because it contains
CONFIG_. We only want to remove a line if it starts with CONFIG_.

Testing this commit:

⟩ export LXR_REPO_DIR=...
⟩ hash=97b0e23363c8283f53c361d8129ef90d7a2b9350
⟩ ./script.sh parse-defs $hash pm.h C | sort > /tmp/defs-pm-before.txt
⟩ # TODO: apply commit
⟩ ./script.sh parse-defs $hash pm.h C | sort > /tmp/defs-pm-after.txt
⟩ comm -13 /tmp/defs-pm-before.txt /tmp/defs-pm-after.txt
pm_ptr macro 475
pm_sleep_ptr macro 476

Signed-off-by: Théo Lebrun <[email protected]>
@tleb tleb requested a review from fstachura October 4, 2024 09:20
Copy link
Collaborator

@fstachura fstachura left a comment

Choose a reason for hiding this comment

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

Nothing to add

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#define not marked as a definition
2 participants