From patchwork Wed May 8 11:28:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDE1F1390 for ; Wed, 8 May 2019 11:29:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD988283A6 for ; Wed, 8 May 2019 11:29:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0E18283C3; Wed, 8 May 2019 11:29:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D31D0283CF for ; Wed, 8 May 2019 11:29:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0CBD56B000D; Wed, 8 May 2019 07:29:30 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 07A9F6B000E; Wed, 8 May 2019 07:29:29 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E383A6B0010; Wed, 8 May 2019 07:29:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by kanga.kvack.org (Postfix) with ESMTP id C2C0B6B000D for ; Wed, 8 May 2019 07:29:29 -0400 (EDT) Received: by mail-qk1-f197.google.com with SMTP id u15so21368112qkj.12 for ; Wed, 08 May 2019 04:29:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=ej4TvjRJPb880Evlka3jGsq9toPstBngds/H7MSz+98=; b=kMDIXad8PU3MvaXREupZJleecPLhbEr9+xn276BAs/03y/8gSf/bDTsXM+65S6xDJt a6DM4Jr1pbqtUSr0dNP4roV1jbgx/DrtSxwrcVyNUouLq7rcUZ/gJMRg/uXxQumH4OxT IZNivnlSO84+PAMHR0X3kaXT0Qmb5sUztLIN8jPyns/vqCJsMjVKL5ha5q7RKu5RT6f7 J06wyRDReK3EzxFR6YPr2kzptEe5ONg1qWrJNPDNKO7RLYnQjLF1n2RZlX7k0KADBf5V K+gzAishI8BnZBqRBZWwMLHaRi3iOY3K22n/tYrQquYh6Jh4iCChJRlV3hxEivZH4P5z QG4A== X-Gm-Message-State: APjAAAVnoIdfRqBNJWa+y66178trvAn2odCDIH9Bbe1RX8VMB/9+u4yL RC5U4ecS7vX62RCisc0VwGLhn4S9WH+EKxiXDPeuG8iypEBkFVtLeZmUrHy7ojavoNNqhRCigpF TR6YgEWgVN+Ku1KWN/6nm4kgsoaJu7JTWxtI68z5ZOfG5/kMF6+jplxe/5iHyVfOZJw== X-Received: by 2002:ad4:4025:: with SMTP id q5mr29462973qvp.41.1557314969522; Wed, 08 May 2019 04:29:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwrdBlyT2fN1QoBIhFWuR2+Y3c0ElmQfdNPeSiT940Nk6TpDnUUBPHytMm1ah05+CMynab X-Received: by 2002:ad4:4025:: with SMTP id q5mr29462929qvp.41.1557314968879; Wed, 08 May 2019 04:29:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557314968; cv=none; d=google.com; s=arc-20160816; b=GzPnv/3u/kK87T+ZaeSMsLjIbmy/ZpWYQY0HIROpqRLSKiSO3teCKH87Xb1Omjx4Vd gFg9bMAXnwRhcEQLZqxpU4JBooFc5JNLTp5KWhUlEH+P2+rkvT5H31yLCiZ9K8S7QGtc SJJcuQIle/g6LQRbbGbnZJB4n8pTc27+fskvZ1sx1gK+bvGZmHy3VY2wKK/tZpkm0ccY WFPZYv+q6u9oc/RdGBL6Q5eH1e71zKthItJs/ycRJFmbl6r87zlLPbLol3RIHeX/AEY+ V0DptndV96wMPJk3BulW/6TwiBbx3EXwW6prL/4U9TO0IDxBgd31wKFc3w0A+iuY2wc+ 6peA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ej4TvjRJPb880Evlka3jGsq9toPstBngds/H7MSz+98=; b=R4+AHlYZZfNpAGHZRGGN6fmTO4LQeLt5oUDwvBmLrinazofq1rgrXzekqxQI9yLEFw CJLH1nLa0ivlF6JowsfP6yA0+22TNz71to3suFaGm/Gdmcsu+jQkBILZSXLM0QMU5gaj dQLoWUvxhU2nECkcWQgahb4Xk0ifugTcEHOXeGyk5eWfdSoC3QYR0z43Gs9ggfA+Zp66 y7BS0avQo1CYbg8VcxkJG3Po0helgtJ57BkXqlHu9Zh3rit9Dnf4DMZ2eEdTf0mJcgb/ NjA3xcPISRKnkCwUQZozJFq7ZMX579JCDu1tBss+9kRFOu/wuO/oc95D7jY3cWUFksw2 aX/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=h9DQ+GRs; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.74.45 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-eopbgr740045.outbound.protection.outlook.com. [40.107.74.45]) by mx.google.com with ESMTPS id x8si6703266qtr.309.2019.05.08.04.29.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:29:28 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.74.45 as permitted sender) client-ip=40.107.74.45; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=h9DQ+GRs; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.74.45 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ej4TvjRJPb880Evlka3jGsq9toPstBngds/H7MSz+98=; b=h9DQ+GRsCQDxKqwstM007EbLcpBHqWjQ2MRqXq5cju0OtcgE40K257CUdmKTcLmNiFsVQ8TTUi5HLpjaCc0tXSIxEMkemV6E3tWUguwanL7bPvyn1MHBba2gc+TzvtAMCzfuHmsH9w9p/tFocvXacJIH4a0VqaLEN/p5NINwGK0= Received: from MWHPR03CA0013.namprd03.prod.outlook.com (10.175.133.151) by BN3PR03MB2260.namprd03.prod.outlook.com (10.166.73.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Wed, 8 May 2019 11:29:27 +0000 Received: from BL2NAM02FT056.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::203) by MWHPR03CA0013.outlook.office365.com (2603:10b6:300:117::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:29:26 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta2.analog.com; Received: from nwd2mta2.analog.com (137.71.25.57) by BL2NAM02FT056.mail.protection.outlook.com (10.152.77.221) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:29:26 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id x48BTPmx016989 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:29:25 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:29:25 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 01/16] lib: fix match_string() helper when array size is positive Date: Wed, 8 May 2019 14:28:27 +0300 Message-ID: <20190508112842.11654-3-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(346002)(376002)(39860400002)(396003)(136003)(2980300002)(189003)(199004)(246002)(8676002)(356004)(5660300002)(1076003)(8936002)(50226002)(53416004)(7416002)(305945005)(2441003)(47776003)(478600001)(7636002)(336012)(107886003)(77096007)(4326008)(186003)(446003)(26005)(44832011)(126002)(476003)(2616005)(11346002)(486006)(86362001)(76176011)(7696005)(51416003)(426003)(14444005)(36756003)(2201001)(48376002)(54906003)(70586007)(110136005)(70206006)(16586007)(316002)(50466002)(2906002)(106002)(921003)(2101003)(1121003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR03MB2260;H:nwd2mta2.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail11.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 06992cbe-c2a0-450f-a978-08d6d3a86d64 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:BN3PR03MB2260; X-MS-TrafficTypeDiagnostic: BN3PR03MB2260: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: HMrFOjcKVNRTHDmX1/HvU/gXQlBl+uBSOtcwOD51vWmdyi5ZtZaq4HeTrVqglmQielk1qFJ8dbdhoPs7SBm2gQas++XsjhD055LJSrs5xjRibQaqSBcjHQ44wcFTrBpHBH89k3Ki8Yow3eXIUMpM+NlewIkNIJV3DPQLKY30RuyrOhfh8nkva9n/YB2AL2kQU6YR15UTz29qyv7g67oh8CMTWpMo3frw6vU81LMqNBFZ66OrPeZSiSJAkJBE/bMd3zQC4Hxw9oF5//2KgiJjBZpmuL6vm8U1PSkG8Dxc2tota5ciVE6wTr78/CN6CfJNaW+OzxN0iMIV1Ig8ZSn8zd4ymGDzX2XaqHB1wZ4OfMvmgpNKxP1+GEdfSFMqVRyw0npwgjP2wrgtmFovCAalytU1DI/oSEu8S/98Y5oQHkE= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:29:26.1629 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 06992cbe-c2a0-450f-a978-08d6d3a86d64 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2260 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The documentation the `_match_string()` helper mentions that `n` (size of the given array) should be: * @n: number of strings in the array or -1 for NULL terminated arrays The behavior of the function is different, in the sense that it exits on the first NULL element in the array, regardless of whether `n` is -1 or a positive number. This patch changes the behavior, to exit the loop when a NULL element is found and n == -1. Essentially, this aligns the behavior with the doc-string. There are currently many users of `match_string()`, and so, in order to go through them, the next patches in the series will focus on doing some cosmetic changes, which are aimed at grouping the users of `match_string()`. Signed-off-by: Alexandru Ardelean --- lib/string.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/string.c b/lib/string.c index 3ab861c1a857..76edb7bf76cb 100644 --- a/lib/string.c +++ b/lib/string.c @@ -648,8 +648,11 @@ int match_string(const char * const *array, size_t n, const char *string) for (index = 0; index < n; index++) { item = array[index]; - if (!item) + if (!item) { + if (n != (size_t)-1) + continue; break; + } if (!strcmp(item, string)) return index; } From patchwork Wed May 8 11:28:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935043 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 05E9F912 for ; Wed, 8 May 2019 11:29:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E69D22821F for ; Wed, 8 May 2019 11:29:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA4C3283CF; Wed, 8 May 2019 11:29:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7722283A6 for ; Wed, 8 May 2019 11:29:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C16966B0269; Wed, 8 May 2019 07:29:40 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id BC6FD6B026A; Wed, 8 May 2019 07:29:40 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A1A026B026B; Wed, 8 May 2019 07:29:40 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) by kanga.kvack.org (Postfix) with ESMTP id 68C946B0269 for ; Wed, 8 May 2019 07:29:40 -0400 (EDT) Received: by mail-oi1-f197.google.com with SMTP id s64so7017086oia.15 for ; Wed, 08 May 2019 04:29:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=rZeVg/yeEO8QwcWertBlPmQ2l7Vvz2vxMkhYSAMALsQ=; b=VoYzbBiSa4cAQUmrki0A/nO142EQOU7Cilcw5jhm4KYFxdzQifE8i/034m6n7seiCr xfmANRV+zkxc5XBE7lSLESdAfLiWTYQAbgo9+/J5lan9n002NH8942i8Pf2ekYyVnq2k pV4rCiHoALo0w/0uPtU1H7UXMr7Clu/ziZ92zsbrFbK0b08q0TIbe2z3KV4pL9bittTv 8EPnxmU9nHneElP2A2v2QI75LwwIGUC5yp/JYjtQZTaIpWc5FfITc+u95/yDNULKe6/q mvCWUnXTUccHdvBjAn4O/MAJeT1yT/QT3pYObval4gcQKDp2/nEAr1g+kS0icsRzVaV/ 0/ww== X-Gm-Message-State: APjAAAWCExl27QMhkpo4ycu89dXnTxkQcjebMJOr62P365VCKsA0JrnJ 7bqH7vixvEt0WrY9s/lWGHlq/UqEGlI257l31MHCiWbvCPj2UyZeFAfBZVoum2BqhHYBSJ+rXzL +6dDrBRKpecfXBPR2pKR/5XyZnPFLq6x2YvpparRJr4aoxOyO5gHt4LvZ3m8D1YfWnQ== X-Received: by 2002:a9d:3445:: with SMTP id v63mr13423930otb.41.1557314979952; Wed, 08 May 2019 04:29:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPDVeveBPn8P+BW5mTW0m2EIQjyPHR4UvWHUcUEfsjZqOF7qAC9bOHRCu/pVZyt51NuIHz X-Received: by 2002:a9d:3445:: with SMTP id v63mr13423821otb.41.1557314977740; Wed, 08 May 2019 04:29:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557314977; cv=none; d=google.com; s=arc-20160816; b=qMKNBapPmhcjwfe42sNw+2FTdSdZCEFkjL8gVupn5HLLRlP98bNkmT4SmlvuUQATBg Op3kmJU374ir3m467DO0c6ImYTBMpjDcKUqTfCJL/9KS5IWysDx75T3qmUrwFzJin6CH HSKcm12w1lBnXXkzyE4XUQGUSz8RxgQgp/81d8P4Y4ZcHs0n/VTA2ELbYjFNpk6rkK0e UxEcmYFE0mEg7MWri167rldrf6w6i4ztB3HYKPESlueeX3QJtRJJsX2R6lpBZoFE8+uZ SU4SrzKNcQ904azZovAEqhwRfy9+usrkP+VdQpQCP+TsO/fjCoyrLR/4IEbXv3AD99vF k63A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rZeVg/yeEO8QwcWertBlPmQ2l7Vvz2vxMkhYSAMALsQ=; b=XxhODaha1PfVmsI84xhEHAuFSOG9SS/yFgnxOiSFPsq9bT48xo+kJWd9cFkvgulnVa Wh3YDlE22FX4799Jxo3LYSCao+adhhscqCbgtROe/SpP/3ECbndY/riIC42PZ/VJXkEx /Njleftyq2aYytG8hkU64YheoZ0zzuEO4XE11bojm34HjgiLYttSBsE4FuJ54lwPvm6/ kbIzR6HY1doQnaOLdi0JfWTL2B2/U9y8BCPrjt0FAqppUUa5XeK1KLctu0vVKUFh1qqM 6DD7LYUhLYrmtrjng3CYlzPkSPLWAwAH89JjngRDKd2l3mkvDG9iBhPOHVvPZVbIxYlO su/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=Zmj6CCQT; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.47 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780047.outbound.protection.outlook.com. [40.107.78.47]) by mx.google.com with ESMTPS id a7si3097491oia.234.2019.05.08.04.29.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:29:37 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.47 as permitted sender) client-ip=40.107.78.47; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=Zmj6CCQT; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.47 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rZeVg/yeEO8QwcWertBlPmQ2l7Vvz2vxMkhYSAMALsQ=; b=Zmj6CCQTYIB00ZoWV93J92uTIgwz63rUoeawQKSxQ+DdnNQYgn1SRHMS0l4O2RAp4YDRvEGtNxW29jgr7HbuBrnNdjkUodQSa2KKmeoPfm0TSDQELrcfmdOsC867p0tSyTYBuUFQiKTF+V3OV/OnA5FSSXw5816lnQ5ojFrccCc= Received: from BN8PR03CA0012.namprd03.prod.outlook.com (2603:10b6:408:94::25) by SN2PR03MB2270.namprd03.prod.outlook.com (2603:10b6:804:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Wed, 8 May 2019 11:29:33 +0000 Received: from CY1NAM02FT046.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by BN8PR03CA0012.outlook.office365.com (2603:10b6:408:94::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1878.20 via Frontend Transport; Wed, 8 May 2019 11:29:32 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta2.analog.com; Received: from nwd2mta2.analog.com (137.71.25.57) by CY1NAM02FT046.mail.protection.outlook.com (10.152.74.232) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:29:31 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id x48BTUIq017012 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:29:30 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:29:29 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 02/16] treewide: rename match_string() -> __match_string() Date: Wed, 8 May 2019 14:28:28 +0300 Message-ID: <20190508112842.11654-4-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(136003)(346002)(39860400002)(396003)(376002)(2980300002)(199004)(189003)(76176011)(7696005)(356004)(70206006)(51416003)(316002)(7416002)(2201001)(305945005)(7636002)(107886003)(48376002)(47776003)(110136005)(16586007)(4326008)(2906002)(54906003)(53416004)(106002)(53946003)(11346002)(446003)(14444005)(36756003)(478600001)(2441003)(186003)(486006)(50226002)(126002)(2616005)(476003)(86362001)(70586007)(50466002)(336012)(8936002)(5660300002)(1076003)(30864003)(426003)(77096007)(26005)(44832011)(246002)(8676002)(921003)(83996005)(1121003)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR03MB2270;H:nwd2mta2.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail11.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6493bca1-5441-41b0-7a65-08d6d3a87133 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:SN2PR03MB2270; X-MS-TrafficTypeDiagnostic: SN2PR03MB2270: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:792; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 5+KmdLLnqwxyIcBxR3vMYyaOddNMcxSjX0hi8ijv9hA5KSlNr+cq0uJEwqa0LT+u1BaKbrF5td99i9yckshqmFf5qKus7IW14Y1chQE6/ACj6l+/R/3QEY6wqrkJn1T574YOv0KUrwnwc7PcJhgUggnqeCaTFIn5FwiN4x16gI5zn/7LAWar+UXMj/d0X0OzIccN9QE6emuT3RrKdiowr+Sm6R1tIFUngc8CVFG4eUV5z3rlaet5aBsZfs2B9Jdz5/6A6YYMxjgB+oAsP0hkHpa6UTNuG/TamX4o39dzPX2G593gqRhGCOCkW+R00Ea4AVcxI/4JxEIQ8Q2Jan7+Ef5Acl4SZLOXiJGhwgEkAsvvRgxs1IlzFMQgmt5rYUjpdGAlYwko5VLFYJgA5yCiw4HizCQm8RhrX5DJLAYC0+8= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:29:31.1227 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6493bca1-5441-41b0-7a65-08d6d3a87133 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2270 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP This change does a rename of match_string() -> __match_string(). There are a few parts to the intention here (with this change): 1. Align with sysfs_match_string()/__sysfs_match_string() 2. This helps to group users of `match_string()` into simple users: a. those that use ARRAY_SIZE(_a) to specify the number of elements b. those that use -1 to pass a NULL terminated array of strings c. special users, which (after eliminating 1 & 2) are not that many 3. The final intent is to fix match_string()/__match_string() which is slightly broken, in the sense that passing -1 or a positive value does not make any difference: the iteration will stop at the first NULL element. Signed-off-by: Alexandru Ardelean --- arch/powerpc/xmon/xmon.c | 2 +- arch/x86/kernel/cpu/mtrr/if.c | 2 +- drivers/ata/pata_hpt366.c | 2 +- drivers/ata/pata_hpt37x.c | 2 +- drivers/base/devcon.c | 2 +- drivers/base/property.c | 2 +- drivers/clk/bcm/clk-bcm2835.c | 6 +++--- drivers/clk/clk.c | 4 ++-- drivers/clk/rockchip/clk.c | 4 ++-- drivers/cpufreq/intel_pstate.c | 2 +- drivers/gpio/gpiolib-of.c | 2 +- drivers/gpu/drm/drm_edid_load.c | 2 +- drivers/gpu/drm/drm_panel_orientation_quirks.c | 2 +- drivers/gpu/drm/i915/intel_pipe_crc.c | 2 +- drivers/ide/hpt366.c | 2 +- drivers/mfd/omap-usb-host.c | 2 +- drivers/mmc/host/sdhci-xenon-phy.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 2 +- drivers/pci/pcie/aer.c | 2 +- drivers/phy/tegra/xusb.c | 2 +- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 4 ++-- drivers/pinctrl/pinmux.c | 2 +- drivers/power/supply/ab8500_btemp.c | 2 +- drivers/power/supply/ab8500_charger.c | 2 +- drivers/power/supply/ab8500_fg.c | 2 +- drivers/power/supply/abx500_chargalg.c | 2 +- drivers/power/supply/charger-manager.c | 4 ++-- drivers/staging/gdm724x/gdm_tty.c | 4 ++-- drivers/usb/common/common.c | 4 ++-- drivers/usb/typec/class.c | 10 +++++----- drivers/usb/typec/tps6598x.c | 2 +- drivers/vfio/vfio.c | 6 +++--- drivers/video/fbdev/pxafb.c | 2 +- fs/ubifs/auth.c | 4 ++-- include/linux/string.h | 2 +- kernel/cgroup/rdma.c | 2 +- kernel/sched/debug.c | 2 +- kernel/trace/trace.c | 2 +- lib/string.c | 8 ++++---- mm/mempolicy.c | 2 +- mm/vmpressure.c | 4 ++-- security/apparmor/lsm.c | 4 ++-- security/integrity/ima/ima_main.c | 2 +- sound/firewire/oxfw/oxfw.c | 2 +- sound/pci/oxygen/oxygen_mixer.c | 2 +- sound/soc/codecs/max98088.c | 2 +- sound/soc/codecs/max98095.c | 2 +- sound/soc/soc-dapm.c | 2 +- 48 files changed, 68 insertions(+), 68 deletions(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index a0f44f992360..efca104ac0cb 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -3231,7 +3231,7 @@ scanhex(unsigned long *vp) regname[i] = c; } regname[i] = 0; - i = match_string(regnames, N_PTREGS, regname); + i = __match_string(regnames, N_PTREGS, regname); if (i < 0) { printf("invalid register name '%%%s'\n", regname); return 0; diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c index 4d36dcc1cf87..4ec7a5f7b94c 100644 --- a/arch/x86/kernel/cpu/mtrr/if.c +++ b/arch/x86/kernel/cpu/mtrr/if.c @@ -142,7 +142,7 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos) return -EINVAL; ptr = skip_spaces(ptr + 5); - i = match_string(mtrr_strings, MTRR_NUM_TYPES, ptr); + i = __match_string(mtrr_strings, MTRR_NUM_TYPES, ptr); if (i < 0) return i; diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c index a219a503c229..4ba5fc9d20be 100644 --- a/drivers/ata/pata_hpt366.c +++ b/drivers/ata/pata_hpt366.c @@ -180,7 +180,7 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); - i = match_string(list, -1, model_num); + i = __match_string(list, -1, model_num); if (i >= 0) { pr_warn("%s is not supported for %s\n", modestr, list[i]); return 1; diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c index ef8aaeb0c575..ce21f01dad04 100644 --- a/drivers/ata/pata_hpt37x.c +++ b/drivers/ata/pata_hpt37x.c @@ -228,7 +228,7 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, ata_id_c_string(dev->id, model_num, ATA_ID_PROD, sizeof(model_num)); - i = match_string(list, -1, model_num); + i = __match_string(list, -1, model_num); if (i >= 0) { pr_warn("%s is not supported for %s\n", modestr, list[i]); return 1; diff --git a/drivers/base/devcon.c b/drivers/base/devcon.c index 04db9ae235e4..7bc1c619b721 100644 --- a/drivers/base/devcon.c +++ b/drivers/base/devcon.c @@ -70,7 +70,7 @@ void *device_connection_find_match(struct device *dev, const char *con_id, mutex_lock(&devcon_lock); list_for_each_entry(con, &devcon_list, list) { - ep = match_string(con->endpoint, 2, devname); + ep = __match_string(con->endpoint, 2, devname); if (ep < 0) continue; diff --git a/drivers/base/property.c b/drivers/base/property.c index 8b91ab380d14..4639275f55fe 100644 --- a/drivers/base/property.c +++ b/drivers/base/property.c @@ -443,7 +443,7 @@ int fwnode_property_match_string(const struct fwnode_handle *fwnode, if (ret < 0) goto out; - ret = match_string(values, nval, string); + ret = __match_string(values, nval, string); if (ret < 0) ret = -ENODATA; out: diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index 9fcae932e082..a775f6a1f717 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1390,9 +1390,9 @@ static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman, for (i = 0; i < data->num_mux_parents; i++) { parents[i] = data->parents[i]; - ret = match_string(cprman_parent_names, - ARRAY_SIZE(cprman_parent_names), - parents[i]); + ret = __match_string(cprman_parent_names, + ARRAY_SIZE(cprman_parent_names), + parents[i]); if (ret >= 0) parents[i] = cprman->real_parent_names[ret]; } diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 96053a96fe2f..0b6c3d300411 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2305,8 +2305,8 @@ bool clk_has_parent(struct clk *clk, struct clk *parent) if (core->parent == parent_core) return true; - return match_string(core->parent_names, core->num_parents, - parent_core->name) >= 0; + return __match_string(core->parent_names, core->num_parents, + parent_core->name) >= 0; } EXPORT_SYMBOL_GPL(clk_has_parent); diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c index c3ad92965823..373f13e9cd83 100644 --- a/drivers/clk/rockchip/clk.c +++ b/drivers/clk/rockchip/clk.c @@ -276,8 +276,8 @@ static struct clk *rockchip_clk_register_frac_branch( struct clk *mux_clk; int ret; - frac->mux_frac_idx = match_string(child->parent_names, - child->num_parents, name); + frac->mux_frac_idx = __match_string(child->parent_names, + child->num_parents, name); frac->mux_ops = &clk_mux_ops; frac->clk_nb.notifier_call = rockchip_clk_frac_notifier_cb; diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 2986119dd31f..6ed1e705bc05 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -701,7 +701,7 @@ static ssize_t store_energy_performance_preference( if (ret != 1) return -EINVAL; - ret = match_string(energy_perf_strings, -1, str_preference); + ret = __match_string(energy_perf_strings, -1, str_preference); if (ret < 0) return ret; diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 6a3ec575a404..27d6f04ab58e 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -279,7 +279,7 @@ static struct gpio_desc *of_find_regulator_gpio(struct device *dev, const char * if (!con_id) return ERR_PTR(-ENOENT); - i = match_string(whitelist, ARRAY_SIZE(whitelist), con_id); + i = __match_string(whitelist, ARRAY_SIZE(whitelist), con_id); if (i < 0) return ERR_PTR(-ENOENT); diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c index a4915099aaa9..1450051972ea 100644 --- a/drivers/gpu/drm/drm_edid_load.c +++ b/drivers/gpu/drm/drm_edid_load.c @@ -186,7 +186,7 @@ static void *edid_load(struct drm_connector *connector, const char *name, int i, valid_extensions = 0; bool print_bad_edid = !connector->bad_edid_counter || (drm_debug & DRM_UT_KMS); - builtin = match_string(generic_edid_name, GENERIC_EDIDS, name); + builtin = __match_string(generic_edid_name, GENERIC_EDIDS, name); if (builtin >= 0) { fwdata = generic_edid[builtin]; fwsize = sizeof(generic_edid[builtin]); diff --git a/drivers/gpu/drm/drm_panel_orientation_quirks.c b/drivers/gpu/drm/drm_panel_orientation_quirks.c index 52e445bb1aa5..8f7f31a1248c 100644 --- a/drivers/gpu/drm/drm_panel_orientation_quirks.c +++ b/drivers/gpu/drm/drm_panel_orientation_quirks.c @@ -200,7 +200,7 @@ int drm_get_panel_orientation_quirk(int width, int height) if (!bios_date) continue; - i = match_string(data->bios_dates, -1, bios_date); + i = __match_string(data->bios_dates, -1, bios_date); if (i >= 0) return data->orientation; } diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c index a8554dc4f196..286fad1f0e08 100644 --- a/drivers/gpu/drm/i915/intel_pipe_crc.c +++ b/drivers/gpu/drm/i915/intel_pipe_crc.c @@ -449,7 +449,7 @@ display_crc_ctl_parse_source(const char *buf, enum intel_pipe_crc_source *s) return 0; } - i = match_string(pipe_crc_sources, ARRAY_SIZE(pipe_crc_sources), buf); + i = __match_string(pipe_crc_sources, ARRAY_SIZE(pipe_crc_sources), buf); if (i < 0) return i; diff --git a/drivers/ide/hpt366.c b/drivers/ide/hpt366.c index 0a3f9bcc8b04..1c4052fd02ab 100644 --- a/drivers/ide/hpt366.c +++ b/drivers/ide/hpt366.c @@ -533,7 +533,7 @@ static const struct hpt_info hpt371n = { static bool check_in_drive_list(ide_drive_t *drive, const char **list) { - return match_string(list, -1, (char *)&drive->id[ATA_ID_PROD]) >= 0; + return __match_string(list, -1, (char *)&drive->id[ATA_ID_PROD]) >= 0; } static struct hpt_info *hpt3xx_get_info(struct device *dev) diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 800986a79704..9aaacb5bdb26 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -509,7 +509,7 @@ static int usbhs_omap_get_dt_pdata(struct device *dev, continue; /* get 'enum usbhs_omap_port_mode' from port mode string */ - ret = match_string(port_modes, ARRAY_SIZE(port_modes), mode); + ret = __match_string(port_modes, ARRAY_SIZE(port_modes), mode); if (ret < 0) { dev_warn(dev, "Invalid port%d-mode \"%s\" in device tree\n", i, mode); diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c index 8d07ee1b8f08..59b7a6cac995 100644 --- a/drivers/mmc/host/sdhci-xenon-phy.c +++ b/drivers/mmc/host/sdhci-xenon-phy.c @@ -821,7 +821,7 @@ static int xenon_add_phy(struct device_node *np, struct sdhci_host *host, struct xenon_priv *priv = sdhci_pltfm_priv(pltfm_host); int ret; - priv->phy_type = match_string(phy_types, NR_PHY_TYPES, phy_name); + priv->phy_type = __match_string(phy_types, NR_PHY_TYPES, phy_name); if (priv->phy_type < 0) { dev_err(mmc_dev(host->mmc), "Unable to determine PHY name %s. Use default eMMC 5.1 PHY\n", diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c index 776b24f54200..59ce3ff35553 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c @@ -667,7 +667,7 @@ iwl_dbgfs_bt_force_ant_write(struct iwl_mvm *mvm, char *buf, }; int ret, bt_force_ant_mode; - ret = match_string(modes_str, ARRAY_SIZE(modes_str), buf); + ret = __match_string(modes_str, ARRAY_SIZE(modes_str), buf); if (ret < 0) return ret; diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index f8fc2114ad39..41a0773a1cbc 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -203,7 +203,7 @@ void pcie_ecrc_get_policy(char *str) { int i; - i = match_string(ecrc_policy_str, ARRAY_SIZE(ecrc_policy_str), str); + i = __match_string(ecrc_policy_str, ARRAY_SIZE(ecrc_policy_str), str); if (i < 0) return; diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c index 5b3b8863363e..d5686b5db107 100644 --- a/drivers/phy/tegra/xusb.c +++ b/drivers/phy/tegra/xusb.c @@ -113,7 +113,7 @@ int tegra_xusb_lane_parse_dt(struct tegra_xusb_lane *lane, if (err < 0) return err; - err = match_string(lane->soc->funcs, lane->soc->num_funcs, function); + err = __match_string(lane->soc->funcs, lane->soc->num_funcs, function); if (err < 0) { dev_err(dev, "invalid function \"%s\" for lane \"%pOFn\"\n", function, np); diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c index 6462d3ca7ceb..07a5bcaa0067 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -348,7 +348,7 @@ static int armada_37xx_pmx_set_by_name(struct pinctrl_dev *pctldev, dev_dbg(info->dev, "enable function %s group %s\n", name, grp->name); - func = match_string(grp->funcs, NB_FUNCS, name); + func = __match_string(grp->funcs, NB_FUNCS, name); if (func < 0) return -ENOTSUPP; @@ -938,7 +938,7 @@ static int armada_37xx_fill_func(struct armada_37xx_pinctrl *info) struct armada_37xx_pin_group *gp = &info->groups[g]; int f; - f = match_string(gp->funcs, NB_FUNCS, name); + f = __match_string(gp->funcs, NB_FUNCS, name); if (f < 0) continue; diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 4d0cc1889dd9..041326d0ab7b 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c @@ -348,7 +348,7 @@ int pinmux_map_to_setting(const struct pinctrl_map *map, } if (map->data.mux.group) { group = map->data.mux.group; - ret = match_string(groups, num_groups, group); + ret = __match_string(groups, num_groups, group); if (ret < 0) { dev_err(pctldev->dev, "invalid group \"%s\" for function \"%s\"\n", diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c index 708fd58cd62b..1cf3b43a41e4 100644 --- a/drivers/power/supply/ab8500_btemp.c +++ b/drivers/power/supply/ab8500_btemp.c @@ -858,7 +858,7 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data) * For all psy where the name of your driver * appears in any supplied_to */ - j = match_string(supplicants, ext->num_supplicants, psy->desc->name); + j = __match_string(supplicants, ext->num_supplicants, psy->desc->name); if (j < 0) return 0; diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c index 98b335042ba6..8094f38e4085 100644 --- a/drivers/power/supply/ab8500_charger.c +++ b/drivers/power/supply/ab8500_charger.c @@ -1876,7 +1876,7 @@ static int ab8500_charger_get_ext_psy_data(struct device *dev, void *data) di = to_ab8500_charger_usb_device_info(usb_chg); /* For all psy where the driver name appears in any supplied_to */ - j = match_string(supplicants, ext->num_supplicants, psy->desc->name); + j = __match_string(supplicants, ext->num_supplicants, psy->desc->name); if (j < 0) return 0; diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c index 776102c31305..408339c5a4a8 100644 --- a/drivers/power/supply/ab8500_fg.c +++ b/drivers/power/supply/ab8500_fg.c @@ -2174,7 +2174,7 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data) * For all psy where the name of your driver * appears in any supplied_to */ - j = match_string(supplicants, ext->num_supplicants, psy->desc->name); + j = __match_string(supplicants, ext->num_supplicants, psy->desc->name); if (j < 0) return 0; diff --git a/drivers/power/supply/abx500_chargalg.c b/drivers/power/supply/abx500_chargalg.c index 947709cdd14e..b2fcd0ba379d 100644 --- a/drivers/power/supply/abx500_chargalg.c +++ b/drivers/power/supply/abx500_chargalg.c @@ -946,7 +946,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data) psy = (struct power_supply *)data; di = power_supply_get_drvdata(psy); /* For all psy where the driver name appears in any supplied_to */ - j = match_string(supplicants, ext->num_supplicants, psy->desc->name); + j = __match_string(supplicants, ext->num_supplicants, psy->desc->name); if (j < 0) return 0; diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c index 2e8db5e6de0b..27a8ba63563e 100644 --- a/drivers/power/supply/charger-manager.c +++ b/drivers/power/supply/charger-manager.c @@ -2019,8 +2019,8 @@ void cm_notify_event(struct power_supply *psy, enum cm_event_types type, mutex_lock(&cm_list_mtx); list_for_each_entry(cm, &cm_list, entry) { - if (match_string(cm->desc->psy_charger_stat, -1, - psy->desc->name) >= 0) { + if (__match_string(cm->desc->psy_charger_stat, -1, + psy->desc->name) >= 0) { found_power_supply = true; break; } diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c index 6e813693a766..6e147a324652 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -56,8 +56,8 @@ static int gdm_tty_install(struct tty_driver *driver, struct tty_struct *tty) struct gdm *gdm = NULL; int ret; - ret = match_string(DRIVER_STRING, TTY_MAX_COUNT, - tty->driver->driver_name); + ret = __match_string(DRIVER_STRING, TTY_MAX_COUNT, + tty->driver->driver_name); if (ret < 0) return -ENODEV; diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c index 73c8e6591746..bca0c404c6ca 100644 --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -68,7 +68,7 @@ enum usb_device_speed usb_get_maximum_speed(struct device *dev) if (ret < 0) return USB_SPEED_UNKNOWN; - ret = match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed); + ret = __match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed); return (ret < 0) ? USB_SPEED_UNKNOWN : ret; } @@ -106,7 +106,7 @@ static enum usb_dr_mode usb_get_dr_mode_from_string(const char *str) { int ret; - ret = match_string(usb_dr_modes, ARRAY_SIZE(usb_dr_modes), str); + ret = __match_string(usb_dr_modes, ARRAY_SIZE(usb_dr_modes), str); return (ret < 0) ? USB_DR_MODE_UNKNOWN : ret; } diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index 2eb623841847..4abc5a76ec51 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -1409,8 +1409,8 @@ EXPORT_SYMBOL_GPL(typec_set_pwr_opmode); */ int typec_find_port_power_role(const char *name) { - return match_string(typec_port_power_roles, - ARRAY_SIZE(typec_port_power_roles), name); + return __match_string(typec_port_power_roles, + ARRAY_SIZE(typec_port_power_roles), name); } EXPORT_SYMBOL_GPL(typec_find_port_power_role); @@ -1424,7 +1424,7 @@ EXPORT_SYMBOL_GPL(typec_find_port_power_role); */ int typec_find_power_role(const char *name) { - return match_string(typec_roles, ARRAY_SIZE(typec_roles), name); + return __match_string(typec_roles, ARRAY_SIZE(typec_roles), name); } EXPORT_SYMBOL_GPL(typec_find_power_role); @@ -1438,8 +1438,8 @@ EXPORT_SYMBOL_GPL(typec_find_power_role); */ int typec_find_port_data_role(const char *name) { - return match_string(typec_port_data_roles, - ARRAY_SIZE(typec_port_data_roles), name); + return __match_string(typec_port_data_roles, + ARRAY_SIZE(typec_port_data_roles), name); } EXPORT_SYMBOL_GPL(typec_find_port_data_role); diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c index c674abe3cf99..0389e4391faf 100644 --- a/drivers/usb/typec/tps6598x.c +++ b/drivers/usb/typec/tps6598x.c @@ -423,7 +423,7 @@ static int tps6598x_check_mode(struct tps6598x *tps) if (ret) return ret; - switch (match_string(modes, ARRAY_SIZE(modes), mode)) { + switch (__match_string(modes, ARRAY_SIZE(modes), mode)) { case TPS_MODE_APP: return 0; case TPS_MODE_BOOT: diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index a3030cdf3c18..b31585ecf48f 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -637,9 +637,9 @@ static bool vfio_dev_whitelisted(struct device *dev, struct device_driver *drv) return true; } - return match_string(vfio_driver_whitelist, - ARRAY_SIZE(vfio_driver_whitelist), - drv->name) >= 0; + return __match_string(vfio_driver_whitelist, + ARRAY_SIZE(vfio_driver_whitelist), + drv->name) >= 0; } /* diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index d59c8a59f582..0025781e6e1e 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -2129,7 +2129,7 @@ static int of_get_pxafb_display(struct device *dev, struct device_node *disp, if (ret) s = "color-tft"; - i = match_string(lcd_types, -1, s); + i = __match_string(lcd_types, -1, s); if (i < 0) { dev_err(dev, "lcd-type %s is unknown\n", s); return i; diff --git a/fs/ubifs/auth.c b/fs/ubifs/auth.c index 5bf5fd08879e..43742d76b203 100644 --- a/fs/ubifs/auth.c +++ b/fs/ubifs/auth.c @@ -235,8 +235,8 @@ int ubifs_init_authentication(struct ubifs_info *c) return -EINVAL; } - c->auth_hash_algo = match_string(hash_algo_name, HASH_ALGO__LAST, - c->auth_hash_name); + c->auth_hash_algo = __match_string(hash_algo_name, HASH_ALGO__LAST, + c->auth_hash_name); if ((int)c->auth_hash_algo < 0) { ubifs_err(c, "Unknown hash algo %s specified", c->auth_hash_name); diff --git a/include/linux/string.h b/include/linux/string.h index 6ab0a6fa512e..531d04308ff9 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -191,7 +191,7 @@ static inline int strtobool(const char *s, bool *res) return kstrtobool(s, res); } -int match_string(const char * const *array, size_t n, const char *string); +int __match_string(const char * const *array, size_t n, const char *string); int __sysfs_match_string(const char * const *array, size_t n, const char *s); /** diff --git a/kernel/cgroup/rdma.c b/kernel/cgroup/rdma.c index 1d75ae7f1cb7..65d4df148603 100644 --- a/kernel/cgroup/rdma.c +++ b/kernel/cgroup/rdma.c @@ -367,7 +367,7 @@ static int parse_resource(char *c, int *intval) if (!name || !value) return -EINVAL; - i = match_string(rdmacg_resource_names, RDMACG_RESOURCE_MAX, name); + i = __match_string(rdmacg_resource_names, RDMACG_RESOURCE_MAX, name); if (i < 0) return i; diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index 8039d62ae36e..b0efc5fe641e 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -111,7 +111,7 @@ static int sched_feat_set(char *cmp) cmp += 3; } - i = match_string(sched_feat_names, __SCHED_FEAT_NR, cmp); + i = __match_string(sched_feat_names, __SCHED_FEAT_NR, cmp); if (i < 0) return i; diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index ca1ee656d6d8..d9146141d9d8 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -4602,7 +4602,7 @@ static int trace_set_options(struct trace_array *tr, char *option) mutex_lock(&trace_types_lock); - ret = match_string(trace_options, -1, cmp); + ret = __match_string(trace_options, -1, cmp); /* If no option could be set, test the specific tracer options */ if (ret < 0) ret = set_tracer_option(tr, cmp, neg); diff --git a/lib/string.c b/lib/string.c index 76edb7bf76cb..2d5f0afef1f2 100644 --- a/lib/string.c +++ b/lib/string.c @@ -633,7 +633,7 @@ bool sysfs_streq(const char *s1, const char *s2) EXPORT_SYMBOL(sysfs_streq); /** - * match_string - matches given string in an array + * __match_string - matches given string in an array * @array: array of strings * @n: number of strings in the array or -1 for NULL terminated arrays * @string: string to match with @@ -641,7 +641,7 @@ EXPORT_SYMBOL(sysfs_streq); * Return: * index of a @string in the @array if matches, or %-EINVAL otherwise. */ -int match_string(const char * const *array, size_t n, const char *string) +int __match_string(const char * const *array, size_t n, const char *string) { int index; const char *item; @@ -659,7 +659,7 @@ int match_string(const char * const *array, size_t n, const char *string) return -EINVAL; } -EXPORT_SYMBOL(match_string); +EXPORT_SYMBOL(__match_string); /** * __sysfs_match_string - matches given string in an array @@ -667,7 +667,7 @@ EXPORT_SYMBOL(match_string); * @n: number of strings in the array or -1 for NULL terminated arrays * @str: string to match with * - * Returns index of @str in the @array or -EINVAL, just like match_string(). + * Returns index of @str in the @array or -EINVAL, just like __match_string(). * Uses sysfs_streq instead of strcmp for matching. */ int __sysfs_match_string(const char * const *array, size_t n, const char *str) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 2219e747df49..97bcf4658317 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2755,7 +2755,7 @@ int mpol_parse_str(char *str, struct mempolicy **mpol) if (flags) *flags++ = '\0'; /* terminate mode string */ - mode = match_string(policy_modes, MPOL_MAX, str); + mode = __match_string(policy_modes, MPOL_MAX, str); if (mode < 0) goto out; diff --git a/mm/vmpressure.c b/mm/vmpressure.c index 4854584ec436..d43f33139568 100644 --- a/mm/vmpressure.c +++ b/mm/vmpressure.c @@ -378,7 +378,7 @@ int vmpressure_register_event(struct mem_cgroup *memcg, /* Find required level */ token = strsep(&spec, ","); - level = match_string(vmpressure_str_levels, VMPRESSURE_NUM_LEVELS, token); + level = __match_string(vmpressure_str_levels, VMPRESSURE_NUM_LEVELS, token); if (level < 0) { ret = level; goto out; @@ -387,7 +387,7 @@ int vmpressure_register_event(struct mem_cgroup *memcg, /* Find optional mode */ token = strsep(&spec, ","); if (token) { - mode = match_string(vmpressure_str_modes, VMPRESSURE_NUM_MODES, token); + mode = __match_string(vmpressure_str_modes, VMPRESSURE_NUM_MODES, token); if (mode < 0) { ret = mode; goto out; diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c index 87500bde5a92..45d28db85e5a 100644 --- a/security/apparmor/lsm.c +++ b/security/apparmor/lsm.c @@ -1480,7 +1480,7 @@ static int param_set_audit(const char *val, const struct kernel_param *kp) if (apparmor_initialized && !policy_admin_capable(NULL)) return -EPERM; - i = match_string(audit_mode_names, AUDIT_MAX_INDEX, val); + i = __match_string(audit_mode_names, AUDIT_MAX_INDEX, val); if (i < 0) return -EINVAL; @@ -1509,7 +1509,7 @@ static int param_set_mode(const char *val, const struct kernel_param *kp) if (apparmor_initialized && !policy_admin_capable(NULL)) return -EPERM; - i = match_string(aa_profile_mode_names, APPARMOR_MODE_NAMES_MAX_INDEX, + i = __match_string(aa_profile_mode_names, APPARMOR_MODE_NAMES_MAX_INDEX, val); if (i < 0) return -EINVAL; diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c index 357edd140c09..618842f85f2d 100644 --- a/security/integrity/ima/ima_main.c +++ b/security/integrity/ima/ima_main.c @@ -61,7 +61,7 @@ static int __init hash_setup(char *str) goto out; } - i = match_string(hash_algo_name, HASH_ALGO__LAST, str); + i = __match_string(hash_algo_name, HASH_ALGO__LAST, str); if (i < 0) return 1; diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index 3d27f3378d5d..9ec5316f3bb5 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -57,7 +57,7 @@ static bool detect_loud_models(struct fw_unit *unit) if (err < 0) return false; - return match_string(models, ARRAY_SIZE(models), model) >= 0; + return __match_string(models, ARRAY_SIZE(models), model) >= 0; } static int name_card(struct snd_oxfw *oxfw) diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 81af21ac1439..13c2fb75fd71 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c @@ -1086,7 +1086,7 @@ static int add_controls(struct oxygen *chip, err = snd_ctl_add(chip->card, ctl); if (err < 0) return err; - j = match_string(known_ctl_names, CONTROL_COUNT, ctl->id.name); + 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; diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index ca172a4b6849..3ef743075bda 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -1405,7 +1405,7 @@ static int max98088_get_channel(struct snd_soc_component *component, const char { int ret; - ret = match_string(eq_mode_name, ARRAY_SIZE(eq_mode_name), name); + ret = __match_string(eq_mode_name, ARRAY_SIZE(eq_mode_name), name); if (ret < 0) dev_err(component->dev, "Bad EQ channel name '%s'\n", name); return ret; diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index 3b3a10da7f40..cd69916d5dcb 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -1636,7 +1636,7 @@ static int max98095_get_bq_channel(struct snd_soc_component *component, { int ret; - ret = match_string(bq_mode_name, ARRAY_SIZE(bq_mode_name), name); + ret = __match_string(bq_mode_name, ARRAY_SIZE(bq_mode_name), name); if (ret < 0) dev_err(component->dev, "Bad biquad channel name '%s'\n", name); return ret; diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 0382a47b30bd..c9a1e27e5839 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -753,7 +753,7 @@ static int dapm_connect_mux(struct snd_soc_dapm_context *dapm, item = 0; } - i = match_string(e->texts, e->items, control_name); + i = __match_string(e->texts, e->items, control_name); if (i < 0) return -ENODEV; From patchwork Wed May 8 11:28:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BF0DC912 for ; Wed, 8 May 2019 11:29:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9326283A6 for ; Wed, 8 May 2019 11:29:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9997F283CF; Wed, 8 May 2019 11:29:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBAEE283A6 for ; Wed, 8 May 2019 11:29:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B53E56B026B; Wed, 8 May 2019 07:29:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B02C06B026C; Wed, 8 May 2019 07:29:47 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9CBAD6B026D; Wed, 8 May 2019 07:29:47 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id 47FF36B026B for ; Wed, 8 May 2019 07:29:47 -0400 (EDT) Received: by mail-ed1-f70.google.com with SMTP id c24so2649063edb.6 for ; Wed, 08 May 2019 04:29:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=1h8/OM7WIJ2+B7PQh5VU5won9TYo5K6loDOmlI1d0MY=; b=F40PT2c7SExswF6AnmPHjTEYGHEBmRl2VrWE2dKyktbDV0vKZMm+Mq2IWUCcl47Osi 1x6eOUIY2FeDjp2JqH3N/tOPmXcoNx6+92K5b8IwrnGkDqai7HkHN9Z6IKxgTI/wWd33 cYa5ybSPSR0wRbNqCjflzMBUI8V5tvXzvEhZHvz/wNwpj3eLH+r3/6XPYbwQSwNE15G7 gjg2K8BGbsugiYIIdS8ER1gTOSBS86KUnZikMFhMv5oikGW98Rjc/TZWJdtnzTtbaRMw dyPE0zViGiaMSAEvEQmfKDDKXqIzCsnWCMidrvrrf1dmMe/KnH7jLNCEaHS8tBWD2C3k BPkw== X-Gm-Message-State: APjAAAVk5SX1cp0JGYY/vgA5nxU+pnq8a85H7R2KHl59LL0bVB+xvnFQ D6t45FT5ded7M/Ay2/UYVWohnD+HLsu/jiqmbO8UWyt32Xkp3CDA03b50UtoRp/qV5+h193T5rB a+RrQI0zd1vaue58Y22iCeF1ixNp6y6MGnROZFgjlJ1ao6t2+xL8AItDzLPbWgMAKFQ== X-Received: by 2002:a17:906:1856:: with SMTP id w22mr28330032eje.130.1557314986724; Wed, 08 May 2019 04:29:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeCPEEKDdP3/ghdpVGNFT3TfQyrDXy75WvdjEi1MvzAsVlgXHyBhlntIwxhMq5RZQktvJF X-Received: by 2002:a17:906:1856:: with SMTP id w22mr28329931eje.130.1557314984984; Wed, 08 May 2019 04:29:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557314984; cv=none; d=google.com; s=arc-20160816; b=Bm86Uppesw8+aRkF0crKYLHAEAW9KRNM/HyvMz1A1C+oXPBWD7kcbh+UID0MhHbR1j RTFkiiszRcasFipy84OjnjKr49fveqTlSqelCXkXEDnEGXXrzlKLEl7+79s64mPU/NSj pGN0UmnrnvTYTZfLuDIFpFBEHKS6ePXBO5svwG7M7COLf4dLijKYZNTbDhQZqs1OyKIE xwYNNE/f+2tHAYbeJ241Ur6yS860m3RbySkTAdCtU0UoUkMGeh6QYFz3QauDKHlf7xge MZk+ZBcza0EufkQPj7IeECNR4/ha7lPxkMDh4Hd91lk2FPBCQ+vwa1+187LO7RYzPaaN U2Rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1h8/OM7WIJ2+B7PQh5VU5won9TYo5K6loDOmlI1d0MY=; b=lGr2bGXY4xWb6G3zfJ+R3oEjQQVWbv2llClW/KC/pA+e2PR/phXnhEKVEvftJt7aIx eIij8VV/zJjsBhdDEO1lOg47e8veokkVboa4/6YUuZBxXMUm+E3wz0+w7zpv4dTjXLuK LDVjV1+ExG72pEkz2ukbAfueNaU3PrWbTLGsobtsqoncSSx6WdrQlSJ2b++6Lxf52gB9 XQbOKmCZna2mLk21ouQtlTTXt/4+HeieVJyS7sy1WajCiqw5TtS0jP/NR8+WqV0aa+ia 1Yhsaq4i44c37XPdOozYSP8qQfpYDstM3ZPuFdgQ6knRY2xfCDocDEcbwAsq+3i04TyB dFUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=QfgnDHDV; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.70.89 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM04-SN1-obe.outbound.protection.outlook.com (mail-eopbgr700089.outbound.protection.outlook.com. [40.107.70.89]) by mx.google.com with ESMTPS id r49si4105046eda.71.2019.05.08.04.29.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:29:44 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.70.89 as permitted sender) client-ip=40.107.70.89; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=QfgnDHDV; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.70.89 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1h8/OM7WIJ2+B7PQh5VU5won9TYo5K6loDOmlI1d0MY=; b=QfgnDHDVF0bpE3Lq1ne8goyHiQYLwG2dRTorIyjw235b+zmgtG2P71WpCb6/Klt10mquueyrN4BIY6989T4HneNxSCuLAVuL5tZEncHFbK/hLHSChzZsF3poHMTjUMp/nL0EVqhd2ixDaQizNevQAl7+Prw0KvOZ4UOnrvnMQ3o= Received: from BN6PR03CA0050.namprd03.prod.outlook.com (2603:10b6:404:4c::12) by CO2PR03MB2263.namprd03.prod.outlook.com (2603:10b6:102:a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Wed, 8 May 2019 11:29:37 +0000 Received: from SN1NAM02FT010.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::207) by BN6PR03CA0050.outlook.office365.com (2603:10b6:404:4c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1878.20 via Frontend Transport; Wed, 8 May 2019 11:29:37 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta2.analog.com; Received: from nwd2mta2.analog.com (137.71.25.57) by SN1NAM02FT010.mail.protection.outlook.com (10.152.72.86) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:29:36 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id x48BTZXm017075 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:29:35 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:29:35 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 03/16] lib,treewide: add new match_string() helper/macro Date: Wed, 8 May 2019 14:28:29 +0300 Message-ID: <20190508112842.11654-5-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(346002)(376002)(396003)(136003)(39860400002)(2980300002)(189003)(199004)(36756003)(48376002)(446003)(11346002)(50466002)(51416003)(2616005)(476003)(246002)(47776003)(8676002)(50226002)(8936002)(7696005)(486006)(356004)(6666004)(4326008)(107886003)(44832011)(54906003)(110136005)(316002)(53416004)(106002)(16586007)(5660300002)(14444005)(86362001)(1076003)(76176011)(7416002)(126002)(2441003)(7636002)(305945005)(2906002)(336012)(426003)(26005)(186003)(70586007)(77096007)(2201001)(478600001)(70206006)(142933001)(921003)(2101003)(83996005)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR03MB2263;H:nwd2mta2.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail11.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 31297c83-3c94-4818-a71a-08d6d3a873f6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:CO2PR03MB2263; X-MS-TrafficTypeDiagnostic: CO2PR03MB2263: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:785; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: zM9X/pZmTz9sMrsKb6y22/hNvqDLvXsAWqFIYl6VaGthrOrzboWYJJBrG2OmLxblECbDBNAYy1fAXXPFNUtNNW4OLkTQPGDSXp61NKVgByVJ1a3Yk+8M+ba9MCE1unmAirGGPUwzFdN724w4EagzPmXnryEw1auev6pHsuE3QGfkeawBN+XwLLXictqbVVmorZq+xLG2NmjhU7a77nzjfMiAjD68Le+2CXdSFEdDYqn54YA79xIG8P/2oLWGWjFQM3OBAiQ9wGQDPj9/VmzBoD2kA9N/9sT4cJYQgoQcTwatzMJSI8LlUgarl7IDcml11aWhv7z2VHqvmMPikG3Rx9WUEjseHrWcIi45ED+tXv/pGao43riYiBTfc5SL8H9qQfa8yFsiXioRJiYsgmTyxMiBHTCE3UU+818x/BxC9zs= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:29:36.2666 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 31297c83-3c94-4818-a71a-08d6d3a873f6 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2263 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP This change re-introduces `match_string()` as a macro that uses ARRAY_SIZE() to compute the size of the array. The macro is added in all the places that do `match_string(_a, ARRAY_SIZE(_a), s)`, since the change is pretty straightforward. Signed-off-by: Alexandru Ardelean --- drivers/clk/bcm/clk-bcm2835.c | 4 +--- drivers/gpio/gpiolib-of.c | 2 +- drivers/gpu/drm/i915/intel_pipe_crc.c | 2 +- drivers/mfd/omap-usb-host.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c | 2 +- drivers/pci/pcie/aer.c | 2 +- drivers/usb/common/common.c | 4 ++-- drivers/usb/typec/class.c | 8 +++----- drivers/usb/typec/tps6598x.c | 2 +- drivers/vfio/vfio.c | 4 +--- include/linux/string.h | 9 +++++++++ sound/firewire/oxfw/oxfw.c | 2 +- sound/soc/codecs/max98088.c | 2 +- sound/soc/codecs/max98095.c | 2 +- 14 files changed, 25 insertions(+), 22 deletions(-) diff --git a/drivers/clk/bcm/clk-bcm2835.c b/drivers/clk/bcm/clk-bcm2835.c index a775f6a1f717..1ab388590ead 100644 --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -1390,9 +1390,7 @@ static struct clk_hw *bcm2835_register_clock(struct bcm2835_cprman *cprman, for (i = 0; i < data->num_mux_parents; i++) { parents[i] = data->parents[i]; - ret = __match_string(cprman_parent_names, - ARRAY_SIZE(cprman_parent_names), - parents[i]); + ret = match_string(cprman_parent_names, parents[i]); if (ret >= 0) parents[i] = cprman->real_parent_names[ret]; } diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 27d6f04ab58e..71e886869d78 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -279,7 +279,7 @@ static struct gpio_desc *of_find_regulator_gpio(struct device *dev, const char * if (!con_id) return ERR_PTR(-ENOENT); - i = __match_string(whitelist, ARRAY_SIZE(whitelist), con_id); + i = match_string(whitelist, con_id); if (i < 0) return ERR_PTR(-ENOENT); diff --git a/drivers/gpu/drm/i915/intel_pipe_crc.c b/drivers/gpu/drm/i915/intel_pipe_crc.c index 286fad1f0e08..6fc4f3d3d1f6 100644 --- a/drivers/gpu/drm/i915/intel_pipe_crc.c +++ b/drivers/gpu/drm/i915/intel_pipe_crc.c @@ -449,7 +449,7 @@ display_crc_ctl_parse_source(const char *buf, enum intel_pipe_crc_source *s) return 0; } - i = __match_string(pipe_crc_sources, ARRAY_SIZE(pipe_crc_sources), buf); + i = match_string(pipe_crc_sources, buf); if (i < 0) return i; diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 9aaacb5bdb26..53dff34c0afc 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -509,7 +509,7 @@ static int usbhs_omap_get_dt_pdata(struct device *dev, continue; /* get 'enum usbhs_omap_port_mode' from port mode string */ - ret = __match_string(port_modes, ARRAY_SIZE(port_modes), mode); + ret = match_string(port_modes, mode); if (ret < 0) { dev_warn(dev, "Invalid port%d-mode \"%s\" in device tree\n", i, mode); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c index 59ce3ff35553..778b4dfd8b75 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c @@ -667,7 +667,7 @@ iwl_dbgfs_bt_force_ant_write(struct iwl_mvm *mvm, char *buf, }; int ret, bt_force_ant_mode; - ret = __match_string(modes_str, ARRAY_SIZE(modes_str), buf); + ret = match_string(modes_str, buf); if (ret < 0) return ret; diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index 41a0773a1cbc..2278caba109c 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -203,7 +203,7 @@ void pcie_ecrc_get_policy(char *str) { int i; - i = __match_string(ecrc_policy_str, ARRAY_SIZE(ecrc_policy_str), str); + i = match_string(ecrc_policy_str, str); if (i < 0) return; diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c index bca0c404c6ca..5a651d311d38 100644 --- a/drivers/usb/common/common.c +++ b/drivers/usb/common/common.c @@ -68,7 +68,7 @@ enum usb_device_speed usb_get_maximum_speed(struct device *dev) if (ret < 0) return USB_SPEED_UNKNOWN; - ret = __match_string(speed_names, ARRAY_SIZE(speed_names), maximum_speed); + ret = match_string(speed_names, maximum_speed); return (ret < 0) ? USB_SPEED_UNKNOWN : ret; } @@ -106,7 +106,7 @@ static enum usb_dr_mode usb_get_dr_mode_from_string(const char *str) { int ret; - ret = __match_string(usb_dr_modes, ARRAY_SIZE(usb_dr_modes), str); + ret = match_string(usb_dr_modes, str); return (ret < 0) ? USB_DR_MODE_UNKNOWN : ret; } diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c index 4abc5a76ec51..38ac776cba8a 100644 --- a/drivers/usb/typec/class.c +++ b/drivers/usb/typec/class.c @@ -1409,8 +1409,7 @@ EXPORT_SYMBOL_GPL(typec_set_pwr_opmode); */ int typec_find_port_power_role(const char *name) { - return __match_string(typec_port_power_roles, - ARRAY_SIZE(typec_port_power_roles), name); + return match_string(typec_port_power_roles, name); } EXPORT_SYMBOL_GPL(typec_find_port_power_role); @@ -1424,7 +1423,7 @@ EXPORT_SYMBOL_GPL(typec_find_port_power_role); */ int typec_find_power_role(const char *name) { - return __match_string(typec_roles, ARRAY_SIZE(typec_roles), name); + return match_string(typec_roles, name); } EXPORT_SYMBOL_GPL(typec_find_power_role); @@ -1438,8 +1437,7 @@ EXPORT_SYMBOL_GPL(typec_find_power_role); */ int typec_find_port_data_role(const char *name) { - return __match_string(typec_port_data_roles, - ARRAY_SIZE(typec_port_data_roles), name); + return match_string(typec_port_data_roles, name); } EXPORT_SYMBOL_GPL(typec_find_port_data_role); diff --git a/drivers/usb/typec/tps6598x.c b/drivers/usb/typec/tps6598x.c index 0389e4391faf..0c4e47868590 100644 --- a/drivers/usb/typec/tps6598x.c +++ b/drivers/usb/typec/tps6598x.c @@ -423,7 +423,7 @@ static int tps6598x_check_mode(struct tps6598x *tps) if (ret) return ret; - switch (__match_string(modes, ARRAY_SIZE(modes), mode)) { + switch (match_string(modes, mode)) { case TPS_MODE_APP: return 0; case TPS_MODE_BOOT: diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index b31585ecf48f..fe8283d3781b 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -637,9 +637,7 @@ static bool vfio_dev_whitelisted(struct device *dev, struct device_driver *drv) return true; } - return __match_string(vfio_driver_whitelist, - ARRAY_SIZE(vfio_driver_whitelist), - drv->name) >= 0; + return match_string(vfio_driver_whitelist, drv->name) >= 0; } /* diff --git a/include/linux/string.h b/include/linux/string.h index 531d04308ff9..07e9f89088df 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -194,6 +194,15 @@ static inline int strtobool(const char *s, bool *res) int __match_string(const char * const *array, size_t n, const char *string); int __sysfs_match_string(const char * const *array, size_t n, const char *s); +/** + * match_string - matches given string in an array + * @_a: array of strings + * @_s: string to match with + * + * Helper for __match_string(). Calculates the size of @a automatically. + */ +#define match_string(_a, _s) __match_string(_a, ARRAY_SIZE(_a), _s) + /** * sysfs_match_string - matches given string in an array * @_a: array of strings diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index 9ec5316f3bb5..433fc84c4f90 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -57,7 +57,7 @@ static bool detect_loud_models(struct fw_unit *unit) if (err < 0) return false; - return __match_string(models, ARRAY_SIZE(models), model) >= 0; + return match_string(models, model) >= 0; } static int name_card(struct snd_oxfw *oxfw) diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 3ef743075bda..911ffe84c37e 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c @@ -1405,7 +1405,7 @@ static int max98088_get_channel(struct snd_soc_component *component, const char { int ret; - ret = __match_string(eq_mode_name, ARRAY_SIZE(eq_mode_name), name); + ret = match_string(eq_mode_name, name); if (ret < 0) dev_err(component->dev, "Bad EQ channel name '%s'\n", name); return ret; diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c index cd69916d5dcb..d182d45d0c83 100644 --- a/sound/soc/codecs/max98095.c +++ b/sound/soc/codecs/max98095.c @@ -1636,7 +1636,7 @@ static int max98095_get_bq_channel(struct snd_soc_component *component, { int ret; - ret = __match_string(bq_mode_name, ARRAY_SIZE(bq_mode_name), name); + ret = match_string(bq_mode_name, name); if (ret < 0) dev_err(component->dev, "Bad biquad channel name '%s'\n", name); return ret; From patchwork Wed May 8 11:28:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935049 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 923571390 for ; Wed, 8 May 2019 11:29:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8203D283CF for ; Wed, 8 May 2019 11:29:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 75BFF283EE; Wed, 8 May 2019 11:29:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 882F7283C3 for ; Wed, 8 May 2019 11:29:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 33D0D6B026C; Wed, 8 May 2019 07:29:48 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 2ED1F6B026D; Wed, 8 May 2019 07:29:48 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1B5076B026E; Wed, 8 May 2019 07:29:48 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) by kanga.kvack.org (Postfix) with ESMTP id E40356B026C for ; Wed, 8 May 2019 07:29:47 -0400 (EDT) Received: by mail-ot1-f70.google.com with SMTP id 18so7592267otu.0 for ; Wed, 08 May 2019 04:29:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=x+Io6nQDgXXj6vWzapFXKhuWEwCuQ7uYG1o8foVltUs=; b=kCH3zvndBZlpdpeykMVdgscMlgtnINQ+leByiU+xlhPc5X3DVm3UDm292YjigAc2Yr liZuWkpz6btwJ8ixgxEz41KxJaiAWBAKFi2qa3w+KRFEHaBgizkfv9250livL8D+bFMO IL/5bq6zRxiMTfdEuJBad9RQlUca6wOM8Gi/F/fwhZKncaLSaTv/+t3fPwEXPoGMIvn2 pTpgx6SygU1YxNL1dMXxzJ+iS8Vr4+ammKEE+cw/y/zQGNkrNRzL4Wh9E+iAcylf478c PgcAaMHVjylYE6BkDKwozsFQSKGimsumFculndArvPJ45pe1QeKT2VLWnV7CQ9s2tAZn XRjg== X-Gm-Message-State: APjAAAWMMYcfvVA0bucS+DBoEUtPgGcjR1GSwD0yxg96p/8vdS+l1ZOg s2+OUeNnPySCz4Bk+PDpvi1D/qnf1bJUDZ9Hf/yTTkFcnmbwHM8+Gz/E3UoPvQr+cE6jRklK5Sn /BaS+DLKhJw56Hj6wAsuuFWllzWfpXslRQ7FfMM53kygmWxv04XxDb3+j+04BsIfNfQ== X-Received: by 2002:a9d:760b:: with SMTP id k11mr9068555otl.135.1557314987663; Wed, 08 May 2019 04:29:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/sYnLTmB14/bIs4LTwjnZUDLSqWKpd7/qQvekKHrSJplaUZ8VYr/k3WowdbqOF4J+B9hN X-Received: by 2002:a9d:760b:: with SMTP id k11mr9068517otl.135.1557314986906; Wed, 08 May 2019 04:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557314986; cv=none; d=google.com; s=arc-20160816; b=qOCSkSxjCSQ3NLQEC+OaDqu+YwV+TKoEQ8XhYbGsTAPZCBMeT22J0QiffuBQ2DulqH D4U8XPziZVayTvCPuD90tt+atUXE+e0iidGRvgauxLdavgs7qpYZVXST2ryyanCWKFO5 QMZ3Qyt3nYSrYWjcW6Ndaa4sV6/EKTbTObuAfFjNmuH/bBk5Ht58TinHpM1mXnlvVLHP GMlr2l0b0MqSP+HIubpduLrhbKYeFmgPMW7Df980c8vESgGaYIiKIF3nFAP5j0wTnuxL xhSH3L/gLbR376Dcv+V94X0wSqAsX6Bra04oUri44enqtkpC0l6tPnb7nUMTaTOPIcQv cdPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=x+Io6nQDgXXj6vWzapFXKhuWEwCuQ7uYG1o8foVltUs=; b=pevwv0bkEiEU0lmedJfZHp8oUEAMYQjOpBuiYKDPK2GsYo59thoDUEE9Hbg4ZSPh1o FnBf/WMbvPpAGD8BZ037aFeG+rUaPLdd3BMJFm1+ByfQdeBcaf3t669HaRWr/HssTfdS TLq6DxL9oUpyf/VPzmKjnHTBL+RM8SJ4m83HTx5JQlCmsCHy6Ovdive7FFctm5OOXAS9 bG1GJsjqa7eAjEUx55Rjzg/qXn3qicsUodTmE6/bgUx/J6R3qh+YuR/TycKeFPg9TBks +8uIjOTj5fdF6udcjEU5fgyZZrJ7RWlDNzvBrLrnc17A9FS618aBNYTrrc/kg0dcV7zM XIaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=OsAPAAdK; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.51 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780051.outbound.protection.outlook.com. [40.107.78.51]) by mx.google.com with ESMTPS id h61si9851257otb.149.2019.05.08.04.29.46 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:29:46 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.51 as permitted sender) client-ip=40.107.78.51; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=OsAPAAdK; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.51 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x+Io6nQDgXXj6vWzapFXKhuWEwCuQ7uYG1o8foVltUs=; b=OsAPAAdKA72ag6WEgtGuMxKaWxQ0gZIzCPsuAtgnnj/oFA0fbDHMGodRBcRefG9XbOE2g+Aq3eXHAUOgRsxbe9OUern7w4ZEKU1MFVRM944jQ4MmmTvJjEX5JVN0ZStKQwnZjTEaE6iWfqxBEGLRi5kjF9g1i+IhSA13dB4Oi0w= Received: from BN6PR03CA0015.namprd03.prod.outlook.com (2603:10b6:404:23::25) by SN2PR03MB2270.namprd03.prod.outlook.com (2603:10b6:804:d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Wed, 8 May 2019 11:29:43 +0000 Received: from CY1NAM02FT047.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::203) by BN6PR03CA0015.outlook.office365.com (2603:10b6:404:23::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1878.21 via Frontend Transport; Wed, 8 May 2019 11:29:43 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta2.analog.com; Received: from nwd2mta2.analog.com (137.71.25.57) by CY1NAM02FT047.mail.protection.outlook.com (10.152.74.177) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:29:41 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id x48BTenk017131 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:29:40 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:29:39 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 04/16] powerpc/xmon: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:30 +0300 Message-ID: <20190508112842.11654-6-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(136003)(346002)(39860400002)(396003)(376002)(2980300002)(199004)(189003)(76176011)(7696005)(356004)(6666004)(70206006)(51416003)(316002)(7416002)(2201001)(305945005)(7636002)(107886003)(48376002)(47776003)(110136005)(16586007)(4326008)(2906002)(54906003)(53416004)(106002)(11346002)(446003)(14444005)(36756003)(478600001)(2441003)(186003)(486006)(50226002)(126002)(2616005)(476003)(86362001)(70586007)(50466002)(336012)(8936002)(5660300002)(1076003)(4744005)(426003)(77096007)(26005)(44832011)(246002)(8676002)(921003)(83996005)(1121003)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR03MB2270;H:nwd2mta2.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail11.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dfbd6645-f3e1-49b6-1450-08d6d3a8774c X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:SN2PR03MB2270; X-MS-TrafficTypeDiagnostic: SN2PR03MB2270: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: KBaFP+VndcR4Pf2Avf8+W37sHaN8ZZJBBrWfHnFJ8l4xSH7jQGBdDEcnqagJMKs/oHbr9oYooJZUU4xkacMNv18LLG29wwpx6s6jnKluGmQRA4ewJoO4MJMNLnrj+iEP9+WvVm59vBhxTahQbM7N1ZvL80PXwnLkgR8siCzsyJn5Q9X+sxi8zBFAfc3hej5rkB8PZzkxpkMenJqsj2UIckP4SpNwF+OwyJqZITPx+vJWrk9s+k2seUKSvdSE3UyHHJZZuFbdM83NjlN0sSgLj3ONDOP7mfDlxwMMTiSqV4jdRLFHtNH5oVVbb9KCyE8DTMthgbJCPwDGxxN7b7yMODPWnGCw87W2rP6OrHNOLedXGqVbjL3JmBd48mSrS51VpGb77n/hBi2fRQlG4kD6/k+SqAT2KWOmnMUL3fQ2Hos= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:29:41.2805 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dfbd6645-f3e1-49b6-1450-08d6d3a8774c X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2270 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The change is purely cosmetic at this point in time, but it does highlight the change done in lib/string.c for match_string(). Particularly for this change, if a regname is removed (replaced with NULL) in the list, the match_string() helper will continue until the end of the array and ignore the NULL. This would technically allow for "reserved" regs, though here it's not the case. Signed-off-by: Alexandru Ardelean --- arch/powerpc/xmon/xmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index efca104ac0cb..b84a7fc1112b 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c @@ -3231,7 +3231,7 @@ scanhex(unsigned long *vp) regname[i] = c; } regname[i] = 0; - i = __match_string(regnames, N_PTREGS, regname); + i = match_string(regnames, regname); if (i < 0) { printf("invalid register name '%%%s'\n", regname); return 0; From patchwork Wed May 8 11:28:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 661D81575 for ; Wed, 8 May 2019 11:29:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54F9E283C3 for ; Wed, 8 May 2019 11:29:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47D4A283CF; Wed, 8 May 2019 11:29:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0E96283A6 for ; Wed, 8 May 2019 11:29:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB5A76B026E; Wed, 8 May 2019 07:29:52 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C41746B026F; Wed, 8 May 2019 07:29:52 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A96876B0270; Wed, 8 May 2019 07:29:52 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by kanga.kvack.org (Postfix) with ESMTP id 527A56B026E for ; Wed, 8 May 2019 07:29:52 -0400 (EDT) Received: by mail-ed1-f71.google.com with SMTP id r48so16640412eda.11 for ; Wed, 08 May 2019 04:29:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=rVLioUPEPqmLMHoafnG2eJ5Cabj4oTBfKzSwICAOZ9c=; b=HjnXcokaEkXYJJmVTITO4YpXx7uCGI9k3Ux63cMNz4ZkO0GtnK1ZDcGZeGQZPHpmO/ TU8QBgKK9FrwODvuNEdcvRgcyK5T578bI0oHuYjD8LXhUyCgCVrNmcarKGRkIgYZyh3u mboUl0bks9ttFFCY/3SqQ+cwEBHNUYEV8cbpqvy8xkyMqYCsL5VSpnZj8w8X6ANu6E4J CpU/Pw68uC7KqYVoY+OQEyRx8YrHZtR+XBLl6YR4xuAAYOQGqyJHPgat8x8JKmfS3Cnw W7jpwNAbi7gKl+xIctTnWCvccAafVmjZaIaJSMF5weAzms2xOunJ82fT5raYRfcp1nv0 PYCg== X-Gm-Message-State: APjAAAV8A5lvO5jYFzPeL54amDq2d74VyklIeeTFuB+xCtwfXHVQTSME DMeGa5cIhSJaPZ0FOm0NMPZiX0Pgepbg9CIxnBk411O308KFU5M5QTVGrUY2KmzsDJdwgmovIJs xl7GDnCbwaaHhkukAE1lBVFID13BFLjx/6p++PVUnW7uE1Vj0A3wkkqR8OupLVVHk3Q== X-Received: by 2002:a50:9470:: with SMTP id q45mr39301556eda.269.1557314991864; Wed, 08 May 2019 04:29:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwYIDgST70PjTSMFaFHdliFO+JZa/glNBEVVGukydkIIXvmEgGIToRKN0fnbuQgu73smJin X-Received: by 2002:a50:9470:: with SMTP id q45mr39301497eda.269.1557314991060; Wed, 08 May 2019 04:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557314991; cv=none; d=google.com; s=arc-20160816; b=U+kQ52KjvcRPEZU3Q+BQOduGtrhNCrtoa0Y1tOtZzIcnaTKCG6TZSAwbU8fwH/lcNT vS+1UDO1GvIdat/1sErSd6EuSoI0ayq2RrSNam0LEEHjRXDkTEBEmk5+3w06mxV6roKB DNsP8I5sR4Qoa1SdSeKY8bmfJASJ2+QsQV7AEswajfXmuMRsxw0XrudkzBAnyUSqTMi4 UhEsfWxmT7y8E7lAedVeRryrp46Wyk9L3oMHuz/sRYgax28159Xd2w+tSMpVOmZ9z+u5 7O6x7TsBXDzsv+pOueYxKpYztlBPPddaVqj9x3BbaGBbaqmIeNQufLRPoeRbDGaYrCt1 dFEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=rVLioUPEPqmLMHoafnG2eJ5Cabj4oTBfKzSwICAOZ9c=; b=twZgFsN6t9Pc0SIe0KbzwMJh+LAbVx5nhzvrqBqPn9GL7tss2Bzdqm5W1bSEu08AzX KpVC3YFCOmnwqsP3W2EmaQMMk3DnsYnBp+sU+frlSzUrVK4l7Nsvc2/k9Cek0BlqPIdc cTOnyQfQnUUQvvKDLihjidWgqr2snuDbjbTXnkPAI7rx0bsh4UUcSaCHf80fMDOaB2Ak To4/9Uu9ULs+/SHSbgnfguF1+jjqyOfeX6Y/3nQdTnwHCiLB08u+s/Dj6XmMn/VqyoOf vWTr9mwVVdOuR+HenafqbG0Pn1II0ZXnfqa8vAzlJEmEnoyfG/1Z2npo2RSeA0lp1aE5 xdww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=Kita+OJX; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.77.50 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770050.outbound.protection.outlook.com. [40.107.77.50]) by mx.google.com with ESMTPS id b16si9305609ejb.80.2019.05.08.04.29.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2019 04:29:51 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.77.50 as permitted sender) client-ip=40.107.77.50; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=Kita+OJX; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.77.50 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rVLioUPEPqmLMHoafnG2eJ5Cabj4oTBfKzSwICAOZ9c=; b=Kita+OJXRAHOVOM4gc4T1ntvIpWXz9HblUP3WpCUvTZByqJb3AyQ6OCJOQXhT+nqZ0ov9swu97CQHO0OZnp09ddpoJpdTOX3W3VKHDnVu0FlLVa52EOq1Xr7ZugLQwjrSchc/lvI/eCXy7ZUv+nBny5Xxeys9i2Si58dimzAfg4= Received: from BN6PR03CA0060.namprd03.prod.outlook.com (2603:10b6:404:4c::22) by BLUPR03MB552.namprd03.prod.outlook.com (2a01:111:e400:883::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Wed, 8 May 2019 11:29:48 +0000 Received: from BL2NAM02FT021.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by BN6PR03CA0060.outlook.office365.com (2603:10b6:404:4c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:29:47 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.57) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.57 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.57; helo=nwd2mta2.analog.com; Received: from nwd2mta2.analog.com (137.71.25.57) by BL2NAM02FT021.mail.protection.outlook.com (10.152.77.158) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:29:47 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta2.analog.com (8.13.8/8.13.8) with ESMTP id x48BTl35017158 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:29:47 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:29:46 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 05/16] ALSA: oxygen: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:31 +0300 Message-ID: <20190508112842.11654-7-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.57;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(979002)(1496009)(136003)(346002)(376002)(39860400002)(396003)(2980300002)(199004)(189003)(76176011)(126002)(305945005)(4326008)(8936002)(478600001)(106002)(48376002)(44832011)(316002)(70586007)(110136005)(70206006)(5660300002)(50226002)(51416003)(7696005)(486006)(54906003)(50466002)(2201001)(16586007)(1076003)(2441003)(47776003)(14444005)(7636002)(36756003)(356004)(86362001)(6666004)(8676002)(446003)(11346002)(186003)(107886003)(2906002)(426003)(53416004)(77096007)(246002)(476003)(2616005)(336012)(7416002)(26005)(921003)(2101003)(1121003)(83996005)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR03MB552;H:nwd2mta2.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail11.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66efb482-cb0a-4dad-e5d6-08d6d3a87a1f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:BLUPR03MB552; X-MS-TrafficTypeDiagnostic: BLUPR03MB552: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: e/To3BPzuLghSO94HDnZlxoz8w67oaeR4GSzahZT9wHatcz1zrWh6fCxUMAieE1jx47k0sRobJfJVMtHF6W19Tt9mzjOE1Lu1pitLTXvTYnWDfIHRbocgJHDAtxc9EVQk/DKKZoTBrSu0hL6fWGXjHzQ6643G/LeohDW4CeQx3HGpAo6nMhSKo06dWsOGgF8+yLFj4fQ5P3zYsgKcz+tIwrJHRcgPbJNGxFE+RUIIh8EdipADsgsLBuXl6YKd3ykQqSQoqrQUiSwSHgirDUboymSwsWHchiPV5ab5yzm94c51T28FewuN+V+WtyvJ28SovC51o8MtkuP86kD1Xn9HGHuClYC+YNCsIEjvGeEDYas4Zxt8B5+ACjPzvfNHJ5qVl55hDB4b7DOIbfGhCY/0XisSYWHvRU0oj0SFJLi5yE= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:29:47.5230 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66efb482-cb0a-4dad-e5d6-08d6d3a87a1f X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.57];Helo=[nwd2mta2.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB552 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The change is purely cosmetic at this point in time, but it does highlight the change done in lib/string.c for match_string(). Particularly for this change, a control mode can be removed/added at a different index/enum-value, and the match_string() helper will continue until the end of the array and ignore the NULL. Signed-off-by: Alexandru Ardelean --- sound/pci/oxygen/oxygen_mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/oxygen/oxygen_mixer.c b/sound/pci/oxygen/oxygen_mixer.c index 13c2fb75fd71..961fd1cbc712 100644 --- a/sound/pci/oxygen/oxygen_mixer.c +++ b/sound/pci/oxygen/oxygen_mixer.c @@ -1086,7 +1086,7 @@ static int add_controls(struct oxygen *chip, err = snd_ctl_add(chip->card, ctl); if (err < 0) return err; - j = __match_string(known_ctl_names, CONTROL_COUNT, ctl->id.name); + j = match_string(known_ctl_names, ctl->id.name); if (j >= 0) { chip->controls[j] = ctl; ctl->private_free = oxygen_any_ctl_free; From patchwork Wed May 8 11:28:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935067 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51D33912 for ; Wed, 8 May 2019 11:30:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 334BE1FF73 for ; Wed, 8 May 2019 11:30:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FF652848D; Wed, 8 May 2019 11:30:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A98661FF73 for ; Wed, 8 May 2019 11:30:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 70EC66B026F; Wed, 8 May 2019 07:29:59 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 6E4136B0270; Wed, 8 May 2019 07:29:59 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 55F216B0271; Wed, 8 May 2019 07:29:59 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by kanga.kvack.org (Postfix) with ESMTP id 29B586B026F for ; Wed, 8 May 2019 07:29:59 -0400 (EDT) Received: by mail-ot1-f72.google.com with SMTP id f92so5107075otb.3 for ; Wed, 08 May 2019 04:29:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=peJzb31cm17ABrXFyc+VL8b8kWU6z5UpeWBKRx5iGOY=; b=ZKsr0UihA9DNvAYjtkL9y5NzNtZo1NXWux2EQi/Bp0Dq702TFcsO6AeBMku6GSmlhm RSI6gZvPy/rFkcUZ9AyWHM0Y+/f1s3AtFVjV9qx866+RhMefsQcqPtwNhEuTW89ef6zN Xxm2fsxeNnPi1v0/vOqy+dZetqEmjc6Un9k9TczQAXRjtN8Z50c8xmvgco9Lx/qvadPh v2VT6QCR+Kt3lvL//NbVm2W/drXakCj8Gyq7xf7cI0jqmpnzBvQRPK1T7zPmw30kqKXJ kT0Dg+M5+agqDhw5o4RypKeNfwk/SdVy9cNEYknuBr/6f5+vRKcJL8RDAYKCDK7+9SnD pH5A== X-Gm-Message-State: APjAAAXkAVkV0itqni6g/TV2N4kllWmE+rqIcnReY7jqZp+XlF0bfPhD orx0YHnMu77zIbL1UR/KweY8lpyuFVzQwODadj09eyEQbLcN9dLM0Uauv0r2IH98NvHlkfxpocN OEBxqcMytfwB1yP6YUdoc7R1J7vE9k80R33Z93VblcLWG2nhsIOIdFLM3FDHKaGnIow== X-Received: by 2002:aca:5050:: with SMTP id e77mr1826779oib.31.1557314998841; Wed, 08 May 2019 04:29:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFwLSjjxJIVTelKaTpYu6mVpNz1LkKyGPLcTwdANZSWajs8xksQ+iGl5JJcowGb3cbYUn8 X-Received: by 2002:aca:5050:: with SMTP id e77mr1826745oib.31.1557314997956; Wed, 08 May 2019 04:29:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557314997; cv=none; d=google.com; s=arc-20160816; b=oagOB/MEn1OeKjQ98ke64kkCFA8e8S7msuoMKOj/JYPCzVnZXwOKXoW07MDK9WKQwy xtAu//Yq8BQxujk7s76tOP74zqpLYGIzaMPpLsQsNOITX4xz3Z3SjVxD2bKDclK9j6xZ 54zv3+r/yS714oXemD9EGHKanZD29vSuHmADvrOhms1t5sxtN8XSxFQV5Dzln1FmvNoI oB9lsMXTv3rGJdCxobbkd/DNgPPGA6PJlRtKgmrxoBwORoi9OqnxeJhZWr4gmS9Jldu+ EMHm/hs+CUBD5D8uVkFk1cHYLdXB3MB5bKqTA3dt0A6cRqKg/vAXN0PtEJCqTh+6cCD9 SlDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=peJzb31cm17ABrXFyc+VL8b8kWU6z5UpeWBKRx5iGOY=; b=dWO1j4XsiBUCKUPYEKlf6guU19AAFcyR6z54Xp1sqq+gKJLJUTHaPRAl35b0Rw9f/m CfoPKcDBvVkCSaVw/58sD96cdV/8Cu4Nxr3js3l7PFPlCFRn4o8NSm1zwszWnWOju75r F5TcPt4qNNtZpOtL5egmDt07DM3tM/Rtxx0msGshe8r4NHHQ3REmKMzcA97HmO9CmJ0p KhFyCYK1OWb8a9qdDBz1VP4n836CoA3P72zGRuVPjEpBUd1rxl1B8H2HbxV4TyMeFSw+ MAlvH3K5z3AjvAAKBHMz4zSxQG1CY7u6FUdVFrQeN50lUBQu6t2I3x2vzlFH+p9yxrq7 0W+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=Ht8Fm6RX; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.44 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780044.outbound.protection.outlook.com. [40.107.78.44]) by mx.google.com with ESMTPS id k127si9628825oif.144.2019.05.08.04.29.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:29:57 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.44 as permitted sender) client-ip=40.107.78.44; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=Ht8Fm6RX; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.44 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=peJzb31cm17ABrXFyc+VL8b8kWU6z5UpeWBKRx5iGOY=; b=Ht8Fm6RXFzi+Mh2C7TtDBrevghDIkKBBrf5hR26HEMHT3clXH+auLpcCAPlBDjunidMIf2KlMCOrIihkOj8RRHLgWzEWMMKXr0g4KWNemLVVhqUlyEjNr2yadJK+HpBmin3dfirgmdsGRBLIe+wQFsopNOyElR+2pj8AJZVAfxw= Received: from BYAPR03CA0029.namprd03.prod.outlook.com (2603:10b6:a02:a8::42) by CY4PR03MB3127.namprd03.prod.outlook.com (2603:10b6:910:53::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.15; Wed, 8 May 2019 11:29:53 +0000 Received: from BL2NAM02FT049.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::206) by BYAPR03CA0029.outlook.office365.com (2603:10b6:a02:a8::42) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:29:52 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by BL2NAM02FT049.mail.protection.outlook.com (10.152.77.118) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:29:52 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BTp08023613 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:29:51 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:29:51 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 06/16] x86/mtrr: use new match_string() helper + add gaps == minor fix Date: Wed, 8 May 2019 14:28:32 +0300 Message-ID: <20190508112842.11654-8-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(39860400002)(346002)(136003)(396003)(376002)(2980300002)(189003)(199004)(478600001)(356004)(7416002)(4326008)(476003)(107886003)(305945005)(5660300002)(76176011)(48376002)(47776003)(50466002)(486006)(7636002)(44832011)(70206006)(70586007)(2906002)(110136005)(6666004)(50226002)(8936002)(54906003)(2616005)(246002)(53416004)(16586007)(1076003)(8676002)(11346002)(106002)(86362001)(7696005)(51416003)(446003)(126002)(426003)(186003)(2441003)(2201001)(336012)(316002)(26005)(36756003)(77096007)(921003)(83996005)(2101003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB3127;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9e84d071-f926-4c84-2e80-08d6d3a87ceb X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:CY4PR03MB3127; X-MS-TrafficTypeDiagnostic: CY4PR03MB3127: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: hda0K0v5ij/G6H2YACXfIt6bKjpSjAgKGea3NqLag4TL7c+wMp6G/9ToPo3Vo2ALGoXYKL8lIXefI3pjgsKmvrxcQbFYmQXJS7mMxOOHzlhmFQ7IYxncBKfDC4dQju6ANVJhrbiCK6I2H9u41GPFBS6zp5bmQ3KEGqcTA6uu8J8UwkG02mPR404b+UaRjboXhFhWhmzco8OFnY/ZS+Oyiv+jgrcub3OWF1ZE6g2PWZYCiPw+ix3NL4MdKxaNv0gnzhApnIqnJ4GghYC7Eb4ExLnTn+gnu/dJzfLMbsj54G46HtKSw8zG3MhatUk0Fy/RUF/d0ftyuE3K6GD9m91VOurlbnHt9HiykZLpXxUZ0G1o+7zGAAC/ca50ThQK38xp2eRz+OZNwVPJAdO97Sm3P+EhZBozB3hNY3g9PrvxJRw= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:29:52.2067 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9e84d071-f926-4c84-2e80-08d6d3a87ceb X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB3127 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP This change is a bit more than cosmetic. It replaces 2 values in mtrr_strings with NULL. Previously, they were defined as "?", which is not great because you could technically pass "?", and you would get value 2. It's not sure whether that was intended (likely it wasn't), but this fixes that. Signed-off-by: Alexandru Ardelean --- arch/x86/kernel/cpu/mtrr/if.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c index 4ec7a5f7b94c..e67820a044cc 100644 --- a/arch/x86/kernel/cpu/mtrr/if.c +++ b/arch/x86/kernel/cpu/mtrr/if.c @@ -20,8 +20,8 @@ static const char *const mtrr_strings[MTRR_NUM_TYPES] = { "uncachable", /* 0 */ "write-combining", /* 1 */ - "?", /* 2 */ - "?", /* 3 */ + NULL, /* 2 */ + NULL, /* 3 */ "write-through", /* 4 */ "write-protect", /* 5 */ "write-back", /* 6 */ @@ -29,7 +29,9 @@ static const char *const mtrr_strings[MTRR_NUM_TYPES] = const char *mtrr_attrib_to_str(int x) { - return (x <= 6) ? mtrr_strings[x] : "?"; + if ((x >= ARRAY_SIZE(mtrr_strings)) || (mtrr_strings[x] == NULL)) + return "?"; + return mtrr_strings[x]; } #ifdef CONFIG_PROC_FS @@ -142,7 +144,7 @@ mtrr_write(struct file *file, const char __user *buf, size_t len, loff_t * ppos) return -EINVAL; ptr = skip_spaces(ptr + 5); - i = __match_string(mtrr_strings, MTRR_NUM_TYPES, ptr); + i = match_string(mtrr_strings, ptr); if (i < 0) return i; From patchwork Wed May 8 11:28:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935071 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AFEF31575 for ; Wed, 8 May 2019 11:30:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A03BF284ED for ; Wed, 8 May 2019 11:30:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93C82284F9; Wed, 8 May 2019 11:30:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 030F2284ED for ; Wed, 8 May 2019 11:30:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7AA246B0271; Wed, 8 May 2019 07:30:04 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 781506B0272; Wed, 8 May 2019 07:30:04 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 621DB6B0273; Wed, 8 May 2019 07:30:04 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by kanga.kvack.org (Postfix) with ESMTP id 3EDFE6B0271 for ; Wed, 8 May 2019 07:30:04 -0400 (EDT) Received: by mail-io1-f70.google.com with SMTP id v11so7807801ion.22 for ; Wed, 08 May 2019 04:30:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=pjcT89AhZdKkG8M5isLXr+VAVcRFhlBYogTm1g/4pg8=; b=aEcW+qiDtg0Iat2Pr5CefSPLfpgqio5+XIgQ/K2epNTwXPGFmJGveUmhu9Z4Mufx62 jQhrRw0u2Htu2F7svaHmYsBsQLfp41Wuk3eATJn8dlUC/V7kdueJ7CDEVsv/2yN2EOZF YJa6+iGo7niArqDY6kGClg/ZjCmeDz4rkkslD3ExdFtZO6+sPsymsHEZcTTw9pX8dvOC ug7l+lHO5wlNKU5gC11oLCr3wr+p/j1dRm5tYIA6j/6dprAlatlAkRVLR/ey7ufBtgH9 98v0D7NRmyCyjy6mCKbIDH0UKcJCoGIneBE6EpNF8a14iQG+uI+IxtAx9BcBNo2k+z8t HH1A== X-Gm-Message-State: APjAAAUdhZ+6ECGmwRa3ZVMLjyYWlm86OBiogyskeeSfKdUrq2iPaPc6 p21zLGrllPFIDM5toSLNSJET6aTvktko1WyabMn0MRoOTXGnDGbdTuQMI02VWydgDCcjbj4a+jq V6U1644RO0TewpM9WQguhT+lbmRaYofMF2EekV+TYDy64Nm4MXH0tx9HgmkWIyj2CEQ== X-Received: by 2002:a24:b701:: with SMTP id h1mr2969787itf.178.1557315003981; Wed, 08 May 2019 04:30:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0Lr/7/vA6TM4fThfIGJC+wKAfSImUclNDhLFqUQQfUu/shacNuWrBuCfivGYJDcx9o1DW X-Received: by 2002:a24:b701:: with SMTP id h1mr2969744itf.178.1557315003292; Wed, 08 May 2019 04:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315003; cv=none; d=google.com; s=arc-20160816; b=OgvyqpbS5YdRA0T+FyQetB+tohsJLCbpB5ua3NwSd0fjtFdeWqm2GgqgQUyxigfB7l /Cfq/SgIuNMs1ETAMh4iIbrLvqV4mLqWyWbB8xhdbkGPRGwQBpWNPtSfLDW3aefdKj/A 9CJxNCMDuxqYgsOsGQSkKTnU03Wn1Ll2xnlkX5Ylv/2yB3dPn3OQAS6toiBhCqp95E5z jspyEXP4Dkcl2//XYuKreKGc3UpcoG1NWCECfxOqbT7M4ws2hHm2lRboU+43srcbbzby ckw6XVYMEaRAY4o2YMKx3aUiYByIZFtjJYkEeV61cmmxa0cSVKAGk0MxamVry3WVIQna TQKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pjcT89AhZdKkG8M5isLXr+VAVcRFhlBYogTm1g/4pg8=; b=FpmIC12YjxPGkSOlbio8hj/zlAKpPzHy7IIre+Em82t7bpkeiaKcBWB3V4dn1YMIqU FSYNGYkTerD1p8Z9qd7qDR4UnpdfzvY+gRlsRC18hUVnMVYeAPzGQI9w0wULu7GOsi+2 2HaXoHoOuwJUwsJrwNl5RWszCtenxmN8AkxXgi2W3E8CzHC57t8a1XuE769rg7Jbft1l gEbFgPqqPfJPKUrHfKVpJMrjuLKujABIFZJR9Zb62CSa2MdudXkLoKQYMWMtvk0bKRK/ 7EeouumK7upixIGNU7ksZ+T4AXPXXrziItbwIC+hWuXDBYSMB4pNlE4M0KoktHWFUCib 3Mzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=q7IP+9NQ; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.72.58 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720058.outbound.protection.outlook.com. [40.107.72.58]) by mx.google.com with ESMTPS id s10si1727456ita.9.2019.05.08.04.30.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:30:03 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.72.58 as permitted sender) client-ip=40.107.72.58; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=q7IP+9NQ; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.72.58 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pjcT89AhZdKkG8M5isLXr+VAVcRFhlBYogTm1g/4pg8=; b=q7IP+9NQa5EDYubf+Njn1bcwKqmHVEVEGwgvxF4CCCebgPyhKgL87yUmH6oKqvITyTy7ly7BzqJF9CuibfYxh1CD7eVrjMoC5DQyzQjqpnGGsZvQUhXfV78CE1aOuzWdCyhisJf3G2Zqgl4Qabaoo9JYILLYMMWBWRQ5g29Xp+w= Received: from MWHPR03CA0049.namprd03.prod.outlook.com (2603:10b6:301:3b::38) by MWHPR03MB3134.namprd03.prod.outlook.com (2603:10b6:301:3c::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Wed, 8 May 2019 11:29:57 +0000 Received: from BL2NAM02FT003.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::201) by MWHPR03CA0049.outlook.office365.com (2603:10b6:301:3b::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1878.21 via Frontend Transport; Wed, 8 May 2019 11:29:57 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by BL2NAM02FT003.mail.protection.outlook.com (10.152.76.204) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:29:56 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BTu06023698 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:29:56 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:29:56 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 07/16] device connection: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:33 +0300 Message-ID: <20190508112842.11654-9-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(346002)(396003)(136003)(376002)(39860400002)(2980300002)(199004)(189003)(36756003)(50226002)(246002)(47776003)(8936002)(8676002)(2906002)(48376002)(70586007)(76176011)(54906003)(4326008)(106002)(70206006)(86362001)(51416003)(2201001)(107886003)(14444005)(316002)(110136005)(16586007)(7696005)(486006)(11346002)(53416004)(126002)(476003)(2616005)(446003)(44832011)(2441003)(50466002)(7636002)(305945005)(7416002)(6666004)(426003)(186003)(5660300002)(336012)(478600001)(77096007)(1076003)(356004)(26005)(921003)(83996005)(1121003)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR03MB3134;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 91c3809a-bbd8-4770-1064-08d6d3a87fc5 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:MWHPR03MB3134; X-MS-TrafficTypeDiagnostic: MWHPR03MB3134: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: vPHqUyoLZcW0hVOhWn9GTqMZTbShobrGD2/ViAb1u/5/xckKY/lz+Bdz9sVMaISB5ZX+9BzGInurLqmM2FwjifOIAfCaB8oBwVzIS8pCv9hhyB42Iq3xXxptH5PZSBgO+M5i2dwNxoYHH/OfZkBJA5ivGIM3gJVbqng57UMMXQ2w+fpSmMh4cSgClNCxo8N5onzhk1RNY/exNSfBdSN+Djs9KjT6E9pvBp/NmRaLYmuLC6ZT+yMJ9koDYkjHuyWAEmz0HO0dNrjGBmAXW52KixyJ8drIdiD8EfBe6ovS9H4IykWVZ+zhpPAJrX7aE7bNhPgAj6OIz76YE9VndH2HHEjnLTtm3qOeMcvAav+dbYvG6K++r8veVFChlLmcP/tySHd8yyqVyS0HojCmo6O6IxxBOqhu4D25Gwq0FyInxLU= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:29:56.9840 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 91c3809a-bbd8-4770-1064-08d6d3a87fc5 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB3134 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The `device_connection` struct is defined as: struct device_connection { struct fwnode_handle *fwnode; const char *endpoint[2]; const char *id; struct list_head list; }; The `endpoint` member is a static array of strings (on the struct), so using the match_string() (which does an ARRAY_SIZE((con->endpoint)) should be fine. The recent change to match_string() (to ignore NULL entries up to the size of the array) shouldn't affect this. Signed-off-by: Alexandru Ardelean --- drivers/base/devcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/base/devcon.c b/drivers/base/devcon.c index 7bc1c619b721..4a2338665585 100644 --- a/drivers/base/devcon.c +++ b/drivers/base/devcon.c @@ -70,7 +70,7 @@ void *device_connection_find_match(struct device *dev, const char *con_id, mutex_lock(&devcon_lock); list_for_each_entry(con, &devcon_list, list) { - ep = __match_string(con->endpoint, 2, devname); + ep = match_string(con->endpoint, devname); if (ep < 0) continue; From patchwork Wed May 8 11:28:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935077 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E48C13AD for ; Wed, 8 May 2019 11:30:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D059284F9 for ; Wed, 8 May 2019 11:30:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 303742851B; Wed, 8 May 2019 11:30:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7E04284E8 for ; Wed, 8 May 2019 11:30:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 22C7B6B0273; Wed, 8 May 2019 07:30:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 202796B0274; Wed, 8 May 2019 07:30:10 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07CEC6B0275; Wed, 8 May 2019 07:30:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-oi1-f200.google.com (mail-oi1-f200.google.com [209.85.167.200]) by kanga.kvack.org (Postfix) with ESMTP id CC94B6B0273 for ; Wed, 8 May 2019 07:30:09 -0400 (EDT) Received: by mail-oi1-f200.google.com with SMTP id m207so7030190oig.4 for ; Wed, 08 May 2019 04:30:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=TppapvdTdEWShhGPGCPSH9uz8QgU5Op8E8ytcSMFOwg=; b=bnMeMZtZSJbnEk97l2BVTEIs/NMZxYDxLfNPa6LX1T6oUxNiAvkChcH/2AMOAzvLs4 AhQvTjEFahTWFnF4KnwTPPSlowmgHmUyYeebFXDme5bCuN8+SD1NBYHChIrLjjzn1jOf Frj/edPB1ygGLkVBNX+Wctt3jZyJCkXHRhR7jkJv+Tm+1+3R1fRBZtlTZrjQRDI8OuEy S4Mzkus8Yz2rIo5cl06UpxKj7ZBdQh9jV+taInU0eEUqVcQ6zZ4bJGiZi6ma3dmHDkHF m89gm6+Sp/RGrfjC/7MyXKlFcBj5XkyQ1KUb6OBL/sBAIZdncsp2VJYYlRVA6sePo7jG pY0Q== X-Gm-Message-State: APjAAAUdKXitTxBVBZ3kfpDynfLNpkVxLyrWQ73lJ/5ZuYUSi1/L2KSI bSkS8B8nLDIe4d/2EfMyCSLpVx2NhBpPpA20caMw5dDh39SUjB+hYF1vvnjRUOKWVd+8DsWa/ID O9lzJiwVEFEcuN2aAytYUrqMFJninDd/aqcIDDTxpRqcbnDoM9ld1/3WOU9lbX4yBRA== X-Received: by 2002:aca:3d89:: with SMTP id k131mr1213244oia.37.1557315009553; Wed, 08 May 2019 04:30:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzaP2ekh8fDFfxM6MJtiQfuMxGBZi3l6y3xW1zWtA4xwrSN+WTjRjorYKBnFM/8vXjQXA82 X-Received: by 2002:aca:3d89:: with SMTP id k131mr1213193oia.37.1557315008343; Wed, 08 May 2019 04:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315008; cv=none; d=google.com; s=arc-20160816; b=sG65As/mGIShHkNDQ59IgINDZBPzE7oMES4wgakLiPsii6KpGA8jcYqdRottdB94zc X1VQD7nGtsAzMjpKXL247kGHwus1eIsylGM7bH0z4lWyeXZr6XO/BEfsMSZxnZeUGmaw AWAx7CYw/aRaGPO/0gZ5oIMR4xdu8M4bioId8bRVGMp3vwmpA/y9iuRGDVhAi+H1x9qb 7lqsKZn+YDtiA9is7RjiSEVddg4+SPX0jswL85+XCzpTzLDcVOWVEOK4kt0TJ0vpIQY1 V99tb/Nu1wkukMeDTl1ra+ESIE01QvP7iABd78YXdO/akhU4JnvQVasQSLSiyiINEyIU vGJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TppapvdTdEWShhGPGCPSH9uz8QgU5Op8E8ytcSMFOwg=; b=gwPyhKZRYbSqD5s0V0fkpdbnSmYOkUDUJAgKBcdlULzo77/2PW3CXZRkiStsQC9Kjk PVfDPlcHelrvnaojIWyJ9ot7fr9I7xHeAaqYHxiEVThp8hQUdYI3UAm7D8vbwYcTjX5K 5E7Ir3h/lUmcW8pPJuRDh++f/ohUV3DnFOiDRva23oHbnF1aKi6oDkw3bP3Vh1a6fRNn qTbO02cDzvDk44/BeUOeWebDDUVS4uKWzLpEn+scBOO43vd/LnxiXIUt8qODYnarm4cH pN6ZbIjnERfkrqYjxqaOawuosIcFzAD1ZAFHFaiP/9DvBHWKRYLR8XqkClHgkLODghPt /4+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=OQVIVgK5; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 2a01:111:f400:fe49::624 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0624.outbound.protection.outlook.com. [2a01:111:f400:fe49::624]) by mx.google.com with ESMTPS id k19si10160683otl.158.2019.05.08.04.30.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:30:08 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 2a01:111:f400:fe49::624 as permitted sender) client-ip=2a01:111:f400:fe49::624; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=OQVIVgK5; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 2a01:111:f400:fe49::624 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TppapvdTdEWShhGPGCPSH9uz8QgU5Op8E8ytcSMFOwg=; b=OQVIVgK5JxJMqIfsuBpJyNhsOscNjrf8QoWcS71HKHv5ECSFl4t6qL8cjbEvHO9onyxqCP7Eiq7Wxh8YLQX/ufSvCV0VABMsC9ZaqNqGS8uuuvsMFWUm0Wa0qvupkiH+emRfafnbKdPIl4OkQQXlSvhfm9OK1pHqR4K81+Fv0Z8= Received: from CY4PR03CA0091.namprd03.prod.outlook.com (2603:10b6:910:4d::32) by BLUPR03MB550.namprd03.prod.outlook.com (2a01:111:e400:880::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Wed, 8 May 2019 11:30:03 +0000 Received: from BL2NAM02FT017.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::204) by CY4PR03CA0091.outlook.office365.com (2603:10b6:910:4d::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1878.21 via Frontend Transport; Wed, 8 May 2019 11:30:03 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by BL2NAM02FT017.mail.protection.outlook.com (10.152.77.174) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:02 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BU1rk023711 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:30:01 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:30:01 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 08/16] cpufreq/intel_pstate: remove NULL entry + use match_string() Date: Wed, 8 May 2019 14:28:34 +0300 Message-ID: <20190508112842.11654-10-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(376002)(396003)(136003)(39860400002)(346002)(2980300002)(199004)(189003)(8676002)(77096007)(47776003)(50466002)(50226002)(26005)(478600001)(336012)(51416003)(186003)(2616005)(1076003)(2201001)(7696005)(246002)(426003)(86362001)(110136005)(106002)(305945005)(126002)(16586007)(446003)(2441003)(316002)(11346002)(54906003)(476003)(486006)(36756003)(107886003)(76176011)(53416004)(8936002)(5660300002)(4326008)(7416002)(356004)(6666004)(7636002)(44832011)(2906002)(48376002)(70586007)(70206006)(921003)(1121003)(2101003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR03MB550;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86204a62-8a3c-4b5a-9dba-08d6d3a8834f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:BLUPR03MB550; X-MS-TrafficTypeDiagnostic: BLUPR03MB550: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:541; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: rxv/XoCD6aaHG0TrRZkKWXDRcX000pKd7bfq3vJ62ePHcuWPHuGNJPBOqwgOijZqx3E8HU+x999IZl+ba88JfR0vYIb7Obj0j1eZUKusZuk8BQ/3y6BrYo03I2LI4DxBWK7qu2MZ9Itfu0i5LUpmIJtONUQwaJE75922TD4j9KqTqEJtt7Oe/4c20rd7gXAxLMfmFvG64Cz4/6AKOCc11G5CrFVaAO+gYxZukEzvn6JfBa8EqYvBAsn6lRm+PFLP0hqCZn/uR2nN9VOclRHqQPxm+Va0rH6apLh63EtDW7LtpBEfmUsSBBtIhzfYTLNJ1UfI6Mz02xdbaV19/8eub1YBOgpTClnEpYZAmVHWy3iJ9vzMVWpkffbsdAGUPXMahcgSR5z55fgI7Obs6j3WIQGQdzC6GP62894A4z71zMk= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:30:02.9332 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86204a62-8a3c-4b5a-9dba-08d6d3a8834f X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR03MB550 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The change is mostly cosmetic. The `energy_perf_strings` array is static, so match_string() can be used (which will implicitly do a ARRAY_SIZE(energy_perf_strings)). The only small benefit here, is the reduction of the array size by 1 element. Signed-off-by: Alexandru Ardelean --- drivers/cpufreq/intel_pstate.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 6ed1e705bc05..ab9a0b34b900 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -593,8 +593,7 @@ static const char * const energy_perf_strings[] = { "performance", "balance_performance", "balance_power", - "power", - NULL + "power" }; static const unsigned int epp_values[] = { HWP_EPP_PERFORMANCE, @@ -680,8 +679,8 @@ static ssize_t show_energy_performance_available_preferences( int i = 0; int ret = 0; - while (energy_perf_strings[i] != NULL) - ret += sprintf(&buf[ret], "%s ", energy_perf_strings[i++]); + for (; i < ARRAY_SIZE(energy_perf_strings); i++) + ret += sprintf(&buf[ret], "%s ", energy_perf_strings[i]); ret += sprintf(&buf[ret], "\n"); @@ -701,7 +700,7 @@ static ssize_t store_energy_performance_preference( if (ret != 1) return -EINVAL; - ret = __match_string(energy_perf_strings, -1, str_preference); + ret = match_string(energy_perf_strings, str_preference); if (ret < 0) return ret; From patchwork Wed May 8 11:28:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935085 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3D17D912 for ; Wed, 8 May 2019 11:30:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2BBED283C3 for ; Wed, 8 May 2019 11:30:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F0D8284E8; Wed, 8 May 2019 11:30:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87BCD283C3 for ; Wed, 8 May 2019 11:30:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 279846B0275; Wed, 8 May 2019 07:30:16 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 251626B0276; Wed, 8 May 2019 07:30:16 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F1466B0277; Wed, 8 May 2019 07:30:16 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id B24906B0275 for ; Wed, 8 May 2019 07:30:15 -0400 (EDT) Received: by mail-ed1-f72.google.com with SMTP id p14so7468925edc.4 for ; Wed, 08 May 2019 04:30:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=J2kUTxOBDW7W13uwOdmuJPQDQWhKkMs+dI0VfMHNhcs=; b=Esd7REmVmKkANTsLkUkVP5v6eMtgxMztPeAqqxfXdweGrBggpA7675I2B6VgxkpmQN 4KvRPaPP+T0ctvgZ9Tvju9HedGdiAxXQIt9BLokuSRevAhyZyG6pnBOTOTXv3BadQt5V KjD4xaOmz1yM0BMmvgtaD7mUXOPfKsI/teT7g03C20OXrrZ7jNyGHEj/VBFpQVzOpzg+ GgVOjCs/bRbr9CrPUt/SXBK0FRa28H1WNNa/H3Nz8nDGQhbFLLR9Ud3d4iUX3YHbj3bO R5vrFgs+8xwQu/YQUYDGB55/IgpeHDWEJnOj5emj9UWTRX/QYlXU7NUkGnV3yBZFFuy3 TxxQ== X-Gm-Message-State: APjAAAVPY92MFJ8x0ctvo/A6O25MW7yyZ7GPhIcZPiw9LaxypeYBdeE2 kiXhEDWn0EdKTNuVRocKJZEjs/9XWCeVoK+FO9N3P+booVpPWaEuuSExr0DDZSjwjrl02RslhIc rVPYCeAVsIfkXf0ur5CyJ+2Za0iMXSV5lj3js6HD2FGKabt5NHjvWcldPb0O87ISW1Q== X-Received: by 2002:aa7:d28e:: with SMTP id w14mr39794097edq.119.1557315015162; Wed, 08 May 2019 04:30:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzn05vYgoQrR4zhWPRNjO6YroGw5orUZu4jsQw/tC+JIs/13ScUvNNbywJ8Zq2zxIvFV+1H X-Received: by 2002:aa7:d28e:: with SMTP id w14mr39794012edq.119.1557315014300; Wed, 08 May 2019 04:30:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315014; cv=none; d=google.com; s=arc-20160816; b=hC0gAtdcPIpNhCVofzkbWKcMChdZcvI2uFIxUfyu9Ema0QAKtCXlOBfw3NO4pVA/ho dC1eCwofilGRZmKqtre4t3V0ziOechTKq32uOIUX9nuHjaC9MXjrB1qSWOhFUR11PW57 uHQnIOZnUHa74GNSFWys4wwuelh0Jcp0Ce0eugKYdlj0dGXqLAg7sJmPx5a16e/6pMIi TZQYCgHcIU4eI0JOs4M1CSVRa9tC4IUvcE8XHmHk9SOVIylPIivX4Bo8z/wquBhpRu/n aCnAlStCd0vKowU6kKy7QZPq/rW+cj4MmnJFVyuZnyCHHr8dTDK8wkM735MPzdA0quuO OgTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=J2kUTxOBDW7W13uwOdmuJPQDQWhKkMs+dI0VfMHNhcs=; b=QEbXfPPF2qfaSF3Pl52cw+YzYc802j/ZEJ7jhAYQjVA+ucc3qKyXnZngBbNY0sEA7t GDfJ5H5TH7q0BZsQBNkf5IIVkfJwXbmArT8etQW+iAj0zbduLSuWp1E7ya9z9jufkEfd PsTKc8IYto03Bi/GEtpgK3+/F2S6uJMYdUgpO7lbsbFQSmA5UKzqjBnYF0NfltrEIrep hT8A68SMSKyedV2cE1FndH2glUBW/WjPMy2F2ZAHTidLwvPMGMV1F0YKGzg/cMlJpCos PqW7Biqt3MZ4UfUas+zWXv1oedNT9Z/KfpenWT1JcPX1emTBu8v9pShjPvObCMzSZBXO 8dCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=HmsHAFlj; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.82.45 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-eopbgr820045.outbound.protection.outlook.com. [40.107.82.45]) by mx.google.com with ESMTPS id w18si3098920ejz.371.2019.05.08.04.30.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:30:14 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.82.45 as permitted sender) client-ip=40.107.82.45; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=HmsHAFlj; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.82.45 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J2kUTxOBDW7W13uwOdmuJPQDQWhKkMs+dI0VfMHNhcs=; b=HmsHAFljmcbaN1BpAlIGHCpGcJ5jk39AUEqf/6w5Fch3rgS9LrOHdDkTRid4twIc316F2MrfuNLVkUGQ1NWLbgumQMbITyYa+XILsOarTTI+P/wjFyGQgnt0YjzNFAD0f6jVnTLQ0U3CRal0YHtfYbnJ7fVybRtPPhSGo+MDAbc= Received: from BN3PR03CA0078.namprd03.prod.outlook.com (2a01:111:e400:7a4d::38) by CO2PR03MB2262.namprd03.prod.outlook.com (2603:10b6:102:e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Wed, 8 May 2019 11:30:10 +0000 Received: from CY1NAM02FT020.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::209) by BN3PR03CA0078.outlook.office365.com (2a01:111:e400:7a4d::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:09 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by CY1NAM02FT020.mail.protection.outlook.com (10.152.75.191) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:07 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BU7gu023733 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:30:07 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:30:06 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 09/16] mmc: sdhci-xenon: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:35 +0300 Message-ID: <20190508112842.11654-11-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(396003)(39860400002)(376002)(346002)(136003)(2980300002)(189003)(199004)(356004)(6666004)(36756003)(5660300002)(50466002)(48376002)(2616005)(126002)(426003)(336012)(107886003)(51416003)(44832011)(2906002)(47776003)(486006)(2201001)(4326008)(476003)(11346002)(446003)(86362001)(76176011)(26005)(16586007)(246002)(478600001)(2441003)(50226002)(53416004)(1076003)(7696005)(70586007)(70206006)(7636002)(305945005)(7416002)(106002)(77096007)(8676002)(316002)(186003)(110136005)(8936002)(54906003)(921003)(83996005)(1121003)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR03MB2262;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8666f1cf-9df3-40da-2f35-08d6d3a88708 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:CO2PR03MB2262; X-MS-TrafficTypeDiagnostic: CO2PR03MB2262: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 7rCCvmL00MJBmcDTDIesTQyTH/FNWfXEsju68ENrTwxg/JIcze2MSJ12BbCQi4KSrgLnc1A1T6oXYLKYxlqmijCkcIwNL4E9xzrBeXjIFArc3gJbJYEsik3rWIiMQrmNac8NKVSXbLpB/o4OjBebxyfuuKkkNtQJJAndo0715UIZuDMc1ZdvuMrceL8LElXSfQiRCtrBNnkB/KWkSmtT8hsShWBcIskk5FP30zXoYxV/z2dgb6eFA53PQRv7N/xDDavBCp9yNUm4NynSE3PGnYKIawmDQ1m2K8VQatJsc8AN1TyPmq9PF1A8pLI6egBZrXN35GHe2/ZpHJhBxPEZoVlVwSfSUS96GPx1sw2lCVmgt88RgJFlddOoDGa3f1+TOqJw2fXL5R0yGXI+tAlczYBs61mJT3hH1NvT9TI8S+8= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:30:07.6794 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8666f1cf-9df3-40da-2f35-08d6d3a88708 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2262 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The change is also cosmetic, but it also does a tighter coupling between the enums & the string values. This way, the ARRAY_SIZE(phy_types) that is implicitly done in the match_string() macro is also a bit safer. Signed-off-by: Alexandru Ardelean --- drivers/mmc/host/sdhci-xenon-phy.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci-xenon-phy.c b/drivers/mmc/host/sdhci-xenon-phy.c index 59b7a6cac995..2a9206867fe1 100644 --- a/drivers/mmc/host/sdhci-xenon-phy.c +++ b/drivers/mmc/host/sdhci-xenon-phy.c @@ -135,17 +135,17 @@ struct xenon_emmc_phy_regs { u32 logic_timing_val; }; -static const char * const phy_types[] = { - "emmc 5.0 phy", - "emmc 5.1 phy" -}; - enum xenon_phy_type_enum { EMMC_5_0_PHY, EMMC_5_1_PHY, NR_PHY_TYPES }; +static const char * const phy_types[NR_PHY_TYPES] = { + [EMMC_5_0_PHY] = "emmc 5.0 phy", + [EMMC_5_1_PHY] = "emmc 5.1 phy" +}; + enum soc_pad_ctrl_type { SOC_PAD_SD, SOC_PAD_FIXED_1_8V, @@ -821,7 +821,7 @@ static int xenon_add_phy(struct device_node *np, struct sdhci_host *host, struct xenon_priv *priv = sdhci_pltfm_priv(pltfm_host); int ret; - priv->phy_type = __match_string(phy_types, NR_PHY_TYPES, phy_name); + priv->phy_type = match_string(phy_types, phy_name); if (priv->phy_type < 0) { dev_err(mmc_dev(host->mmc), "Unable to determine PHY name %s. Use default eMMC 5.1 PHY\n", From patchwork Wed May 8 11:28:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1DE4713AD for ; Wed, 8 May 2019 11:30:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E4431FFE4 for ; Wed, 8 May 2019 11:30:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02199284F5; Wed, 8 May 2019 11:30:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F106B1FFE4 for ; Wed, 8 May 2019 11:30:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A1DC6B0276; Wed, 8 May 2019 07:30:19 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 278166B0277; Wed, 8 May 2019 07:30:19 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13FEF6B0278; Wed, 8 May 2019 07:30:19 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) by kanga.kvack.org (Postfix) with ESMTP id E215F6B0276 for ; Wed, 8 May 2019 07:30:18 -0400 (EDT) Received: by mail-io1-f72.google.com with SMTP id z2so9602582iog.12 for ; Wed, 08 May 2019 04:30:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=1chwJ3hc4UTJ3blAlYUngE824WdNkP//hIXWmk1Ja8A=; b=qKGSlanl+nXWAMy+Rhdm6HALJ3aTcjyIccNz0y0UV54BojVfDXKpfD3ml1E9wIRYjr vKiWyc31kBrNWEqnD8z/UNaBJi+dpq9WR34Qd5mPR52yisC6odiEjTWnvyuETOURNXR8 dOsqT/fU7klY7GBBJh14EUWOVrSCAif+UjTpZg8GShd1ylUpV1zFPKoqyKQNpjCX0rpB UpKX8SxD82wejrZvJoYepqPu2aKdGRocBHyAry+HzJ/z1Lc8fFwTWKYBI1NJG4FzUmTV y9wXufEAhr91hJdHDZB+5VgyG9WSqHUvjNA+3cKGkMaFvF1zM2caQWFl5oUX3kpFkJC1 2CUw== X-Gm-Message-State: APjAAAU/ddHFe2H81BuvcGsZOGvgq1xiagee/2n6Qy6fNt28dSOUQXd5 HA/uOi4CDK2X2XhJM1etvb2chzsoUFmIeAZ+iYDmQBRgRkYGv02EciAPiTItRuYntX7sMSjafY8 kJNUFuV7Xu54jAQQIpXSDc0Q+OXuRt3i1IAHiMOibz7vDuh5m5TJaxLY21P3dNFDp9A== X-Received: by 2002:a02:83ce:: with SMTP id j14mr27590819jah.61.1557315018622; Wed, 08 May 2019 04:30:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzIKWUJT15uDUaSDrqrMIIjBWJTvbO+9f2fCPxPQ9CpX/YUNetMDKZbwRfZ/ocY/S9GMqJk X-Received: by 2002:a02:83ce:: with SMTP id j14mr27590722jah.61.1557315017084; Wed, 08 May 2019 04:30:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315017; cv=none; d=google.com; s=arc-20160816; b=KS7EQGLGB8+eWwXHMCYSOge/PlSRNEZOknKJg519pUmbTtkagMhxin95UnmHWoeisJ gDlqa984655AKr8ZJiSnoh9xDicVmYOCiXVG7o7rmB9pdqJAGMqc17wNN3VR2OX/NnAq wO1Kxo6C/jyDytasswJlxxe2f6ZZq29kN3taOykMgrdD02OZ2GMQBMEwL+t226I3Yj9V xKzwnKq2RLX8+cuDBhHJMpH6WkNAoV+SivV0rrf5AfffU45moQEq7QTNp4nHphJWI2vC zzV9HA2VgVdxeNipFLnjKuRr2S2N5tbN8VUtubc+zezm0uzloPEca3h92U2TH4tj1TZg BNVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1chwJ3hc4UTJ3blAlYUngE824WdNkP//hIXWmk1Ja8A=; b=kgxdyvat85n8NNQ6xoFQL+aHk+XNt902ekyJAQdDuMBKtZB4eAe+67KanvqhT0VUMi HfJ4OOCBakms8bihkuEXN6kaGJHTnXT915NNZAWxHWZ3IT8GK+aGEMixuBCseWQvfe1N SfzkagvgXk7owf5FOd04iyQAtRkZzINdlKItHeh/sn6qqlK3h3WSgJXlfyaw2yOYWhEW yftgwwgJBRn1QKb/BQ8l4xBvYvG4Hx5OggYjn+A+6w+OLtTdyXqyljTgP/EWah3Xge/V Ijbh2ewuDXvqk0y9XxHBV7ZOGPT+WmUrWXbQO3TEA06tSO90CDtj/xdaVKbOuW17JO2K p6NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=DrUwW+Hf; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.68.71 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680071.outbound.protection.outlook.com. [40.107.68.71]) by mx.google.com with ESMTPS id k13si13528683jah.101.2019.05.08.04.30.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:30:17 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.68.71 as permitted sender) client-ip=40.107.68.71; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=DrUwW+Hf; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.68.71 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1chwJ3hc4UTJ3blAlYUngE824WdNkP//hIXWmk1Ja8A=; b=DrUwW+HfBrwsEl2in+cz4S+PdeJEOhXU7fVfQQf7K1/7Bu4CQyX95NdYXd/oxxKLzmfA94Sp9RgysVQgxHHyK+aXVQgutw8CgBlEx5J1hG33ICxZPO0+0bHw7kb6PXGJmCSPuSxrDr+dHRaQH2ilSb5oPUIKVnknHgETTrV7qvg= Received: from DM6PR03CA0001.namprd03.prod.outlook.com (2603:10b6:5:40::14) by SN2PR03MB2272.namprd03.prod.outlook.com (2603:10b6:804:d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.10; Wed, 8 May 2019 11:30:13 +0000 Received: from SN1NAM02FT003.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::203) by DM6PR03CA0001.outlook.office365.com (2603:10b6:5:40::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1878.21 via Frontend Transport; Wed, 8 May 2019 11:30:13 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by SN1NAM02FT003.mail.protection.outlook.com (10.152.73.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:12 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BUBS3023758 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:30:11 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:30:11 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 10/16] pinctrl: armada-37xx: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:36 +0300 Message-ID: <20190508112842.11654-12-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(396003)(376002)(346002)(39860400002)(136003)(2980300002)(189003)(199004)(50466002)(126002)(70586007)(476003)(246002)(106002)(2441003)(36756003)(478600001)(5660300002)(2906002)(70206006)(356004)(6666004)(44832011)(305945005)(53416004)(16586007)(446003)(11346002)(7636002)(316002)(2616005)(1076003)(486006)(51416003)(426003)(8936002)(7696005)(50226002)(336012)(2201001)(48376002)(107886003)(8676002)(86362001)(26005)(7416002)(4326008)(54906003)(110136005)(76176011)(186003)(47776003)(77096007)(921003)(83996005)(2101003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:SN2PR03MB2272;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 54ae17f8-e934-4104-71ba-08d6d3a88946 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:SN2PR03MB2272; X-MS-TrafficTypeDiagnostic: SN2PR03MB2272: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:221; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: xfAt8yPIASeIU4SWpAqv7wYVf6rgReoRasBfXu5VkYF5De6r3ChaB98QtwmzFohT7XLUcZv/paBIBGQNzEFCX/rtqn6SNp5cB2YDe1+lv35blIEB09SYcVLlHsYG9cnjNobxye4mP+4dqP11iC3pADRTivOXvbA+Tp0kI3oa4q5J5BL/KnwnnV9B5YLYrUzgEVd4bfoVd7faUQkPXj/dE3Vaf7ISG1AGagwFjfSKKsCgRru7kvI+k/bvrGow8wB5BEPLRNA7GLImCROlk0ZyBozdsEtLuar+oZzScBl6Q+M52D0eHyDc06BKyfl3wepAHxzTYDdZ5odpexJoia97/Y2agzfCyaYjbE1Nby4ArE3NQ7GcIz5zZeXT3zQbIOkDzZYrDXqhS0aaP4Yn31I6ed817wNoRQ0uge0Z2pdkt6I= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:30:12.0247 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 54ae17f8-e934-4104-71ba-08d6d3a88946 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2272 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The change is mostly cosmetic. The `armada_37xx_pin_group` struct is defined as. struct armada_37xx_pin_group { const char *name; unsigned int start_pin; unsigned int npins; u32 reg_mask; u32 val[NB_FUNCS]; unsigned int extra_pin; unsigned int extra_npins; const char *funcs[NB_FUNCS]; unsigned int *pins; }; The `funcs` field is a static array of strings, so using the new `match_string()` helper (which does an implicit ARRAY_SIZE(gp->funcs)) should be fine. Signed-off-by: Alexandru Ardelean --- drivers/pinctrl/mvebu/pinctrl-armada-37xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c index 07a5bcaa0067..68b0db5ef5e9 100644 --- a/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c +++ b/drivers/pinctrl/mvebu/pinctrl-armada-37xx.c @@ -348,7 +348,7 @@ static int armada_37xx_pmx_set_by_name(struct pinctrl_dev *pctldev, dev_dbg(info->dev, "enable function %s group %s\n", name, grp->name); - func = __match_string(grp->funcs, NB_FUNCS, name); + func = match_string(grp->funcs, name); if (func < 0) return -ENOTSUPP; @@ -938,7 +938,7 @@ static int armada_37xx_fill_func(struct armada_37xx_pinctrl *info) struct armada_37xx_pin_group *gp = &info->groups[g]; int f; - f = __match_string(gp->funcs, NB_FUNCS, name); + f = match_string(gp->funcs, name); if (f < 0) continue; From patchwork Wed May 8 11:28:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935095 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 55312912 for ; Wed, 8 May 2019 11:30:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 407DC284E8 for ; Wed, 8 May 2019 11:30:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 336D8284F5; Wed, 8 May 2019 11:30:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CBA79282EC for ; Wed, 8 May 2019 11:30:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B2866B0279; Wed, 8 May 2019 07:30:24 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 388AF6B027A; Wed, 8 May 2019 07:30:24 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2781C6B027B; Wed, 8 May 2019 07:30:24 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by kanga.kvack.org (Postfix) with ESMTP id E3FF76B0279 for ; Wed, 8 May 2019 07:30:23 -0400 (EDT) Received: by mail-pf1-f197.google.com with SMTP id s26so12410870pfm.18 for ; Wed, 08 May 2019 04:30:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=2ANUS/cN4JJVZq6SdOb8BTq0Q8zTyuGFxo7xS+ekZas=; b=o56KmBym1Vyb8NjOGqoPAUUmCStoDFlylYcj9zG3oDzr+g13iSTYTJC7BEpT9SvzwF NoEBMViGhSlhsEtdiceDNq77Ykvh0cNIuU0faIj+TkVQflxgA55D6NVMO1+z9Jb60lSL 7nYl3mIgUVWKO2qEYvz+ny4TMCP4DI1fRFS+EoeUdliD1NjmojR1sF35rDjwaUS7f8Y9 /Rw/utT/0U0y2vcH3bSDGhY8dkP0xV+V6WG3Hl/tWOgHs/8zK5mYIrJHptdRXVvxLXrk pe+uavYIEb4bhnF9ZW6aOlMAaOGXZ0iE7dPviFNM+FCWZ8C7sW5lghVV4dQA5p+ZfabR cpng== X-Gm-Message-State: APjAAAWBug8NlBNhIYhfcUujaT+HWzi5RP/FAPBI18ENUkd8a68XbPPg T+/5729YCUTgw/nbC1Dlf89odsIF0WAZZAdztPv+fwYz19/xVZX38uAMZQgeQP2Nrga9Va8E7bX f2/C/iNg+SKcpwukvlv+PqTgGikgQ1RkmEkfShPC4KC3HfzZWMzz4Blu+Bfh/qiNYpA== X-Received: by 2002:a63:5742:: with SMTP id h2mr45883819pgm.194.1557315023412; Wed, 08 May 2019 04:30:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzxRUhfCyS+1V/0HqK/iZHLJkFeVpwf8RR7td+2at1XzGa9nzp06lU0AokD7P4W0FOGyiwx X-Received: by 2002:a63:5742:: with SMTP id h2mr45883728pgm.194.1557315022387; Wed, 08 May 2019 04:30:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315022; cv=none; d=google.com; s=arc-20160816; b=tKlYUiMMoTiQGO0o+tMXwpGtmABO73yj2/av6Bj8gJPNMd0RGPNg2odhZFb8Ti6bH8 xF2nFbLr/AByJSESnSNpdARd2rwj9B00ZFHumChu1+fEGaqUz5i0tgJp1rCdg6rwjkA6 8OVWqaxfV4o5Sf3JcJ0TxiT9MCUxNRDcuW18YfSg1ugQ1Sk1ENNNmixKxv6EzwYzC1Hb y65bJ4HMOH+OXz97PFo5fUdIaRchyWz+3UGVnxragifvHIUBg4cmZL7AEvcDVz+MjLJE 2A1WpqXTfMe3yrV6Tm3qjOp4nsfpZzlkmcU/pmQbE5IwEm98Jfj9rvgZtq6rErtROsms SRFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2ANUS/cN4JJVZq6SdOb8BTq0Q8zTyuGFxo7xS+ekZas=; b=JqcEdrwtjrkdwZeTQKs49tEXdXdN7mJ3GTlHBwFvqgJxzczCg8651Olq8mW58gFRQW 3QveBxJ/VWK836R7j2gD9LFbKnemi6Z4ttUlWKQPduBX2U7WuRd/1T9+J2u3M19llbPA tfPu8vOdo8wA8e4OeqVFSG1hsPDCEY1+HPTYL5PykJeajOKNKQ3qofi1iDgru0HcwnbF ZmTkeCwTqr604iIu+1rMP8+bYJciNkJt3rLlCg9pQC0Cw+97nGDUJn7CnwLE9VhGrCK0 wFqQ6VfeQ9b57nbppHPB/TM6fQPDNJJQ1eXZ7CB2lirdgVqDFprjVSsf8M9W0UOehYp4 6/tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=YAlgegs9; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.75 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-eopbgr780075.outbound.protection.outlook.com. [40.107.78.75]) by mx.google.com with ESMTPS id g3si21626353pfi.97.2019.05.08.04.30.22 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:30:22 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.75 as permitted sender) client-ip=40.107.78.75; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=YAlgegs9; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.78.75 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2ANUS/cN4JJVZq6SdOb8BTq0Q8zTyuGFxo7xS+ekZas=; b=YAlgegs92dk0EBLrPaSAvAEoW+a6ILmnKzEUjwH9tQEsaafIGj/Jbgvg9FfspO4AAB0mHpi+xLxqThyb3jNrDhjwFUrYCAkX4mmKxh0huvawVaQ4qJsf1twnbtqNI/QY/ocFBuZ92YZHpWBwOZalU5NYJYyYwmli40Iiko9jix8= Received: from CY4PR03CA0076.namprd03.prod.outlook.com (2603:10b6:910:4d::17) by CO2PR03MB2262.namprd03.prod.outlook.com (2603:10b6:102:e::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Wed, 8 May 2019 11:30:19 +0000 Received: from SN1NAM02FT047.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::204) by CY4PR03CA0076.outlook.office365.com (2603:10b6:910:4d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:19 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by SN1NAM02FT047.mail.protection.outlook.com (10.152.72.201) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:17 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BUHp9023779 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:30:17 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:30:16 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 11/16] mm/vmpressure.c: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:37 +0300 Message-ID: <20190508112842.11654-13-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(396003)(39860400002)(376002)(346002)(136003)(2980300002)(189003)(199004)(356004)(6666004)(36756003)(5660300002)(50466002)(48376002)(2616005)(126002)(426003)(336012)(107886003)(51416003)(44832011)(2906002)(47776003)(486006)(2201001)(4326008)(476003)(11346002)(446003)(86362001)(76176011)(26005)(16586007)(246002)(478600001)(2441003)(50226002)(53416004)(1076003)(7696005)(70586007)(70206006)(7636002)(305945005)(7416002)(106002)(77096007)(8676002)(316002)(186003)(110136005)(8936002)(54906003)(921003)(83996005)(1121003)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR03MB2262;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 87f72335-9c22-4180-441e-08d6d3a88cc2 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:CO2PR03MB2262; X-MS-TrafficTypeDiagnostic: CO2PR03MB2262: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: cnstcSk43+prC/nm0NIlQdVDAfOh8/lZSDEOLvPEWx6u5KaV9jPZl9EcFSH7WaASPwU7+fdDNsMvmlMxhDycs0yr3rd1AFhXDzBVzxhZSOvQ0xiWbSJP7dlM8vH2TA9hrPVkJAY/nJnB9TCO/kJZeFl+F9dkyaNWFKv6+gGPtbDKP5qaktyy9MdiyFHMAJyFPoHyy/awX/7gkUHD4/3KRzk12qCmpUyAH54x75Oxy55ICCRLv533XeQ9CiOTbWpa0gaiE1ymmb3TG31mccB9fGyxe87ONr3LPKarJ/n+0poagb0PJccPHE4Tq8ZMRC89HSguBdFMiCV4kVY2RQiJIJyZ1CpB25EFDyiTdXH7OMkWGVU/rGH+WzIi/AJdCh70xavIYa8Ih81ru3cAAfjVLrgfn3Gcz3OTbKTZVQoCtp4= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:30:17.8821 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 87f72335-9c22-4180-441e-08d6d3a88cc2 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2262 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP __match_string() is called on 2 static array of strings in this file. For this reason, the conversion to the new match_string() macro/helper, was done in this separate commit. Using the new match_string() helper is mostly a cosmetic change (at this point in time). The sizes of the arrays will be computed automatically, which would only help if they ever get expanded. Signed-off-by: Alexandru Ardelean --- mm/vmpressure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/vmpressure.c b/mm/vmpressure.c index d43f33139568..b8149924f078 100644 --- a/mm/vmpressure.c +++ b/mm/vmpressure.c @@ -378,7 +378,7 @@ int vmpressure_register_event(struct mem_cgroup *memcg, /* Find required level */ token = strsep(&spec, ","); - level = __match_string(vmpressure_str_levels, VMPRESSURE_NUM_LEVELS, token); + level = match_string(vmpressure_str_levels, token); if (level < 0) { ret = level; goto out; @@ -387,7 +387,7 @@ int vmpressure_register_event(struct mem_cgroup *memcg, /* Find optional mode */ token = strsep(&spec, ","); if (token) { - mode = __match_string(vmpressure_str_modes, VMPRESSURE_NUM_MODES, token); + mode = match_string(vmpressure_str_modes, token); if (mode < 0) { ret = mode; goto out; From patchwork Wed May 8 11:28:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935101 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A5608912 for ; Wed, 8 May 2019 11:30:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9619A283EE for ; Wed, 8 May 2019 11:30:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93DE4289FB; Wed, 8 May 2019 11:30:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27FBF283EE for ; Wed, 8 May 2019 11:30:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CDA136B027B; Wed, 8 May 2019 07:30:31 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CB0D36B027C; Wed, 8 May 2019 07:30:31 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B78A16B027D; Wed, 8 May 2019 07:30:31 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by kanga.kvack.org (Postfix) with ESMTP id 7E8F26B027B for ; Wed, 8 May 2019 07:30:31 -0400 (EDT) Received: by mail-pf1-f199.google.com with SMTP id i123so7986314pfb.19 for ; Wed, 08 May 2019 04:30:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=u5hQTyFwHo/VxRdFALVMYiR+QOhFLU+yQ1fnnnSWX8Q=; b=Kje3XqkF+BwDWBrTJUNMLnGEs7nfBPoDXt5mFE/V9G+aowlkWIuKTWGz7wFDFqvM3h YVZQTEUJ87PxDOYJA4xFqDeIWbRB9gCpHHlxTvQ7XrryuxTKItgdvDnGFG/Sbgm1tlQ6 MjBJ+ItW/EVH2gxuEy/PgRpXGA+p8MuHwa722Wa3Zxdez36jsV7xV5fxTr6VNPu3r2sV kD/o9fy8urE+Rhbr3wkBeIoJKT3hE10bgTGjKk+FSmcdWre5c54YhLmwQj/fF12j2i79 gNfT6e30rbMx6pdNCVg4bSldHp/Kr8B9KbzpH7SCibaU1Be7hmnxktRkR8cBsBLAlgdc tdfA== X-Gm-Message-State: APjAAAXVfrvJtJtQ098TCEOz6HkLgeoBjQWVebzewNvFL+5nUeGh7tf/ 4w45T+dbYgO6gUCOcr4cRKqHHEiCTDLp912KKRwrVt5TFlR0+vUb7pchK0Jw5w2dohVjT0uc+jt DWnJ6jt34+iRRlsZVopZ10QRNyy0VJNP8e/SOhkYYURwOg2iqFraP83weZN7y3YpA6w== X-Received: by 2002:a17:902:bf44:: with SMTP id u4mr46136702pls.171.1557315031189; Wed, 08 May 2019 04:30:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqy+sDYSM02iFV8O1MydMiT8dTnQXmn3TA+YuYR38xqvDE7wUlZRaxEAM0fJDspxUobxb0fw X-Received: by 2002:a17:902:bf44:: with SMTP id u4mr46136614pls.171.1557315030257; Wed, 08 May 2019 04:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315030; cv=none; d=google.com; s=arc-20160816; b=JrVM5tgofHOnLB5kwFtq4dad7Fzz8XPUwQoEriWUT+EwRmnbTI6lgSKAUVtRgs9Dte FqApUQ3VSCWq9nJq35KEQsR3NknkQXkpBAxo+SAwjFEAWjaVDoIl7eO0spd1BoWpjeHU qnyLPmSqM5I+AskbqCsWlHAHsfE/eYst00L3TY0dQ7zTZMQ5KMS9sQ8g1QQbMQ7uPG0S Qk1HEg4MjZV1+V1rW9zx1P5mCwcCf7054+/W8UhobCcV4TPt00u1ufWzk51OqOseSkTd XEaXv72jbmf+BTHw9yqnk1LiETAZ1fIpM6+fD36p7el41dgbzDqp8+Euw488Ya1G0PH4 OBGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=u5hQTyFwHo/VxRdFALVMYiR+QOhFLU+yQ1fnnnSWX8Q=; b=byLMjAjAHNZs1NnFsQOFBDh9hN/BnF/uSoOWmpWFq2tg/SiFGaWgxbfpV4ipYW0RHb 2PhN3mqa/CL4rjDCDiRnBjm91ZEF7+qf5N6VoNtf93h7xPvECq4uAGx2y3e62TqIbHLC U0BBytWwOixBNdbnjXvm5eDolTbNnrQGqKwqvRO8hIT2NjNCeqcCrmHjGVVjTuoUQLYH LHA4xNp/Luic6EYyTSruGp5Mx/ebzTqtflQt9twqQzBcpJbAk0/z9ra6hNxP7pZyUzwI gKiVG8tRZMY9IUclNJ+8yoh70xO7bIIZkseo7f+xSYGwkoBEeAiaMnZ3AK/GDaquxqrJ Cvfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=Z7XBk7n5; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.71.86 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710086.outbound.protection.outlook.com. [40.107.71.86]) by mx.google.com with ESMTPS id t26si21806030pgu.327.2019.05.08.04.30.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:30:30 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.71.86 as permitted sender) client-ip=40.107.71.86; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=Z7XBk7n5; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.71.86 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u5hQTyFwHo/VxRdFALVMYiR+QOhFLU+yQ1fnnnSWX8Q=; b=Z7XBk7n5vKKBDgXCP897D+5V1Y0FLQdRTDHnUWULRUnoOrwQ2xkh9EzaEl0pwQeruiqUJOD9GIv3hXLd9F5aq1UqHCVFSPaWFY19RldYDESvUrqGCU74eR8dJ/StDdxc+q9DTKHUAlBb+h9/h5TGntoeFTD9ZXAJpweCEH/OhDc= Received: from CY4PR03CA0081.namprd03.prod.outlook.com (2603:10b6:910:4d::22) by CO2PR03MB2264.namprd03.prod.outlook.com (2603:10b6:102:b::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.11; Wed, 8 May 2019 11:30:25 +0000 Received: from CY1NAM02FT033.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::206) by CY4PR03CA0081.outlook.office365.com (2603:10b6:910:4d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:25 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by CY1NAM02FT033.mail.protection.outlook.com (10.152.75.179) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:23 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BUNwe023807 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:30:23 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:30:22 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 12/16] rdmacg: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:38 +0300 Message-ID: <20190508112842.11654-14-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(39860400002)(396003)(346002)(376002)(136003)(2980300002)(199004)(189003)(7636002)(316002)(106002)(4326008)(50466002)(126002)(2616005)(486006)(48376002)(478600001)(36756003)(54906003)(476003)(186003)(110136005)(11346002)(107886003)(16586007)(77096007)(426003)(51416003)(7696005)(76176011)(4744005)(47776003)(305945005)(44832011)(446003)(336012)(70206006)(1076003)(70586007)(14444005)(8676002)(86362001)(7416002)(53416004)(246002)(356004)(6666004)(2441003)(2201001)(50226002)(2906002)(5660300002)(26005)(8936002)(921003)(1121003)(2101003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:CO2PR03MB2264;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3ea226c7-d664-4182-eb25-08d6d3a890b6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:CO2PR03MB2264; X-MS-TrafficTypeDiagnostic: CO2PR03MB2264: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:883; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 9+T9KOQ5N1uqSNzRRgplR6sHTKQb7qlY+DBPxxdCSaJYco/p4QFiyK/dDR0hB1IOFmQXuX5mxyj18B28K6d93VjxihCj+rCmQnGHG+YCO6GrqNFnq/R+gtspHAUOD35K6bnQr18zajdkHnsgf+QKRbi3AQukLYK3xBiqqryjbGYGjjRlCqPYQrzhbT+v7t96Pxm0FHxoT7kykMNu+1w4N2KbrJMgDpMtY1XAHVueHSW/1Hrp3kOm+CFYWu5LQ+2t5MTCEOfBhm2wbNLLQTpoyj0DhQHzLCeF6FRFDnPnJNhXTBEOEJdYK6LFjoWOnt1QNXc3j/TxDqk5WgHs+pPuEg7e3rtTvXcq/rVdNvuTndv5eIO1qBO51WfXuWrhJnCT8Sl23SmiUZfSUI8Vpzk+y9G/FLbIygwUT4rW+hoQ81g= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:30:23.9644 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ea226c7-d664-4182-eb25-08d6d3a890b6 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2264 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The `rdmacg_resource_names` array is a static array of strings. Using match_string() (which computes the array size via ARRAY_SIZE()) is possible. The change is mostly cosmetic. No functionality change. Signed-off-by: Alexandru Ardelean --- kernel/cgroup/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cgroup/rdma.c b/kernel/cgroup/rdma.c index 65d4df148603..71c3d305bd1f 100644 --- a/kernel/cgroup/rdma.c +++ b/kernel/cgroup/rdma.c @@ -367,7 +367,7 @@ static int parse_resource(char *c, int *intval) if (!name || !value) return -EINVAL; - i = __match_string(rdmacg_resource_names, RDMACG_RESOURCE_MAX, name); + i = match_string(rdmacg_resource_names, name); if (i < 0) return i; From patchwork Wed May 8 11:28:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5ACFB1575 for ; Wed, 8 May 2019 11:30:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49BC8284D4 for ; Wed, 8 May 2019 11:30:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D362289F9; Wed, 8 May 2019 11:30:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B621928A00 for ; Wed, 8 May 2019 11:30:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 86D096B027E; Wed, 8 May 2019 07:30:38 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 842DD6B027F; Wed, 8 May 2019 07:30:38 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E53F6B0280; Wed, 8 May 2019 07:30:38 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by kanga.kvack.org (Postfix) with ESMTP id 34EB86B027E for ; Wed, 8 May 2019 07:30:38 -0400 (EDT) Received: by mail-pg1-f199.google.com with SMTP id l13so12512721pgp.3 for ; Wed, 08 May 2019 04:30:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=2xB20OGypICNQZWKblrMBkQ0pTKCSJ0Q3IEFfzUPnKg=; b=CEDDyeWSAu1np7fHtNetFzd8/k+4YnCf6GMnkZWRs+7X7hCaJ+iGurWUR158RBMCP5 3FGgV0AsX7qH9ZwS3CwAqchK1tkbAXp4Kwhj7WwMfiepj2czaSKR74PZMdAn8G9SRrdb WWXVNaheceiXqXNjkev3UBX2FvkEIs7cHBAIfn19m3hDomUk4VgdwLhzRM+tsA7818kG 2yi5vUaBkxPmX5bhifJ9ejJQsRPpzHuS7sTZzNKyU7Qfju+Mj90JuGwBT1alsUIBc4+g ez5TsP6pT0I7r0mINbS8El3L0zBLNkDVmBkCWKo1UyeICasjd1nn1TWjq+bEy3gotfKI 4wXA== X-Gm-Message-State: APjAAAVzmLwO9l7AWVYmyRwdJg2NKZHzIK/by/8YhZN2z/0JRfjB19VV +NY/LAwdmSLCA8hRmXhMQfEjZtQXvPe3JYu6vE64b3yiX1xjXkBUrNIjBqmkQW5kW4IhgBNh68P MjsDTzDzCy1q++yDePmHb3s6cyANuo0qGFDroZ1U/X3RUgF9T/uJ5I2fpLYhf8ORipA== X-Received: by 2002:a63:ef53:: with SMTP id c19mr47586099pgk.120.1557315037852; Wed, 08 May 2019 04:30:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWRluG2cYQlPD47z3LU/UNG8VCw2QHv8KlvgypC5g4xu/RltSfLpmqgVIppdlO+CYHa3hb X-Received: by 2002:a63:ef53:: with SMTP id c19mr47586018pgk.120.1557315036823; Wed, 08 May 2019 04:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315036; cv=none; d=google.com; s=arc-20160816; b=zJIzL3dCpUCbWuo1VNAydtEVMhiPNUZaZ3VR6AOAP1xtmvz2McZOrRKksp1USDr50B kC0qgC7AkftJ3sbpqsFILTsWu65P4OnyfeeRTV3OyxsVLPyrPHtkEVr5y8Wed889p9BF JGWl0tGpYTsSuNMHrbq5rL7bt12tUSx8YKJ917mS93DR/dhWjsF3AXhbhwY+Zt59eSge D3hSEb5ZsiJ7bTiMUaVLZAIhhOkq+UZ6R6NRVCytWEoeYcSluRdcztjfPPezqBZtU20g B43bOJ340cwovOoSRrsfKszZ/6kgLNjV80o4Rth7vA2rXXRcOjEz0NTeXPC6CxFXcg6h hVSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=2xB20OGypICNQZWKblrMBkQ0pTKCSJ0Q3IEFfzUPnKg=; b=AIMPtE1XcHSmJa971K++zbeDtas5FvVtmG+WBRG0e5UhZ4iasWgWqrGWqbwT3gOiJ/ nMYc6HIqaSgm3p5H8p35Jsx0tAOZZpU7xBxZylf+D04jodfQjVTQRvtqb+v+q+mnTQuG u/0ZPTuEiwW47ekjyhEqXeMzRXRSuqYSwE1Br0fRnjA1mi1SYRYr1RP+oT4wDFjYz+0g o1/QrvYoqw4rZsGuZ18tFyJOo6e/h/SvUFWbxGEILPDioxIOnzVaJfSgTRH2xcWLBYb3 I9CPQcqwHMNB5cI1YdAmI4UypaKFuXcjFdKfIvFEv4LcRZ6oIyJFCenCrJSQ/DnCBdBW 6ikg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=OU6NQB7g; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.69.87 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690087.outbound.protection.outlook.com. [40.107.69.87]) by mx.google.com with ESMTPS id j127si24154810pfb.25.2019.05.08.04.30.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:30:36 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.69.87 as permitted sender) client-ip=40.107.69.87; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=OU6NQB7g; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.69.87 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2xB20OGypICNQZWKblrMBkQ0pTKCSJ0Q3IEFfzUPnKg=; b=OU6NQB7gZLvgySovwjwuTY2etpF1iO6NIq66rWqRGCUiVZgLKtFpVlZd4T6Py3DBngyiFNbGK+24eWSQtNjs4A7tc5MhJPa01bLOUy7MmYUoNiqC73UHrXSzKYsrLmXi0lLtdGKUF37hhNtj7Q6bcYHbG4OmMRmSM1ZaEchIrU0= Received: from BN6PR03CA0072.namprd03.prod.outlook.com (2603:10b6:404:4c::34) by BL2PR03MB546.namprd03.prod.outlook.com (2a01:111:e400:c24::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.20; Wed, 8 May 2019 11:30:31 +0000 Received: from SN1NAM02FT010.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::204) by BN6PR03CA0072.outlook.office365.com (2603:10b6:404:4c::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1878.20 via Frontend Transport; Wed, 8 May 2019 11:30:31 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by SN1NAM02FT010.mail.protection.outlook.com (10.152.72.86) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:30 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BUTmG023837 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:30:29 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:30:28 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 13/16] drm/edid: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:39 +0300 Message-ID: <20190508112842.11654-15-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(346002)(136003)(396003)(376002)(39860400002)(2980300002)(189003)(199004)(476003)(11346002)(426003)(4744005)(2906002)(2616005)(2441003)(76176011)(446003)(5660300002)(126002)(50466002)(478600001)(14444005)(336012)(1076003)(6666004)(356004)(4326008)(7636002)(70206006)(48376002)(70586007)(8676002)(44832011)(106002)(8936002)(36756003)(486006)(86362001)(2201001)(186003)(246002)(7696005)(51416003)(50226002)(77096007)(26005)(53416004)(107886003)(16586007)(47776003)(110136005)(316002)(7416002)(54906003)(305945005)(921003)(1121003)(2101003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:BL2PR03MB546;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 82b1335a-441b-419e-9856-08d6d3a89439 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:BL2PR03MB546; X-MS-TrafficTypeDiagnostic: BL2PR03MB546: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:883; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: kmgGUzYPdSV3VTFQV+645Mo10A43GRXumFLi/W3XTjg1/M6xsukN+9rUN0IEc1bpKKy667zEgMFcVvXWcjId4XLWq9COaVWObLgjv+ECyHMfF3UQZ2r8Kgj98qGfkp0RBf19Vdds8vUWwSTvaF2rcMnY7SkNLYOmiIQKJbisjJFYRVzkdggu5As2YO/FOWeLeeiZD6CNT43j8lN3ZL5zG4mxQSHXD5C0/Xk/lCDaFDFKEwC7jfuEtfVLnLG1YdYS+kTOlcR8iq6azQ5dad8FIBhs/tXgGYgvdPkV9Gf7wcXJK5krdcwXTEiraKBMYAh6lP+jwPKITVndILCgjF+ZiXZ4GtmD3M+nbm2W5hBvNq75XUxA2x3cL2WFwMdjfR3E2ORzA4OMp0kNEVjtA5ZnWIP4u5/lz0dsfTZDTkp8rOc= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:30:30.3712 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 82b1335a-441b-419e-9856-08d6d3a89439 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL2PR03MB546 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The `generic_edid_name` is a static array of strings. Using match_string() (which computes the array size via ARRAY_SIZE()) is possible. The change is mostly cosmetic. No functionality change. Signed-off-by: Alexandru Ardelean --- drivers/gpu/drm/drm_edid_load.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c index 1450051972ea..66e1e325ff37 100644 --- a/drivers/gpu/drm/drm_edid_load.c +++ b/drivers/gpu/drm/drm_edid_load.c @@ -186,7 +186,7 @@ static void *edid_load(struct drm_connector *connector, const char *name, int i, valid_extensions = 0; bool print_bad_edid = !connector->bad_edid_counter || (drm_debug & DRM_UT_KMS); - builtin = __match_string(generic_edid_name, GENERIC_EDIDS, name); + builtin = match_string(generic_edid_name, name); if (builtin >= 0) { fwdata = generic_edid[builtin]; fwsize = sizeof(generic_edid[builtin]); From patchwork Wed May 8 11:28:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935115 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1F1841575 for ; Wed, 8 May 2019 11:30:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E52A28518 for ; Wed, 8 May 2019 11:30:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B58A283CF; Wed, 8 May 2019 11:30:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92ECF28A00 for ; Wed, 8 May 2019 11:30:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D3D96B0280; Wed, 8 May 2019 07:30:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 58E6A6B0281; Wed, 8 May 2019 07:30:46 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 425736B0282; Wed, 8 May 2019 07:30:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ot1-f72.google.com (mail-ot1-f72.google.com [209.85.210.72]) by kanga.kvack.org (Postfix) with ESMTP id 1950D6B0280 for ; Wed, 8 May 2019 07:30:46 -0400 (EDT) Received: by mail-ot1-f72.google.com with SMTP id j17so2833243otq.5 for ; Wed, 08 May 2019 04:30:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=onHX/dH28+rcBydCYnxXPPy3B5aZvm8nUVopYvgTR/U=; b=eF40a8QFBelj5RFaplZjmZRUJmTTOXvBhuYdjyhpZHUIMXzAw/hL2xeekDywf+Rpq6 ypNG3FFj0k0LKDMd5qcwVmkqtumWV9ZIw9jI5FsEVzGX5QHY4+y3fwQdXGRZaqN+MLuC Cbde+TP7jrVpNFgPx1EywJCTwy/odWozYD0ep8Tih9NYnfVfz7feRY9gjZmNYVz6F4ew U4zHLml1sf7apmAx8hHe0f2ymQJjCQQEGm4POErD8YAyU1Yp/lI8KIIQPKtdSwK8TENc zqFSVefUbHUzd22IipZ7r8Zkjh5b1VjrTbOt0GIaArgIirDSw8CCd24rdQfgdAq66D3h qu8A== X-Gm-Message-State: APjAAAVL+l+Jf7G3aZfFSwDez3acna0TQzAE12wnZZ65BnilHN0yJYUg BwHQsJcNk+SYU90WG2o2j87TaAxOzxCoomzfEn9L21SZSFGPsXvHKFoqRO4+9aysZFCIHGrBnP3 K2MrkLGc4QQOPvpGWV1QGhfSzE0TQdkTTn6WpUOnrS9PCTohuL2j7H0UyFUuJ6lVWkA== X-Received: by 2002:aca:5f0b:: with SMTP id t11mr729239oib.14.1557315045821; Wed, 08 May 2019 04:30:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyO9OTzt5yWqxDE3aU3XTboWwJZ629ZfQ96BP6m1sO0unnfd+MEx3qvolHP6mhJT+uiqCio X-Received: by 2002:aca:5f0b:: with SMTP id t11mr729185oib.14.1557315044842; Wed, 08 May 2019 04:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315044; cv=none; d=google.com; s=arc-20160816; b=CxjguL8Y/t6763N5xBLHavXuBtnXirLiVgaWxppkXZTzBjFdI0IY0VFS5TLV3nxrXG aoPN2pkQkoU0JqH3d0B6TH8HYC0Ku7Vm7rsupCRWLCeyCevlficFQpN2GJgY3+Z0DEJE eBuQLYEBVPHR15TsNcKfJkt05vPo+S6XapHt6IryHu/zJCYz8ZlA+ohDyFSNISMZxzOz 9WKpebNVN+Hs+7TVpoNNuML1AaspRFyWTWboXgN/4UWglUzvtoHgPyRI4srA8wuujeea CsCpf1i9poIkoROKC2BShdWDZhY9RdMR8sDUZH+DGGcN8g7bko1kNNgx8k4G/OtDpg94 f/xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=onHX/dH28+rcBydCYnxXPPy3B5aZvm8nUVopYvgTR/U=; b=qC+NUWEEE/yDRcsKXSVbKa3z0oudPpKxydMu1yWqP0En/RCZfJOiGa09m5cozsG0xT qAEcVQp3YHrl2vB0unGN3fvCgvEJKJ6IgifhyJaRkQfNxg2yUKr8cxvNi5svfwuIvzWw iQOkI3TBivxThJi4MqY1xxpe8au5rv1Ze8nd8oKk+vk+y0thJaxKfKfQmljF7XDk5Mvo CNMQ1X7d5qA/3+rEE0zJ2VXLrdT1WP+I9DZBxdXP4RtNHrCkZrbmsT2Y22xdqLXz1IJV cT7PSXs+0Ex8ykp15TqrAppQhcE1lG6TkxHMGQZM1A742A0P4qcxGc18fZHA256/Yfft MHlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=TRWzaKL5; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.71.79 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710079.outbound.protection.outlook.com. [40.107.71.79]) by mx.google.com with ESMTPS id 64si12562243otc.72.2019.05.08.04.30.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:30:44 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.71.79 as permitted sender) client-ip=40.107.71.79; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=TRWzaKL5; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.71.79 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=onHX/dH28+rcBydCYnxXPPy3B5aZvm8nUVopYvgTR/U=; b=TRWzaKL5QJNYiXbG+2Oe8fjWtJL+uaSZN7I1Y1mLvIYHbJGfd+k3GEWsuHa6f8MH3o5FyiU8BEW81HV8R20GJd4CjUz2a3wrhgxNZAp7on9a1AKqAYFUNkner8pEKTAQX+E2T5W2P3Av5RpjeoV1wIG/TVCkFL8QTjk7xwoghyE= Received: from BN6PR03CA0021.namprd03.prod.outlook.com (2603:10b6:404:23::31) by DM2PR03MB558.namprd03.prod.outlook.com (2a01:111:e400:241d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Wed, 8 May 2019 11:30:40 +0000 Received: from SN1NAM02FT023.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::201) by BN6PR03CA0021.outlook.office365.com (2603:10b6:404:23::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1878.20 via Frontend Transport; Wed, 8 May 2019 11:30:39 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by SN1NAM02FT023.mail.protection.outlook.com (10.152.72.156) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:38 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BUbuE023873 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:30:37 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:30:37 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 14/16] staging: gdm724x: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:40 +0300 Message-ID: <20190508112842.11654-16-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(136003)(396003)(376002)(346002)(39860400002)(2980300002)(189003)(199004)(51416003)(7696005)(86362001)(16586007)(486006)(8936002)(476003)(126002)(2616005)(44832011)(53416004)(426003)(11346002)(446003)(2906002)(336012)(107886003)(110136005)(4326008)(316002)(106002)(7416002)(47776003)(36756003)(2201001)(76176011)(7636002)(305945005)(50226002)(54906003)(8676002)(246002)(2441003)(4744005)(478600001)(186003)(77096007)(26005)(6666004)(356004)(50466002)(48376002)(5660300002)(70206006)(70586007)(1076003)(921003)(2101003)(83996005)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR03MB558;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2ce9d3e2-55ad-41f5-b402-08d6d3a8990a X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:DM2PR03MB558; X-MS-TrafficTypeDiagnostic: DM2PR03MB558: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1148; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: EVMADUNDHRaZyM70b9uaph59oQp+EuDL9gb4q2zI9AEdIWoTcnaNWUBe+9FxlQX2b0O7+4xknIyCoImhifcxNPmppoSR9Ju8BlK50RVal3XQVeh9l+A7s/7PGVZecREu2vX9qqBWISF2RTmLi8m3PEwYjEAyyjEX8vfRtxItEKrtpqEt8nOlt7fYyW49KHTABKF5js7qPbGcInT5wIoJWo41C0yk64vCRQXbGltzcSHsKdDUuQ9YfnMd+RoeSwokkISCJ2+H3HCcqX7T0oz1KORlekqmtcJeKwxjA3imNWlqT71dJwi19a46r8S7V/Nae2BSdjex5jOfLsOo066cOWXqmOwMyJTvIsJGUQfFBnqubKtsYZz5Vk6p09jm/MJubme4zc5q/ucRDNwmd5+XDCdCLSscieyA/YOMT+N4Apo= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:30:38.4867 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ce9d3e2-55ad-41f5-b402-08d6d3a8990a X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB558 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The `DRIVER_STRING` array is a static array of strings. Using match_string() (which computes the array size via ARRAY_SIZE()) is possible. The change is mostly cosmetic. No functionality change. Signed-off-by: Alexandru Ardelean --- drivers/staging/gdm724x/gdm_tty.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c index 6e147a324652..81dd6795599f 100644 --- a/drivers/staging/gdm724x/gdm_tty.c +++ b/drivers/staging/gdm724x/gdm_tty.c @@ -56,8 +56,7 @@ static int gdm_tty_install(struct tty_driver *driver, struct tty_struct *tty) struct gdm *gdm = NULL; int ret; - ret = __match_string(DRIVER_STRING, TTY_MAX_COUNT, - tty->driver->driver_name); + ret = match_string(DRIVER_STRING, tty->driver->driver_name); if (ret < 0) return -ENODEV; From patchwork Wed May 8 11:28:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935123 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7385013AD for ; Wed, 8 May 2019 11:30:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62B4D2847A for ; Wed, 8 May 2019 11:30:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56018289F9; Wed, 8 May 2019 11:30:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D795B289FB for ; Wed, 8 May 2019 11:30:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 622956B0283; Wed, 8 May 2019 07:30:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5D28B6B0284; Wed, 8 May 2019 07:30:50 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 49ABB6B0285; Wed, 8 May 2019 07:30:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by kanga.kvack.org (Postfix) with ESMTP id 2AE0B6B0283 for ; Wed, 8 May 2019 07:30:50 -0400 (EDT) Received: by mail-qk1-f198.google.com with SMTP id u15so21371408qkj.12 for ; Wed, 08 May 2019 04:30:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=1pGxpqtswe0uDTJtCA9b8Plg8X12C8ZZ/KC5tO0ZuVQ=; b=YsjxDNyIVSn0+VXXH074gTLFhRyj02XobftaeFo3jLzWElw5Fjekkk5d/1CAQRCfbW nFc9r2/R2P6Z6nP73jzVILDfK2theyVstXhJFZtz31RDGiznYrE6GxrKMQDmrOW9fb7A kfgf25ezIRiyfQe10GxsEUVcd4QV0MFDb7WQUVppr6Wcq8BO73t/1K6oHq4HUU+MFGEc NrnEUJY1k1M/nmBwmdhUjMRYyYJ2MxkZGcAw8R3wNhU7JoRfR55WrGjyM5F6feRvYVog tf5khyz18QJUqeH315bGVwjDRx3qFKIU7IPZJQB/0ckPSc37/knApjB//o5UoagxFTM+ uXLA== X-Gm-Message-State: APjAAAWJAHjXk7jxv+GpDUFV55+89t4EWVrsFn8ToHg/povg2ljHoVqO Uro0MLOqFvxPTry1pt1BvLspqmrocJ9ObYsIB/KV4AwZ0NH0smKVbCVR5darjW6Mqq0AgmwHGxe /s37JO0+F/RwMUGD2f3KSCQmlmd/joo3/fgr3EN3lZDOvdVR1OyDJvA8GvUvKbb+I7g== X-Received: by 2002:a37:b8c:: with SMTP id 134mr11443446qkl.121.1557315049865; Wed, 08 May 2019 04:30:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqydfxT42I57yMdiG65TSBeka0GtKcBBAEJG1Ij/7B58nWIeUiYzV0Tg33/LyfYrxUyF7Rrp X-Received: by 2002:a37:b8c:: with SMTP id 134mr11443371qkl.121.1557315048961; Wed, 08 May 2019 04:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315048; cv=none; d=google.com; s=arc-20160816; b=v1iG0egDidjIrmJS/J2tnSqTq+XmyBzCYyNg4bkK+oEFzd9bv+lm4TuEL5w+fZ+ZL0 4Fce8LUOMowe0XTWZofJriSr6RhWLgRx4PVOyDHpe9foC6ZXWnOYGO/0tb7CYjFQBQp7 HQ9uU0OQw/v2xz6bmkyWjIKw3FV4eR15swRiUlTYmFxkAHFvz1F07jOGVuO+JoNEDY1t 4/2jbZne6RaUsUHutS3KqEoDvSBArXfXI/WcrJpDYQCgywQAk9J5XVtWmIIQXLjJ3G8n EekTWsrPgq9c+ahHdpvseX8cz6lLha8ODXrbd21rCb5osDiKNW3J4yvN+ghTuGXG6gVZ CB9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=1pGxpqtswe0uDTJtCA9b8Plg8X12C8ZZ/KC5tO0ZuVQ=; b=PgB+MSlrw4gDj3uIQeSbyIgvzOPUFwq2hrBQWo2YA3OHLn2M01MY2Cj0kUB8VCVOwc Gaj0lb/taiGsbK/WJjsV2vB9K6v0tPBu0XfBKdEN9OUZtjeXgSdzJbqnPvdQeZre71Gc HiWJkIO92L4H0o0+u/x9QQC/vfvffM0WrDommi71EAp1IPXki+fIip6x7cXCfXlwtYpe AG5enF337KOHv38EaVwUjSbApKMB/xRMBiBpKgicf65wJi9Q/Ek6C+7QsUFtsouH+UK3 ddzc8jdr0reJL7K68mpCWFynise6oYf+v75Ktv/fev9G/vUowNH9RYa9iio5/1eGzxtx NyuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=uLO3LXwd; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.68.40 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM04-BN3-obe.outbound.protection.outlook.com (mail-eopbgr680040.outbound.protection.outlook.com. [40.107.68.40]) by mx.google.com with ESMTPS id a2si9271662qta.5.2019.05.08.04.30.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 May 2019 04:30:48 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.68.40 as permitted sender) client-ip=40.107.68.40; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=uLO3LXwd; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.68.40 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1pGxpqtswe0uDTJtCA9b8Plg8X12C8ZZ/KC5tO0ZuVQ=; b=uLO3LXwdd1BWamWiK4r+Hw5jvJyCV00LM1cyhqNBKocozKsQvw+ovIXID7g91gMIvPgSp0VMC7EhKj6CA5gnlmoJcz4HY1qoPHGRgatiggRcisFhgTqP51Zl+L8WhLodnCQ/qLq5WxXaZ64lgglcD6lX1+C8qGWvddWXlxnm3bA= Received: from CY4PR03CA0098.namprd03.prod.outlook.com (2603:10b6:910:4d::39) by BN3PR03MB2259.namprd03.prod.outlook.com (2a01:111:e400:7bba::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Wed, 8 May 2019 11:30:44 +0000 Received: from SN1NAM02FT012.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::207) by CY4PR03CA0098.outlook.office365.com (2603:10b6:910:4d::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1878.20 via Frontend Transport; Wed, 8 May 2019 11:30:44 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by SN1NAM02FT012.mail.protection.outlook.com (10.152.72.95) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:43 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BUgbC023898 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:30:42 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:30:42 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 15/16] video: fbdev: pxafb: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:41 +0300 Message-ID: <20190508112842.11654-17-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(136003)(396003)(346002)(376002)(39860400002)(2980300002)(199004)(189003)(50466002)(2906002)(426003)(478600001)(126002)(2441003)(2616005)(476003)(51416003)(26005)(8936002)(7696005)(48376002)(77096007)(186003)(50226002)(7416002)(246002)(47776003)(356004)(11346002)(36756003)(70586007)(70206006)(8676002)(446003)(336012)(16586007)(2201001)(76176011)(1076003)(86362001)(4326008)(107886003)(486006)(5660300002)(44832011)(106002)(305945005)(110136005)(316002)(54906003)(7636002)(53416004)(921003)(83996005)(2101003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN3PR03MB2259;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 19467b0d-82a0-4414-fd3d-08d6d3a89be6 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:BN3PR03MB2259; X-MS-TrafficTypeDiagnostic: BN3PR03MB2259: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:120; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: ica2HYRZM4fdZtkxNTO9Gb+CKac0B/LUwaOW4nL6nYW79SYpz0JOGfZuZgqcdALu4tIifExiLGAs6sD77WVSTjIN3M+20mtkK8wI+pBL9/p1PoBSKfZAmfP2KGJVvCgSEHf32wy3PDodr1lg8Yuu8eqBBpgNfg053BOMOeCaI7HFr/B1OJTsQBX/ceRy48at5Iy5hIl80/NoESGq+ZAk5cvin1INqYY3Mb1qILEP4XIZVdGoHNJeTgIM/V0FqkN7/zCsxIYOu/80TBgJdrmS/t2+/MSfdRVyy3pcjddO6858KbsH4xUnc6kYGOjPaFpLAaL+RTif6KsJe22eNbSvhw8CkJVq6PtH4EXETBQCnvcVhQzisGb4TvfZgmQsWRjNXcqE9FtzT+5/kc2FZNz3c0T+2Bori5rG0j1zDojL+ig= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:30:43.2658 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19467b0d-82a0-4414-fd3d-08d6d3a89be6 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR03MB2259 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The `lcd_types` array is a static array of strings. Using match_string() (which computes the array size via ARRAY_SIZE()) is possible. This reduces the array by 1 element, since the NULL (at the end of the array) is no longer needed. Signed-off-by: Alexandru Ardelean --- drivers/video/fbdev/pxafb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c index 0025781e6e1e..e657a04f5b1d 100644 --- a/drivers/video/fbdev/pxafb.c +++ b/drivers/video/fbdev/pxafb.c @@ -2114,7 +2114,7 @@ static void pxafb_check_options(struct device *dev, struct pxafb_mach_info *inf) #if defined(CONFIG_OF) static const char * const lcd_types[] = { "unknown", "mono-stn", "mono-dstn", "color-stn", "color-dstn", - "color-tft", "smart-panel", NULL + "color-tft", "smart-panel" }; static int of_get_pxafb_display(struct device *dev, struct device_node *disp, @@ -2129,7 +2129,7 @@ static int of_get_pxafb_display(struct device *dev, struct device_node *disp, if (ret) s = "color-tft"; - i = __match_string(lcd_types, -1, s); + i = match_string(lcd_types, s); if (i < 0) { dev_err(dev, "lcd-type %s is unknown\n", s); return i; From patchwork Wed May 8 11:28:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10935127 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 628DC13AD for ; Wed, 8 May 2019 11:30:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E85D284D4 for ; Wed, 8 May 2019 11:30:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B107289F9; Wed, 8 May 2019 11:30:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8FD7284F9 for ; Wed, 8 May 2019 11:30:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B2B406B0285; Wed, 8 May 2019 07:30:52 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id ADD8A6B0286; Wed, 8 May 2019 07:30:52 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9579C6B0287; Wed, 8 May 2019 07:30:52 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by kanga.kvack.org (Postfix) with ESMTP id 5859F6B0285 for ; Wed, 8 May 2019 07:30:52 -0400 (EDT) Received: by mail-pg1-f200.google.com with SMTP id 63so12456336pga.18 for ; Wed, 08 May 2019 04:30:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references:mime-version; bh=BLP6T3LmL+xu1pWFiHVPh/xRUsA/EQBeKdqIkqvb8tM=; b=I9uQBaBVzNjceDJHuSdbOb4ut7ssnc5Bh7brE1WGfqfcaIzICYanlSkZrPAFAa5GMD 8i12oQevJM/+agVaetrSxyTWCRcwiSDSzWWetXwliVB5J5xxMyi9b8D9SBLL967sJNny /t62Mu0Oa7dygP7CIwfQJ2BidSPfVsPmlSE8s09kF6tqKg6KAcZa0N3AGY6jeU3j5kxo tzOXTvKcsPDagSkSiWcBlJL2YbFppyZbe2pFLamuhKV/MCXsF/Hlu8XY3zGF8u8oeJNK f36u8P67nTvR/eZq8oeikaV1I+cyycY5Ss55bCEnBG17eCeosEYDDBqmd1Go2x/6X7zr 9dlg== X-Gm-Message-State: APjAAAWcmZ8QOBjtjvH0f9Okt7U9/tXrO6Z3ZfgJJIt60/5HA1BjG1c1 gAKq1reK4KNTdzQs6McYO0WrYxLnN35TMlqJ+E6nOM+DLM1E7LhxT+ElSMurGtWmagduC3mXVSh vMua+Gdyo942ggXVwjs9IW5Uv0Ql6Xx2qnrlWs/0cNCbejAaYSS8UuGxuXhsRLvnyKQ== X-Received: by 2002:a17:902:1123:: with SMTP id d32mr3398310pla.82.1557315052039; Wed, 08 May 2019 04:30:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOGRQAJDVXa6L/X8AA3gJkdnTK144pj5Wmedl5muVRWknZV+WGwEVgId832YK47Te6gCjM X-Received: by 2002:a17:902:1123:: with SMTP id d32mr3398218pla.82.1557315051096; Wed, 08 May 2019 04:30:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557315051; cv=none; d=google.com; s=arc-20160816; b=llc0gC32kFWjv1GeNsjyc9VH+Kot5QNL1jHKHIheyPT/MyLoPqj2++2pqEbyRjEXST qerfVlwBo/UvzA3M/rAVijfMtQdIC4sTzDdmsJVjlSKVdm7LksaUaXqK5MH/pD+DjcJF zB4W0yg338yXDnOAal2K3KTPtgeh0xJbCxwdbdCp310fqC67ZBFLSpU86KdTNLMeEt0C 7+DUOjmWqPdeA3imfpWuQ7sJ15J9evfeUPGkGm5M/whpQv3wNVAiP6XhnhlFKCOvMY7g U1dkJBPkdGpfsQmIgZEPnHUfmF1jOmJGble9A/33qgU2ib9pcMdTYERAoLRZ5AnouZza XvJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=BLP6T3LmL+xu1pWFiHVPh/xRUsA/EQBeKdqIkqvb8tM=; b=Cxx5xBVNdQpWlaZyq8AtIypjW49L6bJLbywpm0fQi0zZ9vIbLjvXd8l1vo1ts6ju2V XG4oAL2bimK1WKS8zISRhWJdFuCqj9xei7Uwq/chJx7yKTLN1vp5EnR9FVvsG68+HB1E ilJNbLV706/0eoY/sI2xVpfS64nCIaWoHyjjYS3DouDRV51phAjTKHMlho4vOFSxYi/m lnEjPOfKDMzosZMfH0JvqX2sBlMcq411vbYp3kdE517M6mpwO7C2e1pjERTnczVSAJvW 67BfQn1cY6S5U/pkjexgbc1tMw8hexstTjtCcnRKv97PmQNEpxXGA2unLzotZWWLKf4T DVUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=Mou+jErB; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.71.74 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710074.outbound.protection.outlook.com. [40.107.71.74]) by mx.google.com with ESMTPS id b129si13882447pfa.254.2019.05.08.04.30.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 May 2019 04:30:51 -0700 (PDT) Received-SPF: pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.71.74 as permitted sender) client-ip=40.107.71.74; Authentication-Results: mx.google.com; dkim=pass header.i=@analog.onmicrosoft.com header.s=selector1-analog-com header.b=Mou+jErB; spf=pass (google.com: domain of alexandru.ardelean@analog.com designates 40.107.71.74 as permitted sender) smtp.mailfrom=alexandru.Ardelean@analog.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BLP6T3LmL+xu1pWFiHVPh/xRUsA/EQBeKdqIkqvb8tM=; b=Mou+jErBJvl2+qbFwKpdjFrX8nTbxuMm9kAbp3zHsAZA2Yu/30Qn/WM6TRbbZNSO3b9THY/Eb/sEps9xXwDLMCKhkT2e6gE563qV3pa7GK6VRH3DCP3ZsKscgA/XT3bvkTHMyfFdjW8irkfZ8FepYUe+nSBapiK9qv/M4/AWiaI= Received: from CY1PR03CA0020.namprd03.prod.outlook.com (2603:10b6:600::30) by DM5PR03MB3131.namprd03.prod.outlook.com (2603:10b6:4:3c::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1878.20; Wed, 8 May 2019 11:30:48 +0000 Received: from BL2NAM02FT016.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::201) by CY1PR03CA0020.outlook.office365.com (2603:10b6:600::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1878.20 via Frontend Transport; Wed, 8 May 2019 11:30:48 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by BL2NAM02FT016.mail.protection.outlook.com (10.152.77.171) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1856.11 via Frontend Transport; Wed, 8 May 2019 11:30:48 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x48BUlYi023920 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Wed, 8 May 2019 04:30:47 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Wed, 8 May 2019 07:30:47 -0400 From: Alexandru Ardelean To: , , , , , , , , , , , , , , , , , , , , , , , , , , CC: , , Alexandru Ardelean Subject: [PATCH 16/16] sched: debug: use new match_string() helper/macro Date: Wed, 8 May 2019 14:28:42 +0300 Message-ID: <20190508112842.11654-18-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190508112842.11654-1-alexandru.ardelean@analog.com> References: <20190508112842.11654-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(1496009)(346002)(376002)(396003)(39860400002)(136003)(2980300002)(199004)(189003)(50226002)(246002)(8936002)(8676002)(5660300002)(70586007)(70206006)(14444005)(76176011)(426003)(336012)(51416003)(7696005)(4744005)(356004)(6666004)(1076003)(44832011)(476003)(2616005)(11346002)(446003)(126002)(486006)(16586007)(316002)(106002)(54906003)(110136005)(77096007)(26005)(186003)(86362001)(50466002)(478600001)(2201001)(47776003)(7416002)(305945005)(7636002)(48376002)(2441003)(53416004)(4326008)(36756003)(107886003)(2906002)(921003)(2101003)(83996005)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR03MB3131;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f9efdca-1ab7-457f-8e86-08d6d3a89e43 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4709054)(2017052603328);SRVR:DM5PR03MB3131; X-MS-TrafficTypeDiagnostic: DM5PR03MB3131: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:883; X-Forefront-PRVS: 0031A0FFAF X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: y8JtZs2HotEuJXogFzCnWR8K541Bt2KfbZWELew5MD4nlAPku+wmdwLi/TmhK+Wakt+fvbaRFSoxotZgnMV2hufk93HL+wHu08VeIYZzAB8IoqoQv2Dvs3lnVRZh37jPq6JDJZ09fXCNHxrzaMP2dKCDMykwclc7f8Vhdsv9Hmgt6QzYljQnwVIuzcGFye7kiyk0f3KKDWznos08NxFijPl+LUMHPWnvzQlXV/iO2H1CI51TvTwttNaST8OKKWnz5OXJBqxgbJS4Kly1RQeBnhEZ3a2yJ66lTxZm6OcLmRETP89L/aXGIMwvdEBcgXHdYhM7+eUMfrZ8P6irgud1tsflo5a0tQjULWcYbJoGX3011swPClTsa1cpteMxSluefGhuVRdEo64cyvpiEdovYVJn9rugc71z/Ws3tZEK/Xg= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2019 11:30:48.0826 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f9efdca-1ab7-457f-8e86-08d6d3a89e43 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR03MB3131 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The `sched_feat_names` array is a static array of strings. Using match_string() (which computes the array size via ARRAY_SIZE()) is possible. The change is mostly cosmetic. No functionality change. Signed-off-by: Alexandru Ardelean --- kernel/sched/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index b0efc5fe641e..6d5f370bdfde 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -111,7 +111,7 @@ static int sched_feat_set(char *cmp) cmp += 3; } - i = __match_string(sched_feat_names, __SCHED_FEAT_NR, cmp); + i = match_string(sched_feat_names, cmp); if (i < 0) return i;