Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1012956imm; Thu, 31 May 2018 13:32:26 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKswEBo7hoGtVxrJmYpBiPMykCqRgCuYHIIsNlylTeGrACjl3569DkmEAIJ4TmuqUlMOFLt X-Received: by 2002:a62:a38d:: with SMTP id q13-v6mr8178090pfl.49.1527798746324; Thu, 31 May 2018 13:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527798746; cv=none; d=google.com; s=arc-20160816; b=sEocKsKHm1eIaId3K4VK3THWJVIRmvMDCM+/NZyEVcVLnRn/udm4SRdpxS/PprNRqR Dp+9NfX7C1T+nVcAjB3863/zP00KfpsQAP58Sualm8SNhTdD8jMECiAmZw7IkhRc/xpp Xd0KN75r7d+FSAYPl3S2uJZOWNSol3Y6Wto2Y/2WydAXbj3xiJqPzlv3w3vCcBxDvwqG NPED9pZ/18NMnY8ntdbgIZMt2U5p5o8MMm7yRKgMcvWb2/aBTsZgfyVyf7h8kjs3Z/jS rulQXikq9gV0A0r3T/S4u49tWdNvlBHaYsVf1Z5z1p1XPXrTRW93JYdRPYGfCkH0/W9l hh9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:subject:cc:to:from:message-id:date :arc-authentication-results; bh=ZP5iawxbcoRPRywKIcGD4+4lgoDpBaSsR1rxu8kFRVQ=; b=R53qX2b2uBC88tdwyiSsmS4TwnH3rdSrNGe7iAORftmEYuNYEbwcU6yhiGXhn8cL/F 0WjNOhpOUqeIgb6MZVLPz42WpNjxbsN5PwixUIAfo3mLbWoi5zofusxLuc5gCJwq2RfR tSQi8oWCG0qtdKqNB//qOVMuomjKMNmx1NgmCvov69fJyLiszfpKAkz78j+vHdJAsgbI CPsCte9bDjQ79AOnGskezUGz5VN7fJIJjQFizVUWadkBH5yFcOi0Rfuxs0k/HZsmmQ+t KO3EJ4u9mK0PZXG/lzcCapNts+3e49CxgrPJB7bq/Oma9ABWOpSm/mdBSxr1qTY5Jue2 jV0Q== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j3-v6si37340306pld.300.2018.05.31.13.32.11; Thu, 31 May 2018 13:32:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754488AbeEaUa7 (ORCPT + 99 others); Thu, 31 May 2018 16:30:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:47762 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754435AbeEaUa6 (ORCPT ); Thu, 31 May 2018 16:30:58 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CFDEBADCB; Thu, 31 May 2018 20:30:56 +0000 (UTC) Date: Thu, 31 May 2018 22:30:55 +0200 Message-ID: From: Takashi Iwai To: Andy Shevchenko Cc: Yisheng Xie , ALSA Development Mailing List , Clemens Ladisch , Jaroslav Kysela , Linux Kernel Mailing List Subject: Re: [PATCH v2 15/21] ALSA: oxygen: use match_string() helper In-Reply-To: References: <1527765086-19873-1-git-send-email-xieyisheng1@huawei.com> <1527765086-19873-16-git-send-email-xieyisheng1@huawei.com> 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/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 31 May 2018 21:02:05 +0200, Andy Shevchenko wrote: > > On Thu, May 31, 2018 at 9:59 PM, Takashi Iwai wrote: > > On Thu, 31 May 2018 20:41:36 +0200, > > Andy Shevchenko wrote: > >> On Thu, May 31, 2018 at 2:11 PM, Yisheng Xie wrote: > > >> > + j = match_string(known_ctl_names, CONTROL_COUNT, ctl->id.name); > >> > + if (j >= 0) { > >> > + chip->controls[j] = ctl; > >> > + ctl->private_free = oxygen_any_ctl_free; > >> > + } > >> > >> It looks to me you may get rid of j completely by utilizing existing err. > > > > Well, err isn't ideal as it's referred as the actual index. > > That is, the line below looks weird to me: > > chip->controls[err] = ctl; > > > > Of course, j isn't the best name, either, but at least, keeping the > > same variable makes the code conversion logic clearer. > > Works for me either way. > Thanks! OK, let's take as is. thanks, Takashi