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)
Fri, Apr 26, 1:28 PM
Unknown Object (File)
Fri, Apr 26, 1:22 PM
Unknown Object (File)
Fri, Apr 26, 8:24 AM
Unknown Object (File)
Fri, Apr 26, 4:30 AM
Unknown Object (File)
Fri, Mar 29, 7:40 PM
Unknown Object (File)
Mar 28 2024, 2:06 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?