Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp806366imm; Mon, 21 May 2018 14:51:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqTzkEmsVUlsqcGj0Ijjwoujfex0h0uTdZFVzQX72ivGZ6WsO4VzRvlkQtl0IWm/IhvUSue X-Received: by 2002:a17:902:bf0a:: with SMTP id bi10-v6mr21671176plb.235.1526939487961; Mon, 21 May 2018 14:51:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526939487; cv=none; d=google.com; s=arc-20160816; b=qUctarsV0zLsLewBYDp4TtjpMq+H7egwmmHYSNujOedMLyAEyGKP9MrsXuG7YMnbxh HZC+MBsuj/A13rPpsSPCkmOsuXw+vswyLtODYBuM7DQE7OKgnSv2UQ6digU2kqdkQHLq EXbXAcQdIi6dk5xPN702rt0o7kRGBqrfWh/m7uRpKpOjOiIO5v9rWWol9RXTAS04FBBT DyAtQ8yNVziwjKuYUgQfhwxAUP0OCQawzs5O9n8zfTCZcE/VqNhqKMRYNmSU2Nz3sLXA 7nSoy6vdSvBfRJFs5mx80pRdZ5VJZ+kxGfq2ZodXPSK76+YpoTH+R3CyoO6CV1K4ee7D Oulw== 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=mi4GOoW5u01RcaGN4gYMX45T/Potve7Nm+4on+A5xwA=; b=mqwyuyWiync9hWWKw4zHsORialuHeE2BEMxcNH6h6vTrHumsi5vNk0RKZL8sy0sB0g bTWlm7JICGZWe3ncrZK0zjywYRMdb/NvqrfMH1d4Ltxk69Dvgo3hQOCFV7U9tXy6GGKc xx9C0VwBh6jIw9FO9EpRyKv9hr6/O/7x0x/NooVw7FcsTZQh0ptnLtl+frsuv3g8P1tl nGxrGWZWIsQFIiuiLF2+0dydT3BsDTFQ+c2L1nkzM2xohLK2ukZFBvb2KEB21+UHiB/o S7muzHg+rIKBldWKvOUqOHnN2he18oPrAhQ3B2W7pL+teMc+zu6qB4Yb+vY07zERj0sa Mpqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=et4Vp9ha; 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 z23-v6si15304900plo.492.2018.05.21.14.51.13; Mon, 21 May 2018 14:51:27 -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=et4Vp9ha; 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 S932388AbeEUVue (ORCPT + 99 others); Mon, 21 May 2018 17:50:34 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:41488 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932280AbeEUVuY (ORCPT ); Mon, 21 May 2018 17:50:24 -0400 Received: by mail-qk0-f193.google.com with SMTP id d125-v6so13002273qkb.8; Mon, 21 May 2018 14:50:24 -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=mi4GOoW5u01RcaGN4gYMX45T/Potve7Nm+4on+A5xwA=; b=et4Vp9ha/iA++FSJoWMnil1JzKFn3Pr1Tir3tgsBXF6uJ7Nj+hNVVKhGguHA+YaSuu RMRZ4CugbCUdgHuYxvsP6A7yfNlb8ypCX3pQm3QLSZ6uMIw714w0k2ALcZkqx/WpGYCS PCX1FsQtWqQlhLvG+iaK+RxkWgAkABZre5fP5Ia6nchitrirLXpUZVOSUR8kQO0riYjL UX5cwiqqyar58vyD8p5cFpxEWVESe6YmiTCsXGRVSp19hgKHQgqLWbdz89AQ7IvAemzl D4vGkPplEEJM4em1YNLEJ39gIedaCqEZzRUsCWEs713ZWtnc7qJqWUnn0MLhpNL36GA4 YsKg== 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=mi4GOoW5u01RcaGN4gYMX45T/Potve7Nm+4on+A5xwA=; b=s09ImnaEc0smQNws1IB5TShZWH614v4vHikAHkYeUDhjpHNpOijumTogfYmHKFkqsr /NS24EoeEWPPgFMNHVnf3EykTVgzHR1CaIuP9/Vhm3+lye0uspNC7PSUJHkkufIvIjv3 rMTziv57VK7CZ1NEbyzyLHtI1e0is/md55CWXPi7SpVm+u4MTgbZEWcc8PYX1s3mzTFa Cjuybe+Cj+B08vRzKBckao5U07sHoLepAbHsmRgKrigOGPpM+IUuHXkJ2TQgfFQ9z6zI MJNYVnvkDF39FzwtkLmsauEBB9XYZAFEWIIBdnHmmRYWeUccIkCGRMd8R802b3dhA/AM pQrw== X-Gm-Message-State: ALKqPwcvLrJude78nqsws+sRShpTXvXdCzyt4i7SdhFegVOotKTlfRDL 61PUIbj4x+pIhde99zieLjEd7K6vP1FUn0jW+oaPbg== X-Received: by 2002:a37:d1d3:: with SMTP id o80-v6mr18888750qkl.3.1526939423769; Mon, 21 May 2018 14:50:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.152.150 with HTTP; Mon, 21 May 2018 14:50:23 -0700 (PDT) In-Reply-To: <1526903890-35761-13-git-send-email-xieyisheng1@huawei.com> References: <1526903890-35761-1-git-send-email-xieyisheng1@huawei.com> <1526903890-35761-13-git-send-email-xieyisheng1@huawei.com> From: Andy Shevchenko Date: Tue, 22 May 2018 00:50:23 +0300 Message-ID: Subject: Re: [PATCH 12/33] clk: bcm2835: use match_string() helper To: Yisheng Xie Cc: Linux Kernel Mailing List , Michael Turquette , Stephen Boyd , Eric Anholt , Stefan Wahren , linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm 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 Mon, May 21, 2018 at 2:57 PM, Yisheng Xie wrote: > match_string() returns the index of an array for a matching string, > which can be used intead of open coded variant. > > Cc: Michael Turquette > Cc: Stephen Boyd > Cc: Eric Anholt > Cc: Stefan Wahren > Cc: linux-clk@vger.kernel.org > Cc: linux-rpi-kernel@lists.infradead.org > Cc: linux-arm-kernel@lists.infradead.org > Signed-off-by: Yisheng Xie > - size_t i, j; > - int ret; > + int i, ret; I do not see any need to change type for i. > + ret = match_string(cprman_parent_names, > + ARRAY_SIZE(cprman_parent_names), > + parents[i]); > + if (ret >= 0) > + parents[i] = cprman->real_parent_names[ret]; -- With Best Regards, Andy Shevchenko