On Tue, 25 Apr 2023 10:00:45 +0200, Oswald Buddenhagen wrote:
On Mon, Apr 24, 2023 at 12:32:58PM +0200, Oswald Buddenhagen wrote:
so i'd postulate that these enums are effectively dead, and both the risk and the gain of this change are about zero.
speaking of dead code, lots of drivers explicitly assign info_flags = 0, dev_class = SNDRV_PCM_CLASS_GENERIC, and dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX, which are all technically pointless, as the pcm struct is kzalloc'd anyway. and of course it's entirely inconsistent (with just about every combination present), because it obviously works without this. how would you feel about a patch that just removes all these?
The dev_class and info_flags initializations to zero aren't entirely pointless, IMO. It explicitly shows that the default value is used. OTOH, dev_sub_class is always 0 for the existing drivers, hence dropping the explicit initialization would be an acceptable cleanup.
thanks,
Takashi