Page MenuHomeFreeBSD

newbus: Remove redundant check for 0
ClosedPublic

Authored by imp on Mar 7 2024, 7:15 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 10 2025, 7:47 AM
Unknown Object (File)
Nov 9 2025, 2:16 AM
Unknown Object (File)
Nov 7 2025, 2:27 AM
Unknown Object (File)
Oct 29 2025, 2:12 AM
Unknown Object (File)
Oct 28 2025, 12:06 AM
Unknown Object (File)
Oct 25 2025, 4:36 AM
Unknown Object (File)
Oct 22 2025, 3:25 PM
Unknown Object (File)
Oct 13 2025, 9:50 AM
Subscribers

Details

Summary

We already checked to see if the return code is 0 above. This code is
redundant.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56500
Build 53388: arc lint + arc unit

Event Timeline

imp requested review of this revision.Mar 7 2024, 7:15 PM

actually fix the redundancy

sys/kern/subr_bus.c
1670

I suppose this line could also be dropped.

1753

Maybe we finally need to implement strdup above.

jhb added inline comments.
sys/kern/subr_bus.c
1670

Yes, you can drop pri == 0

1671

out is ok, but you could also use something like exact_match or some other name for the label.

1753

Lots of description strings are constants rather than dynamically allocated. I don't think it would matter if we started always dynamically allocating them though.

This revision is now accepted and ready to land.Mar 13 2024, 8:40 PM
This revision was automatically updated to reflect the committed changes.