[alsa-devel] [PATCH 2/2] usbtv: add audio support

Lubomir Rintel lkundrak at v3.sk
Sun Jan 5 17:43:52 CET 2014


On Sun, 2014-01-05 at 16:38 +0100, Federico Simoncelli wrote:
...
> +	static const u16 setup[][2] = {
> +/*		{ USBTV_BASE + 0x00a2, 0x0013 }, */

A minor style issue here, please avoid useless comments.


> +	strncpy(card->driver, usbtv->dev->driver->name,
> +		sizeof(card->driver) - 1);
> +	strncpy(card->shortname, "usbtv", sizeof(card->shortname) - 1);

I suggest you use the strlcpy() instead, as is used in the rest of the
driver. Aside from that it is more consistent, it would make it a bit
easier to verify that the string is properly terminated without having
to take a look at snd_card_create() to see whether zeroes out the
structure for you.

> +	strncpy(pcm->name, "USBTV Audio Input", sizeof(pcm->name) - 1);

Ditto.

Thank you!
Lubo



More information about the Alsa-devel mailing list