Re: [PATCH v2] kselftest/alsa: Fix -Wformat compiler warnings

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

 



On Fri, Mar 24, 2023 at 05:01:58PM +0100, Alexander Heinrich wrote:

> For the string to int conversion functions, the return values for the test cases
> in pcm-test.conf are non-negative and in the range of unsigned int, so I just
> cast them to unsigned int.

That sounds like you're masking some issue rather than fixing it,
but...

> Please let me know if I can further improve on my patch (it is my first)!

It might be easier to split the different kinds of change up into
separate patches, it'd make it easier to follow what's going on.

> +				phys_width = snd_pcm_format_physical_width(format);
> +				if (phys_width < 0)
> +					ksft_exit_fail_msg("Unknown PCM format\n");
>  				samples = realloc(samples, (rate * channels *
> -							    snd_pcm_format_physical_width(format)) / 8);
> +								  (unsigned int)phys_width) / 8);

...this isn't a formatting function, it's realloc()?

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux