From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [PATCH] ALSA: asihpi - Clarify adapter index validity check. Date: Fri, 29 Jul 2011 07:30:20 +0200 Message-ID: References: <1311803417-10328-1-git-send-email-linux@audioscience.com> <4E31DF42.3050000@audioscience.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id B899B2447C for ; Fri, 29 Jul 2011 07:30:25 +0200 (CEST) In-Reply-To: <4E31DF42.3050000@audioscience.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Eliot Blennerhassett Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 29 Jul 2011 10:14:26 +1200, Eliot Blennerhassett wrote: > > On 28/07/11 17:43, Takashi Iwai wrote: > if ((adapter >= HPI_MAX_ADAPTERS) || (!pa->type)) { > >> - hpi_init_response(&hr->r0, HPI_OBJ_ADAPTER, > >> - HPI_ADAPTER_OPEN, > >> - HPI_ERROR_BAD_ADAPTER_NUMBER); > >> + 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" Yes, please give a matching changelog, then. thanks, Takashi