Re: [PATCH] ALSA: emu10k1: fix multi-channel playback device class

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Apr 25, 2023 at 10:15:36AM +0200, Takashi Iwai wrote:
On Tue, 25 Apr 2023 10:00:45 +0200,
Oswald Buddenhagen wrote:
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.

The dev_class and info_flags initializations to zero aren't entirely
pointless, IMO.  It explicitly shows that the default value is used.

that can be said about many other fields as well. but defaults are there for a reason, to reduce the noise. not even the example in the docu includes it. and if we were consistent about the "be explicit" approach, we should add it to a lot of drivers which lack it - which feels just wrong.

regards



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux