[alsa-devel] [PATCH - UCM 1/1] ucm: add binary configure file parse
Lu, Han
han.lu at intel.com
Thu Jan 22 02:54:47 CET 2015
Hi Takashi,
BR,
Han Lu
> -----Original Message-----
> From: Takashi Iwai [mailto:tiwai at suse.de]
> Sent: Thursday, January 22, 2015 4:01 AM
> To: Lu, Han
> Cc: alsa-devel at alsa-project.org; Girdwood, Liam R
> Subject: Re: [alsa-devel] [PATCH - UCM 1/1] ucm: add binary configure file
> parse
>
> At Wed, 21 Jan 2015 09:55:16 +0800,
> han.lu at intel.com wrote:
> >
> > From: "Lu, Han" <han.lu at intel.com>
> >
> > with cset command, UCM set kcontrol parameters directly:
> > cset "name='<KCONTROL_NAME>' 1<,2,3,...>"
> > This patch enables UCM to set kcontrol with parameters from configure
> > file:
> > cset-bin-file "name='<KCONTROL_NAME>' <path/to/file>"
> > where "cset-bin-file" is a newly added keyword alongside of "cset", to
> > indicate cset with binary data in file.
> > The binary data in file is parameter for audio DSPs, and it's just
> > passed by UCM/ALSA as raw data. The data type of parameter elements
> > must be byte, and the count must matches driver definition.
> >
> > Signed-off-by: Lu, Han <han.lu at intel.com>
>
> The contents are almost good, but I got a few compile warnings.
>
> ================
> main.c: In function 'binary_file_parse':
> main.c:185:2: warning: implicit declaration of function 'stat' [-Wimplicit-
> function-declaration]
> if (stat(filepath, &st) == -1) {
> ^
> main.c:201:24: warning: comparison between signed and unsigned integer
> expressions [-Wsign-compare]
> if (read(fd, res, sz) != sz) {
> ^
> main.c: In function 'execute_sequence':
> main.c:252:5: warning: 'err' may be used uninitialized in this function [-
> Wmaybe-uninitialized]
> if (err < 0)
> ^
> main.c:285:6: note: 'err' was declared here
> int err = 0;
> ^
> ================
>
Sorry, I didn't find the warnings. I have sent the modified patch.
BTW, with -Wall/-Wimplicit-function-declaration, I can find warning 1; and with -Wsign-compare I can find warning 2; but with -Wmaybe-uninitialized I cannot find warning 3. (although I did ignore initialization in binary_file_parse(), not execute_sequence())
My platform is Ubuntu 12.10 with gcc-4.9.1, and for alsa-lib.git I used default compile settings. Could you please share your compile setting if convenient? Thanks.
>
> Takashi
More information about the Alsa-devel
mailing list