Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp696763pxb; Thu, 23 Sep 2021 08:49:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLlCt8ity8NKXJptfTceqFMxgR1eObhwI32frH8UVfgUNgOgX2JFkEE5gPJVqo+ZAYo0FG X-Received: by 2002:a02:2124:: with SMTP id e36mr4584202jaa.35.1632412196682; Thu, 23 Sep 2021 08:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632412196; cv=none; d=google.com; s=arc-20160816; b=CDh8nFu+tb6jEW6QH4r0WGJMPWPByXl+5NxKpOe/h5WbN37vJMJVB+tl6/KoDbCxqU KobFnscJNCAc6td910T3rzcRpvgT5xpPSWcu0beCBdeRULZrSbOazOu7A1JoS2un8SzL iQ8EQzIZczhi9cOJjOfgDmJD20OJ6eM3ICVNu+3z3cnjZ67unJ99+jH4YJh/5bBBhZdi BzZz0g9Yt9i4aK66NG8R0qyFJhhyh2nqTMt0Hl4DGNyvi1zIs1qkk6fVT2zJxAv45HO5 J8uXlVcbsX/+HntF+BNhpb08Vcb2l4C5n1ilFBgiEF5S4swko/mM2GVpeo0VqKrpp21b QdHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VpF52wPSaePO/L2OnWBsOhbqWO6Tb3TYiDG9lxOpoQ0=; b=yJ7XJAlNWDNZ7sxjEWMwogLeiE1wCMvhc5vru/6hFkNza+yj/eP6uXYQHgfLHQ0Z0z u3eL95Fy/EKAnrrHnbbIlHHdUe817WFkMXgQpe3oFaCBZ1YzLtCPeQXh/YB0TBqvDWXj eLE0viQqYbftyrOCcpchItmFqTZe/9Srl7pe1tMw7nsFAZ6RlmvI8rsJ5pce67MWPXaw 7ABrpp2kQlii8zFQwDRLPS+fsfuFe9250PNWlIOVR7VXrsPY1VDmaet7CWHWu4Ky8gQd n2Gikb19z0b/vr891SyeLtxNuXB+H6Ut0DQfnFM6a9oQ5PsRgyhdgP6nrxOR18V+sXcI XFLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Nt5gFmqW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si6445599ilu.165.2021.09.23.08.49.44; Thu, 23 Sep 2021 08:49:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Nt5gFmqW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242051AbhIWPuI (ORCPT + 99 others); Thu, 23 Sep 2021 11:50:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:38532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242102AbhIWPnQ (ORCPT ); Thu, 23 Sep 2021 11:43:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9FA6961263; Thu, 23 Sep 2021 15:41:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1632411693; bh=hs9wTebXbUtpLtghXzenefspd1+uQbrHJz31wpQPqxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nt5gFmqWBGRYAA7xQLrb2X2AmLWusUxOAbWWT4E5Xk1ALAzDcwDZL8f5do4lgKf/D XbupbWRIQFbymRdaDUtxD8lsI2X63xzdzeX0aV1kAOAxzfJ44LdKblEa0BniPdXFOF AIMz+8HHdYnOf8l51PbV0hEgxn2A+SxrTqHun3T1zRDiG5a+iXCyhvSjghRmCju2Vr RpkxjVFNxT6vxZ+fhcw/zugf88HObJRRH3egjaTyBT3QSIrOgsal5WnQ4Qz5DgIDwy IdymS/9nZsXBLl3WkbCom0G8gpDy/YJNJ69et+hg4vxTs0ZqErzlNrVqRpb/j+a1fj 1nZhJzJ4Du1/Q== Received: by mail.kernel.org with local (Exim 4.94.2) (envelope-from ) id 1mTQqp-000p6a-Uo; Thu, 23 Sep 2021 17:41:31 +0200 From: Mauro Carvalho Chehab To: #@kernel.org, YUyICHTRdfL8Ul7X@kroah.com, Linux Doc Mailing List , Greg Kroah-Hartman Cc: Mauro Carvalho Chehab , "Jonathan Corbet" , linux-kernel@vger.kernel.org Subject: [PATCH 8/8] scripts: get_abi.pl: ensure that "others" regex will be parsed Date: Thu, 23 Sep 2021 17:41:19 +0200 Message-Id: <9fe7ab46f67575def5db9e83034e9fab43846d84.1632411447.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The way the search algorithm works is that reduces the number of regex expressions that will be checked for a given file entry at sysfs. It does that by looking at the devnode name. For instance, when it checks for this file: /sys/bus/pci/drivers/iosf_mbi_pci/bind The logic will seek only the "What:" expressions that end with "bind". Currently, there are just a couple of What expressions that matches it: What: /sys/bus/fsl\-mc/drivers/.*/bind What: /sys/bus/pci/drivers/.*/bind It will then run an O(n²) algorithm to seek, which runs quickly when there are few regexs to seek. There are, however, some What: expressions that end with a wildcard. Those are harder to process. Right now, they're all grouped together at the "others" group. As those don't depend on the basename of the node, add an extra loop to ensure that those will be processed at the end, if not done yet. Signed-off-by: Mauro Carvalho Chehab --- scripts/get_abi.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl index f2b5efef9c30..f25c98b1971e 100755 --- a/scripts/get_abi.pl +++ b/scripts/get_abi.pl @@ -723,6 +723,22 @@ sub check_undefined_symbols { } next if ($exact); + if ($leave ne "others") { + my @expr = @{$leaf{$leave}->{expr}}; + for (my $i = 0; $i < @names; $i++) { + foreach my $re (@expr) { + print "$names[$i] =~ /^$re\$/\n" if ($debug && $dbg_undefined); + if ($names[$i] =~ $re) { + $exact = 1; + last; + } + } + last if ($exact); + } + last if ($exact); + } + next if ($exact); + if ($hint && (!$search_string || $found_string)) { my $what = $leaf{$leave}->{what}; $what =~ s/\xac/\n\t/g; -- 2.31.1