[PATCH] alsa: Silence some Valgrind warnings

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

 



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.


-- 
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux