Re: [PATCH] ALSA: control: expand limitation on the number of user-defined control element set per card

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

 



Dne 26. 01. 21 v 16:57 Takashi Iwai napsal(a):

> @@ -1226,11 +1227,18 @@ struct user_element {
>  	struct snd_card *card;
>  	char *elem_data;		/* element data */
>  	unsigned long elem_data_size;	/* size of element data in bytes */
> +	size_t alloc_size;		/* allocated size */

I think that introduction of this new member is not required. The allocated
size can be easily computed at runtime (function).

> @@ -1397,6 +1414,7 @@ static int snd_ctl_elem_init_enum_names(struct user_element *ue)
>  
>  	ue->priv_data = names;
>  	ue->info.value.enumerated.names_ptr = 0;
> +	ue->alloc_size += buf_len;

The buf_len variable is the remaining count. The
ue->info.value.enumerated.names_length already contains allocated bytes. This
code can be elimited if alloc_size is not introduced.

Thank you for this patch.

					Jaroslav

-- 
Jaroslav Kysela <perex@xxxxxxxx>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.



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

  Powered by Linux