From patchwork Sun Feb 8 11:09:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 5797281 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 84EC19F2ED for ; Sun, 8 Feb 2015 11:09:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC7822012B for ; Sun, 8 Feb 2015 11:09:33 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 8BAEA20121 for ; Sun, 8 Feb 2015 11:09:32 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 567A326065B; Sun, 8 Feb 2015 12:09:26 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id BF4CB260648; Sun, 8 Feb 2015 12:09:17 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1241026064F; Sun, 8 Feb 2015 12:09:17 +0100 (CET) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 1D5CC2605D1 for ; Sun, 8 Feb 2015 12:09:10 +0100 (CET) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B0E52ABBD; Sun, 8 Feb 2015 11:09:07 +0000 (UTC) Date: Sun, 08 Feb 2015 12:09:07 +0100 Message-ID: From: Takashi Iwai To: Takashi Sakamoto In-Reply-To: <1423391336-2167-1-git-send-email-o-takashi@sakamocchi.jp> References: <1423391336-2167-1-git-send-email-o-takashi@sakamocchi.jp> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/24.4 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Cc: alsa-devel@alsa-project.org, clemens@ladisch.de Subject: Re: [alsa-devel] [PATCH] ALSA: control: fix failure to return numerical ID in event data X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP At Sun, 8 Feb 2015 19:28:56 +0900, Takashi Sakamoto wrote: > > Currently an instance of control has zero as its member for numerical > ID even if any IDs are assigned to. According to this bug, any userspace > applications cannot identify controls by the ID when handling any events. > On the other hand, the other members such as name are still valid, > therefore applications can identify controls without fixing this. > > This is not preferable because the ID has an advantage to allow userspace > applications to distinguish each controls by itself, without any > combinations. > > Signed-off-by: Takashi Sakamoto You're trying to address two individual bugs. Please split. The first bug is the missing zero clear of id.numid, and the second bug is the missing numid set for notification. Both can be oneliner. The latter would be something like: If you want to reorder the calls and add the comments, do it in another patch to make clear that it's just a refactoring. Don't mix up refactoring and a fix, unless it's really trivial. thanks, Takashi --- a/sound/core/control.c +++ b/sound/core/control.c @@ -371,7 +371,7 @@ int snd_ctl_add(struct snd_card *card, struct snd_kcontrol *kcontrol) } list_add_tail(&kcontrol->list, &card->controls); card->controls_count += kcontrol->count; - kcontrol->id.numid = card->last_numid + 1; + id.numid = kcontrol->id.numid = card->last_numid + 1; card->last_numid += kcontrol->count; count = kcontrol->count; up_write(&card->controls_rwsem);