From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 047CFA0540; Fri, 9 Sep 2022 16:15:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EA0C240A7E; Fri, 9 Sep 2022 16:15:55 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60050.outbound.protection.outlook.com [40.107.6.50]) by mails.dpdk.org (Postfix) with ESMTP id E2A39400D6 for ; Wed, 7 Sep 2022 17:01:57 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iED1ffatZvSJtwj4qGYTCHXqv0kL6xAlqygNicxOtWSbEgrSDuMmqC9hIZDsva84PI+2RjQD4QrXNKdXuNM2B+ta1vOfRk1+I07G0T2nEb3ZxO1tna9cVCRcgz3/YGFY1bWCKP8/FzSg8nLmit1qeGGkEd35vgXIeCVIzkNBsbnDGuQBzGQ6yn4c2bnbC5vsDwTMnHrPoamPqF1ut+EGK8Cts+lf44T2LOs27uVbEH+iHvPNF6YlntJg8tEKPjp4fp984c+Bb/Z4ix8Lc3I2ShiPSe8/N4gcbOwxjn62qS4WrOzmgnuHbVvM5fE1mqBP6jII5zmlvPE1v9Pn1jNUtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8C+WkLg4PDxtF6EpUkEF+wb+meU2Jz63BB8TdtYHOAM=; b=CPkmMdt4NlidGlmDBCIyWRo5t2ivCFsx1w+/nfQv7t8UupzvwIPF6fKbM8tdqAjU8ouOiAOXOP0XoyovYRe6r1dex/PMAF8RWP1FE2pL9yA64pL08qbDorNRzBsgnUOfUL/rYpwO8mBBwVKnPH/gZ+iXjHlzbfiAs9Ghv9osnKMWoXaPiCkEE1QNV8QjIwmI4c7mCIY460gYYZhLiov+aYfLZJoOGnvtW69+7FR689wHETkni+Z6TqvFwxiv4bd/gWmeJE2A1QQUljEEePJ/HqYxrGfFJ5hqm+TpxLe8LRBw2NTZDoGqRfMJfl4xdxWascTcmSfyISPV7HmIkyJZqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 194.138.21.74) smtp.rcpttodomain=monjalon.net smtp.mailfrom=siemens.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=siemens.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=siemens.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8C+WkLg4PDxtF6EpUkEF+wb+meU2Jz63BB8TdtYHOAM=; b=opwxcrBp7n/Ppfr+P48nm/pzovKwfe6hVVUIR26LstvbDehS4HEYgaAC/Fre43pAq4s4ltmN9wm52w5aTnRPfQjaSaHk25k8qFU0qiRgsZMBrzq1Gd4L6dsiIUJ1kaoCHkLZjLUECfkpOck8ERM3hGqyonbT1fGDBmtAv6RNDq7fObY+GN5oRkXWL/sISGe61Fn29fq9S3ion8krN7w9opp4spWmk4RAZji+68i2UYyPxWZovbfckjzjWuBykhqQo2A8tB8PqNP188CngqRdQbWVUiMV9vHis4EDrub/vM4eW8FPe7SITCUFY/GnjivHgmjAgqVBs4Wmgd+dbXj1Qw== Received: from AS8PR04CA0109.eurprd04.prod.outlook.com (2603:10a6:20b:31e::24) by AM7PR10MB3745.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:14e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Wed, 7 Sep 2022 15:01:57 +0000 Received: from VE1EUR01FT080.eop-EUR01.prod.protection.outlook.com (2603:10a6:20b:31e:cafe::15) by AS8PR04CA0109.outlook.office365.com (2603:10a6:20b:31e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.14 via Frontend Transport; Wed, 7 Sep 2022 15:01:57 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 194.138.21.74) smtp.mailfrom=siemens.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=siemens.com; Received-SPF: Pass (protection.outlook.com: domain of siemens.com designates 194.138.21.74 as permitted sender) receiver=protection.outlook.com; client-ip=194.138.21.74; helo=hybrid.siemens.com; pr=C Received: from hybrid.siemens.com (194.138.21.74) by VE1EUR01FT080.mail.protection.outlook.com (10.152.2.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.13 via Frontend Transport; Wed, 7 Sep 2022 15:01:56 +0000 Received: from DEMCHDC89XA.ad011.siemens.net (139.25.226.103) by DEMCHDC8VQA.ad011.siemens.net (194.138.21.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.12; Wed, 7 Sep 2022 17:01:56 +0200 Received: from md1za8fc.ad001.siemens.net (158.92.8.74) by DEMCHDC89XA.ad011.siemens.net (139.25.226.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.12; Wed, 7 Sep 2022 17:01:55 +0200 From: Henning Schild To: Thomas Monjalon CC: , Henning Schild Subject: [PATCH] devtools: give checkpatches.sh some way of finding the perl script Date: Wed, 7 Sep 2022 17:01:44 +0200 Message-ID: <20220907150144.5874-1-henning.schild@siemens.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [158.92.8.74] X-ClientProxiedBy: DEMCHDC8A0A.ad011.siemens.net (139.25.226.106) To DEMCHDC89XA.ad011.siemens.net (139.25.226.103) X-TM-AS-Product-Ver: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-AS-Result: No-10--11.533400-8.000000 X-TMASE-MatchedRID: zj1lW5vDo/whWHPfXnsR+em8dcFmTYdoJyE4wEjvuND/Te3t5cJMG0tc 8DbogbSEwj10jtt9j++4eAQijLjp36y48wN6gs5SpimlO7mS2uamWOD8X0TFhJxVZzZr7+O7Mso vp/h9OdFirg8tJChsdDiNWdXTwYbgT1BRwJc+BgSDKwKfDa7rsMC/vKeIsoN8KrDHzH6zmUWbXG FefHHOYsgVyTd/p+/Ib5aQRo/etBlXL73jW9Ca44Ay6p60ZV62fJ5/bZ6npdg7AFczfjr/7KDO+ iQTfXaNjuxCaahKlz+8q8gRTU5Em1jn2w17Teb41p4vMrp8YmY= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--11.533400-8.000000 X-TMASE-Version: SMEX-14.0.0.3080-8.6.1018-26680.007 X-TM-SNTS-SMTP: AF676971CCE1547D5EE51A39E5BAA76775842716F3CDAD0A12A3911A97D4F33C2000:8 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1EUR01FT080:EE_|AM7PR10MB3745:EE_ X-MS-Office365-Filtering-Correlation-Id: ebe33cff-bd66-4dfd-dc53-08da90e1e86f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /mcOENds6gdfMWs2KAAAIRxnBcoI4i0QAjqatAQCa6i+tugtrq9Y7VIjZmEAhZFs8TCoHsVzJLhX+i4h05AUcwF9Vo2ae75Dx90eOIM/VKMhWUT3b+w4jXJoPfAcOMI/priAPgdlBQYVv7JsnElwE5GfzEAyJFjKBCRxHsXW8wCQLWttosze+srRj6ZwhM3Q6hSHR56rvH/e+7SKiJ3GX+gOjH6qy/rMp7Sv0FQUqfnYRaZo0O2XU2Gp3oMSKj+Z+/g8FmWsZYRcSl2wmHNR6GxqMw90mApn3cXWs203uD8Hf7LR6gCv0JbqzHOgD9/DOO5dI5zEG+Ij1NDWSPE0gP9vF6xCG52yrHEkRNTNHA1BxynLdqOwseLeCTf063Ulmeq4pYnUN0ytdvnzRT1jnXJtbrEwB7WEDF5+xUHIuCEZSOgmSnKAKyspmv/gC8bO/tNZ2dEzmvmmkDgGI3awbQiR3bxJ+D7QuzES8KA0Jd7s2nl3Cq5noU+gpnHnWfz3K0OOq2vc6zDJvn+qF8jbc1brIlUGu5PXESROZXeRaAXgOvFiMwM6TP+vjQI/zRMYgakAVCV4ySAgxsnRUQdMR4gHZfol83zhStfw0pfG/rMsZG4XNDMPV3qTUl+GRM4QBQOm4bEeSRhMpto2D8h991y0Q9u0KMi0Dm12f8+i/w+W+7DJXLpp4Hj+JGKPyQJHli8Wbvnu5+oa+MHv1+zCnFgabsQwM5cZzk5uRkw3vLW5zVryj3Z0OQ5doWr4oAcF2h4e0200/vcO8lGr3AavuA== X-Forefront-Antispam-Report: CIP:194.138.21.74; CTRY:DE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:hybrid.siemens.com; PTR:hybrid.siemens.com; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(136003)(346002)(376002)(396003)(46966006)(36840700001)(40470700004)(16526019)(8936002)(2616005)(1076003)(5660300002)(336012)(186003)(44832011)(82310400005)(40480700001)(41300700001)(26005)(86362001)(36756003)(107886003)(6666004)(83380400001)(47076005)(478600001)(956004)(36860700001)(40460700003)(7636003)(7596003)(2906002)(4326008)(8676002)(316002)(6916009)(356005)(54906003)(70586007)(82740400003)(82960400001)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: siemens.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2022 15:01:56.7407 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ebe33cff-bd66-4dfd-dc53-08da90e1e86f X-MS-Exchange-CrossTenant-Id: 38ae3bcd-9579-4fd4-adda-b42e1495d55a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=38ae3bcd-9579-4fd4-adda-b42e1495d55a; Ip=[194.138.21.74]; Helo=[hybrid.siemens.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR01FT080.eop-EUR01.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR10MB3745 X-Mailman-Approved-At: Fri, 09 Sep 2022 16:15:54 +0200 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Try and find the script in the sources of the currently running kernel so that users do not have to specify DPDK_CHECKPATCH_PATH which might well be the same location found by the educated guess. Signed-off-by: Henning Schild --- devtools/checkpatches.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index 1edc5810ad10..03e791bd09d5 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -41,7 +41,8 @@ print_usage () { usage: $(basename $0) [-h] [-q] [-v] [-nX|-r range|patch1 [patch2] ...] Run Linux kernel checkpatch.pl with DPDK options. - The environment variable DPDK_CHECKPATCH_PATH must be set. + The environment variable DPDK_CHECKPATCH_PATH can be set, if not we will + try to find the script in the sources of the currently running kernel. The patches to check can be from stdin, files specified on the command line, latest git commits limited with -n option, or commits in the git range @@ -256,10 +257,15 @@ done shift $(($OPTIND - 1)) if [ ! -f "$DPDK_CHECKPATCH_PATH" ] || [ ! -x "$DPDK_CHECKPATCH_PATH" ] ; then - print_usage >&2 - echo - echo 'Cannot execute DPDK_CHECKPATCH_PATH' >&2 - exit 1 + default_path="/lib/modules/$(uname -r)/source/scripts/checkpatch.pl" + if [ -f "$default_path" ] && [ -x "$default_path" ]; then + DPDK_CHECKPATCH_PATH="$default_path" + else + print_usage >&2 + echo + echo 'Cannot execute DPDK_CHECKPATCH_PATH' >&2 + exit 1 + fi fi print_headline() { # -- 2.35.1