Re: sound/pci/au88x0/au88x0_core.c: many calls to memset with not-plausible size ?

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

 



On Mon, 02 May 2016 16:43:15 +0200,
David Binderman wrote:
> 
> Hello there,
> 
> sound/pci/au88x0/au88x0_core.c:2153:6: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
> 
> Source code is
> 
>                    memset(stream->resources, 0,
>                            sizeof(unsigned char) *
>                            VORTEX_RESOURCE_LAST);
> 
> but
> 
> sound/pci/au88x0/au88x0.h:    u32 resources[5];
> 
> Something like
> 
>                  memset(stream->resources, 0,
>                            sizeof(stream->resources[0]) *
>                            VORTEX_RESOURCE_LAST);
> 
> Some duplicates:
> 
> sound/pci/au88x0/au88x0_core.c:2163:7: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
> sound/pci/au88x0/au88x0_core.c:2177:5: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
> sound/pci/au88x0/au88x0_core.c:2292:5: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
> sound/pci/au88x0/au88x0_core.c:2301:5: warning: ‘memset’ used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]

Yes, indeed these look wrong.  But the simplest fix is just to write
like
	memset(stream->resources, 0, sizeof(stream->resources));

Care to send a fix patch?


thanks,

Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel




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

  Powered by Linux