[alsa-devel] [PATCH] sound azt3328: hook up new emulated AC97 on AC97 patch side

Andreas Mohr andi at lisas.de
Thu Feb 17 19:25:45 CET 2011


On Thu, Feb 17, 2011 at 06:38:33PM +0100, Takashi Iwai wrote:
> At Thu, 17 Feb 2011 00:16:12 +0100,
> Andreas Mohr wrote:
> > 
> > --- linux-2.6.orig/sound/pci/ac97/ac97_patch.c	2011-02-16 23:18:54.000000000 +0100
> > +++ linux-2.6/sound/pci/ac97/ac97_patch.c	2011-02-16 23:19:03.000000000 +0100
> > @@ -222,6 +222,47 @@
> >  	return is_surround_on(ac97);
> >  }
> >  
> > +/* find a mixer control element with the given name */
> > +static struct snd_kcontrol *snd_ac97_find_mixer_ctl(struct snd_ac97 *ac97,
> > +						    const char *name)
> 
> We don't have to copy the whole functions.
> Can't it be simply a function declaration?
> It's not necessary to grow the patch size...

OK, from a maintenance (e.g. -longterm) POV, that may be
a problematic patch hunk, however some people
consider (extra) forward declarations of function signatures to be a code smell.
And in this case this function clearly is infrastructure material for
several card-specific patch functions later on, thus one could
probably(?) argue that it should be at the top and not "somewhere in between"
all the patches.

But I can certainly change the patch to use whichever is the more favourable way.

Thanks!

Andreas Mohr


More information about the Alsa-devel mailing list