Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4103265imm; Mon, 14 May 2018 02:36:49 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrfpKToobakiT3zFMnJDYv2ayWFFW194j5HPeykDQZf9K+82JoV0yjM0uRkK63DAkvWWMhD X-Received: by 2002:a62:cc08:: with SMTP id a8-v6mr9599690pfg.219.1526290609229; Mon, 14 May 2018 02:36:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526290609; cv=none; d=google.com; s=arc-20160816; b=yIK0ZtF4gEyGCdrmDcWU/Avu8uRzn2Lyzw6WQ/fHn7ktkOYz6QoQY/NZugR9+j0Hy+ aqMS4tEyV3Q9OnQPsmLeQD6SPgsvnfDs8trc21astvg/kiQxi7wkMWkVim9Udo7BiygL eC5cGqWef3OOxiFGs/SKpGmy1iMQQqMzEux98XcjO0qZ/pBAlsnfEuE8lx4GAQA/4oNe LHxwZizpRoJJMQIqiNnJO9uBexptadvjVSZRgSB9JRGKgpF9hKUO3Rc8mkoyCDbzbp4v hRJZ1fkTW3EnwnhfwxMOFEO8yKMHseJsfWVk8BIS99qtQcWXsAGcfvz31zmczmx8pnTZ Z+GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=gvldIfEnic4F9aNRZBHS6OnUZLVvxTOgidLWde0Yot4=; b=qLwc7ppP4fRx2LcIQyZtYJ9wI8VjCXy3ypmYPe/JoAMRsKv9Eg2i6m2Xn9qmS/PdbO J/wiXePuXrI/kY8dHaxoeUSJdyO/DLbLOq5wrjbpyaRAahvYH7IirmmlLoaoT6NrET1G Pg24/17oyM5oi0uNYOLW/HS0BpjpsgveM6V5yHRlIOYs1ynlUg8+TpM1fWm6orSBxK2M vgHeCjVQq0cSvqeg63wJiTilxg7d+tG14J21U3BLxMPD7XjooStHWkOBn5aAhMEfW4c6 qOxp9P8wb1e0dQopb89JVgyRoQRGo6weL0pxNK40TvIq3EMoK1c0Q7vz4KSVNneS+tCM 8njQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uXkzU1HM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6-v6si7227186pgr.374.2018.05.14.02.36.34; Mon, 14 May 2018 02:36:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uXkzU1HM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752517AbeENJgR (ORCPT + 99 others); Mon, 14 May 2018 05:36:17 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:54849 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752241AbeENJgQ (ORCPT ); Mon, 14 May 2018 05:36:16 -0400 Received: by mail-wm0-f66.google.com with SMTP id f6-v6so12241631wmc.4 for ; Mon, 14 May 2018 02:36:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=gvldIfEnic4F9aNRZBHS6OnUZLVvxTOgidLWde0Yot4=; b=uXkzU1HM1QlMX/53mXH8wjJaQruxVfFRTNPU7HAcwOlB+P7pyYIwttT+XOZ+F5Bzce ayRki62pe4G1+5D1JbC7t0rNaPRAezlZNgBUFuvnpjZffDoF/gr5xNQe+q7xqBWZGzFv k54J8qyYWaFQcf6srXZ1ITb4JI2/xIK+v2VvxowgkPzE1TrdWXxkzyCBd10rE73xQ/qz GDc+qlLt4johYxQ2BtZGe9lB1Lpt8LmACZPWRtdWQudOt97ZWoBfun0d3uNicI1eITEh uwjhgelfbyU4fv47uldPV/yogny9QIjkoJ0QnS1f9G3TC6K7vO5GxnRG5yEjIZipugkJ MUYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=gvldIfEnic4F9aNRZBHS6OnUZLVvxTOgidLWde0Yot4=; b=ITzFXSt+7+QBGYGq/y56sBMOrH3MhMj0HHpVUFmFRWsa7IWfPe0yNCuCjK5YLghzVO NUasOE/pI/DY3xTAhnF+8HPdIIkkDJxEprypd2CKDv4E22a2Kp1Xh9nN6gv0fJ42Dm2B XhEn7a/3N/ZKtqywj+7mE+TaUflbfvrhqpCTIPI2IvF1J1Q5fhTCXiI26yh87OhWla54 A2WMt0Rbp6fCJKO2lImL1cJ6QY8Il/fh5ZSZHWG8CPq8Gpfl7KG6ogVabN78FH5Ax8lK Vpcm+yjKtvbtI9f4Rr61jaKwzU4DF8yn8g0u4lNZ3F1TC5Pc9lKgj4p5b4FuRakCnavj 3zZQ== X-Gm-Message-State: ALKqPwdEX5Pi7c18/IVXDgUgQUUsNufiGIKUwkufGMzOWECgAa5MqCfd ZY12mIwJXT69YF21oFomODmnZJZ85wwcZQul9SkVzSy/ X-Received: by 2002:a1c:5c11:: with SMTP id q17-v6mr5014933wmb.24.1526290574879; Mon, 14 May 2018 02:36:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.130.49 with HTTP; Mon, 14 May 2018 02:36:14 -0700 (PDT) In-Reply-To: References: <20180420170327.31569-1-jorge.sanjuan@codethink.co.uk> <20180511152537.32267-1-jorge.sanjuan@codethink.co.uk> <20180511152537.32267-5-jorge.sanjuan@codethink.co.uk> From: Ruslan Bilovol Date: Mon, 14 May 2018 12:36:14 +0300 Message-ID: Subject: Re: [PATCH v4 4/4] ALSA: usb-audio: UAC3: Parse Input Terminal number of channels. To: Jorge Cc: Takashi Iwai , alsa-devel@alsa-project.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 14, 2018 at 11:54 AM, Jorge wrote: > > > On 11/05/18 16:25, Jorge Sanjuan wrote: >> >> Obtain the number of channels for the Input Terminal from the >> Logical Cluster Descriptor. This achieves a useful minimal parsing >> of this unit so it can be used in other units in the topology. >> >> Signed-off-by: Jorge Sanjuan >> --- >> sound/usb/mixer.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c >> index 431f3c319839..19b25fbc7437 100644 >> --- a/sound/usb/mixer.c >> +++ b/sound/usb/mixer.c >> @@ -903,9 +903,9 @@ static int check_input_term(struct mixer_build *state, >> int id, >> * recursion calls */ >> term->id = id; >> term->type = >> le16_to_cpu(d->wTerminalType); >> + term->channels = >> get_cluster_channels_v3(state, d->wClusterDescrID); > > > > Sorry about this. I just spotted that I should have used the helper function > I added to access d->wClusterDescrID `uac3_mixer_unit_wClusterDescrID`. > > I got the sparse warning for the endianess and realized that. I'll resend > this one patch. While here, please add checking output of get_cluster_channels_v3() as it can return negative errno. BTW, I've just tested your Mixer patches and this is the only comment I have so far. Thanks, Ruslan > >> - /* REVISIT: UAC3 IT doesn't have >> channels/cfg */ >> - term->channels = 0; >> + /* REVISIT: UAC3 IT doesn't have channels >> cfg */ >> term->chconfig = 0; >> term->name = >> le16_to_cpu(d->wTerminalDescrStr); >> >