On Mon, 2014-02-10 at 22:25 +0100, David Henningsson wrote: > On 02/07/2014 03:53 PM, Tanu Kaskinen wrote: > > On Thu, 2014-01-30 at 23:00 +0100, David Henningsson wrote: > >> On 01/29/2014 07:58 PM, Tanu Kaskinen wrote: > >>> I don't know if there's some bug in alsa-lib or not, but reading dB > >>> values seems to irritate Valgrind a lot. These changes remove all > >>> warnings that can be removed within our own code, but reading dB > >>> values still causes warnings within alsa-lib code. > >> > >> I tried to fix this in Valgrind two years ago, but got stalled: > >> > >> http://valgrind.10908.n7.nabble.com/Missing-ioctl-for-SNDRV-CTL-IOCTL-TLV-READ-td42711.html > > > > Interesting. So, is my patch OK if I add a reference to the valgrind > > mailing list thread? > > > > Well, fixing the root cause (in valgrind) would be better, but as I'm > pragmatic, I'm okay with working around it until the root cause is fixed. > > Btw, maybe something like this would be a more readable solution: > > #ifdef HAVE_VALGRIND_MEMCHECK_H > /* Work around valgrind bug, see > http://valgrind.10908.n7.nabble.com/Missing-ioctl-for-SNDRV-CTL-IOCTL-TLV-READ-td42711.html > */ > > #define snd_mixer_selem_ask_playback_vol_dB(a, b, c) \ > VALGRIND_MAKE_MEM_DEFINED(c, sizeof(*c)); \ > snd_mixer_selem_ask_playback_vol_dB(a, b, c); > /* More macros here */ > #endif > > ...or inline functions if that makes more sense. That's a good idea. I'll post a new version of the patch (unless it gets buried in the todo list forever). -- Tanu