Page MenuHomeFreeBSD

sound: Get rid of useless sndbuf getters and setters
AbandonedPublic

Authored by christos on Nov 1 2025, 10:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 18, 11:36 AM
Unknown Object (File)
Sun, Nov 16, 8:09 AM
Unknown Object (File)
Fri, Nov 14, 8:43 PM
Unknown Object (File)
Fri, Nov 14, 7:42 PM
Unknown Object (File)
Thu, Nov 13, 4:05 PM
Unknown Object (File)
Wed, Nov 12, 6:45 PM
Unknown Object (File)
Nov 7 2025, 10:57 AM
Unknown Object (File)
Nov 2 2025, 12:19 PM
Subscribers

Details

Summary

No functional change intended.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Diff Detail

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

Event Timeline

I know this is rather large for a non-functional change, but I think it's worth cleaning this up. There are a few more gettters/setters in sys/dev/sound/pcm/buffer.c, but I want to think a bit more about them.

Why? It's a lot of churn, and the accessors are harmless. It's nice to have them when looking at how certain fields are accessed. When reviewing a previous change, for instance, I was looking at callers of sndbuf_getsel(). It would have been annoying without that accessor, since there are many fields called "sel".

Why? It's a lot of churn, and the accessors are harmless. It's nice to have them when looking at how certain fields are accessed. When reviewing a previous change, for instance, I was looking at callers of sndbuf_getsel(). It would have been annoying without that accessor, since there are many fields called "sel".

The rationale is that no other part of sound(4) has OOP-like getters and setters, and IMHO these do not really serve a good purpose other than essentially adding an "sndbuf_get*" prefix to the struct's name field. As for sel, we use this field in only a handful of places, and in some we actually need to access the sel's fields (e.g., in D53029), and using the getter will only make that more verbose and ugly.