[alsa-devel] [PATCH] ALSA: asihpi - Clarify adapter index validity check.

Eliot Blennerhassett linux at audioscience.com
Fri Jul 29 00:14:26 CEST 2011

On 28/07/11 17:43, Takashi Iwai wrote:
		if ((adapter >= HPI_MAX_ADAPTERS) || (!pa->type)) {
>> -			hpi_init_response(&hr->r0, HPI_OBJ_ADAPTER,
>> +		if (!adapter_present) {
>> +			hpi_init_response(&hr->r0, hm->h.object,
>> +				hm->h.function, HPI_ERROR_BAD_ADAPTER_NUMBER);
> Here you are initializing to different values (from HPI_OBJ_ADAPTER to
> hm->h.object, etc).  Is it intentional?

Yes it is. It is so the error response reflects the parameters of the
corresponding message.   It makes for better error logging in userspace.

I can redo the patch with better commit log if you like.
Adding "Correct error response to reflect message object/function ids"

Eliot Blennerhassett
AudioScience Inc.

More information about the Alsa-devel mailing list