Page MenuHomeFreeBSD

hvsock: remove useless casts, checks & functions
Needs RevisionPublic

Authored by freebsd_igalic.co on Mar 26 2024, 10:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 7:27 PM
Unknown Object (File)
Nov 25 2024, 4:02 AM
Unknown Object (File)
Nov 18 2024, 2:33 AM
Unknown Object (File)
Nov 10 2024, 4:01 PM
Unknown Object (File)
Nov 10 2024, 9:34 AM
Unknown Object (File)
Nov 10 2024, 8:44 AM
Unknown Object (File)
Nov 10 2024, 2:27 AM
Unknown Object (File)
Oct 7 2024, 4:40 AM
Subscribers

Details

Reviewers
glebius
whu
Summary

This is a copy of a copy of a pre-C89 pattern.
We don't need the casts, so remove the helper macros as well.
While here, remove a function that is now recognized as unused.

Sponsored by: The FreeBSD Foundation

Diff Detail

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

Event Timeline

glebius added a subscriber: glebius.

Looks like this socket has special handling of so_pcb. While it is allocated in pr_attach, like all others do, it has two paths for deallocation - for listening socket it is normal pr_detach, but it also may be deallocated at device detach method.

I'd suggest to split this changeset into 3 separate parts, which actually are unrelated:

  • Remove useless SOCK_STREAM checks
  • Remove useless casts of so_pcb
  • Investigate what's going on with so_pcb and are those checks needed or not? If they are, why this socket is designed so different to normal?
This revision now requires changes to proceed.Mar 27 2024, 12:14 AM
kevans added a subscriber: kevans.

I'd add whu@ on these reviews as well, for hvsock in particular


I'd suggest to split this changeset into 3 separate parts, which actually are unrelated:

  • Remove useless SOCK_STREAM checks
  • Remove useless casts of so_pcb

I can do these two by myself, but I will need @whu's input on this:

  • Investigate what's going on with so_pcb and are those checks needed or not? If they are, why this socket is designed so different to normal?