Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp935672imm; Thu, 31 May 2018 12:03:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJo5hiE9ISdt6oV5D+D8n8djDwo+PfE/lA3EVcujspAeCHYA+dIP9RmoW1XU133dTgReH2j X-Received: by 2002:a17:902:8d8e:: with SMTP id v14-v6mr8135449plo.387.1527793419484; Thu, 31 May 2018 12:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527793419; cv=none; d=google.com; s=arc-20160816; b=dVNgq9sZ0vGNRACtDjZC6z7seYZdrj96Q/XAK83qRTd3HzkSK6O+JirdE73bnJVnCA Kvz3vi4m3tFET4ux5fHYiTjNdQvCdwcU0zlBztP7sWz6n6/QRXahkV9lahJ9cn0UNyFV vh0BHdJDn/qxdDmR3XMMxjEoyhUDJmcdg2bAs6+Rptid6ZoyReSjeZV+fvWeU1a0tYfy bKgBIbdDfjQjffapTr0s9Mdv+ghlbSzVjmaf1vparvMWQ9IOnlipzsVqHv8evIAiaGfQ zAzv2HLexSQbxTCCBziEg3+YqJcDBoIvHeyukc67fVnRk0DPoewfeE9CgHk77gXtS3je 8gwg== 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=CLvWv2YFNOIxvHImXkfBketR5polU6ok0kHeZYv8zQ0=; b=FWGij+eJMA+QlOAVune3pVBpmeqpM35r5c84A4l6jv+/kPsFlHrW0XgV5+MqlXUvhE bc3PvF/iSRl/DHtbgspeGNO8sV8Ozpe2k8L/I4l/d/YA3hAxXzt01iHmd71WfY/JTg6h LeF5nMZtCW7jntC1OszB0HswYxFMXlbjUdgtH0a2r8svsSjMoN/f3TpPza96g95D1lw2 LN51yeZolbyg+rrBnga/ryYu1RrBiPOXBvN9AB8yCZRfku3305ft1Tm3pFYnsH7GidLa tjBey9l0IneiJYGGlzX2Ht0fIJHIrgs6QvrtPDeleTfASFhnQFgVLpWt0BJn51r10BQY CdwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dHVE6/5R; 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 u9-v6si29702381pgv.313.2018.05.31.12.02.57; Thu, 31 May 2018 12:03:39 -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=dHVE6/5R; 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 S1756072AbeEaTCJ (ORCPT + 99 others); Thu, 31 May 2018 15:02:09 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:41524 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755875AbeEaTCH (ORCPT ); Thu, 31 May 2018 15:02:07 -0400 Received: by mail-qk0-f196.google.com with SMTP id w23-v6so2724961qkb.8 for ; Thu, 31 May 2018 12:02:06 -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=CLvWv2YFNOIxvHImXkfBketR5polU6ok0kHeZYv8zQ0=; b=dHVE6/5RlRenjeP6cjtwLzG4FTo8iCLL+OY5nrHGXpVU4ZaTYSNBhKlEbHCcVcyt12 /jGm/UYBBINkiacySRzMzmH8qBkSNZHVrhhAuPX5v2TcDyUHS7N2THsZqdCXox1KPn4h o0PQH6ZzViw7ntzJQTJFz95kIqH6lQDr7yOz/qPdlLyeURFl1Fkpg5waN5kLsNSj1X5S YLBTKEbQHgOSEbKReQumBxT+GHsn2N4BmDI8cdTJobYfVq0vkSciCwBcFofy5wlzKZC/ h1Trc5ZLOBUwYtN48mjRrra3e6JE5UX95votxjfWC8sBBZQbnVQhbuKqOdo5Se6/XXdQ Up3A== 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=CLvWv2YFNOIxvHImXkfBketR5polU6ok0kHeZYv8zQ0=; b=Qnca/hN9xCrAtaeEgmzB65tAP73eFRD/DFIXNHho4JeuyPLySMmluZKuo6YN+4d0BA DqJxzVAL8ej/CbdE+VPKxJ7TtvpWRYsDF02dQdMlg9SYg4p+PYsPO9OBmPAwfgjRFo6e 5poHrYZhKBlPc5MlgET6Bf2BnrJ+6jlYT9y5Tb4ohtFeQB4kuoWaUrHcpOckLYwGDHFy LgeDaljsAxdaY1RWN9g4GxQ96/uGLtcCbawwtMmDXpXPbw8D8p5T/sIRSw4tTG8TuwqF RV+Mt9IA0gXQmqYuilMAdK2PF7AwJmucla4dQmtvXTJThA7Z4R+utWEHTSxfEMufO4tl 4Pxw== X-Gm-Message-State: APt69E2Qj4QE2kEvlT2+keob/C+uWa/BSw5+91kdiYfunYpgMUq9k5rQ Chbm0ToBV2Q8QwuEny4/WJ56Q24pqST/PDBEZJw= X-Received: by 2002:a37:d1d0:: with SMTP id o77-v6mr6247648qkl.185.1527793326469; Thu, 31 May 2018 12:02:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:9896:0:0:0:0:0 with HTTP; Thu, 31 May 2018 12:02:05 -0700 (PDT) In-Reply-To: References: <1527765086-19873-1-git-send-email-xieyisheng1@huawei.com> <1527765086-19873-16-git-send-email-xieyisheng1@huawei.com> From: Andy Shevchenko Date: Thu, 31 May 2018 22:02:05 +0300 Message-ID: Subject: Re: [PATCH v2 15/21] ALSA: oxygen: use match_string() helper To: Takashi Iwai Cc: Yisheng Xie , ALSA Development Mailing List , Clemens Ladisch , Jaroslav Kysela , Linux Kernel Mailing List 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 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! -- With Best Regards, Andy Shevchenko