Page MenuHomeFreeBSD

sound: Get rid of useless sndbuf getters and setters
Needs ReviewPublic

Authored by christos on Sat, Nov 1, 10:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 2, 12:19 PM
Unknown Object (File)
Sun, Nov 2, 12:19 PM
Unknown Object (File)
Sun, Nov 2, 9:59 AM
Unknown Object (File)
Sun, Nov 2, 8:04 AM
Unknown Object (File)
Sun, Nov 2, 5:35 AM
Unknown Object (File)
Sun, Nov 2, 5:33 AM
Unknown Object (File)
Sun, Nov 2, 2:15 AM
Unknown Object (File)
Sun, Nov 2, 1:59 AM
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.