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

Use unlikely() to error checking conditions #1233

Open
razvand opened this issue Dec 30, 2023 · 6 comments
Open

Use unlikely() to error checking conditions #1233

razvand opened this issue Dec 30, 2023 · 6 comments
Assignees
Labels
kind/enhancement New feature or request

Comments

@razvand
Copy link
Contributor

razvand commented Dec 30, 2023

Feature request summary

The unlikely() macro is not used consistently to check for unlikely error situations. For example, unlikely() is not being used in lib/ukcpio/cpio.c.

@pranjalrai4
Copy link

Hi! I am a Computer Science student at the University of Texas at Austin. I am currently taking virtualization (CS 360v) and I would like to contribute to this project. I saw this issue opened up last year and I would like to work on it, but I was wondering if it was still open.

@razvand razvand assigned pranjalrai4 and unassigned mogasergiu Apr 2, 2024
@razvand
Copy link
Contributor Author

razvand commented Apr 2, 2024

Sure, @pranjalrai4 , go for it.

@pranjalrai4
Copy link

@razvand How do we know if an error is unlikely()? Also, would we need to do this for every file in the codebase or do we need to do this for a subset of files?

@razvand
Copy link
Contributor Author

razvand commented Apr 23, 2024

@pranjalrai4 , unlikely is typically used for error conditions. Whenever there is something that results in ending the current function / flow, that's probably a condition to be wrapped with unlikely. It's not a rule, but it's often the case.

@ggracechoi
Copy link

@razvand What is the selector and component for this issue? I want to confirm before committing our changes : )

@razvand
Copy link
Contributor Author

razvand commented May 1, 2024

@ggracechoi , if it touches multiple libraries, use lib/* as the selector.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
Status: 🏗 In Progress
Development

No branches or pull requests

4 participants