Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752792AbdLEQen (ORCPT ); Tue, 5 Dec 2017 11:34:43 -0500 Received: from mail-co1nam03on0089.outbound.protection.outlook.com ([104.47.40.89]:34752 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752481AbdLEQeg (ORCPT ); Tue, 5 Dec 2017 11:34:36 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; From: Yury Norov To: linux-kernel@vger.kernel.org, Andy Whitcroft , Joe Perches Cc: Yury Norov Subject: [PATCH v2] checkpatch: suppress false long-line warining Date: Tue, 5 Dec 2017 19:34:03 +0300 Message-Id: <20171205163403.32470-1-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: VI1PR08CA0129.eurprd08.prod.outlook.com (2603:10a6:800:d4::31) To MWHPR0701MB3834.namprd07.prod.outlook.com (2603:10b6:301:7f::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2771f0ed-9b50-4ccd-fe65-08d53bfe11a8 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603286);SRVR:MWHPR0701MB3834; X-Microsoft-Exchange-Diagnostics: 1;MWHPR0701MB3834;3:SL15+Y2ykyHbeYCZ2CpiFUtsd1gv14pMF1+xZSc/4zDoVwPF9/mvaKczZubyWfApTXLdsrj+Dy9NyY3kAqejQeAG0hLocajsFeNeKV80luVWltKXRXKiPydUTkxBqgltf3BNAOT65rW0Ml/pvcuDbyrLVpi89LnLo2FvVdoPErQHg8zs6lyadHP8JupdfHMtD3V5tUJaCCp+djASi1BLS6YaVYqRuED7sarbMBvKX3Z2EBY8+y2mEopsYIpNgUFJ;25:EdAn73W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C5Z1yWz6stSGD3Q6WyjivrPdY3rnbo72SD2QA8qpEPi2kMYuMppewGa7yjbKlrafzDfumn/HD5ZljeXaUG8bo3UwO2xD9uGBjX/0NdYqkJXo97PK9C0qGwzWEfKiqMsvBJsymPuVmRpip8KeeD2CTXhPgNDUE1uTeEvRn8/ifS00eSYlu194Mh5eac=;4:cqS6ALb4hollYZ97T16uqdAZjbHN3ZlQFJBtUvM4j6B0fZFAitMp0sW8L6I1O8ESeMWzYiVNl1jxAzKEOPSvjy6dB1MHNntJis0ifnPEc5jxj1tgxHK7VKxQik676E2SnUKHXjsrShfJORjvKM6X/xhNkeVRRKOIHdF13WhkrcucV/5vSnd9mY2fHNjXRtP9HCy0ET6qEmZZkSTOLyf23i59hbRxYsbUGge4NXiXnIiRmoFYFjPDBrYNbyDOq6IbnZwSSBJHX3Grc/QfODSoBQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(5005006)(8121501046)(10201501046)(3231022)(3002001)(93006095)(6041248)(20161123564025)(20161123560025)(20161123558100)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(201708071742011);SRVR:MWHPR0701MB3834;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:MWHPR0701MB3834; X-Forefront-PRVS: 0512CC5201 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(376002)(366004)(346002)(305945005)(42882006)(6116002)(36756003)(48376002)(25786009)(81156014)(8936002)(8676002)(81166006)(66066001)(5660300001)(110136005)(3846002)(33646002)(1076002)(316002)(6306002)(107886003)(6666003)(16586007)(966005)(478600001)(72206003)(106356001)(4326008)(101416001)(7736002)(50466002)(53936002)(2906002)(105586002)(6486002)(76506005)(16526018)(47776003)(51416003)(6496006)(52116002)(97736004)(50226002)(68736007);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR0701MB3834;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR0701MB3834;23:cfmX1Dp1fU4TsgYTpFEOKxfItxgpvhtmUAWCL49?= =?us-ascii?Q?zuJiD+stQUBChdRaSt3VcYASAhJjyeDHA5eQRx4jNp+KLH8yHwTwPzVVJwE3?= =?us-ascii?Q?lqR77rkHyn3y65yBW3AgjaQYkq9Hi79U1grsZ2SqjtfF9+nhomDhFp+rhKVD?= =?us-ascii?Q?7AhfM5fy8tPatdS/Ih0BHIc/dMxBLvqwgMCBD1ofgWvJEFj+JIcR2FTKwLqo?= =?us-ascii?Q?Fdxz8PDPxnO/IkwR6a8L6XvFix85lyt9hrZw/m1HiIVxHJjzx7+jXZOJ5XQj?= =?us-ascii?Q?l979nKmILADnPZU+lOfxAcYg9X0OApGVcyqYjxdLWSfTkat+tJRu5u75Vtq0?= =?us-ascii?Q?sAYQRYhozaH4qr4bFpWj2UDqzB1jA+xKYgf5rcDVD9XrHLFzkRNLtGrx0ok2?= =?us-ascii?Q?IL43GL/i641ilSucP9dzjSsRaeeK7dp356XCfgPHk2IhAH4LDnRgMVqi/mCm?= =?us-ascii?Q?TrpqaHMRNImkAWBF8W3qY7hyqc/vxTiKptE08mDRVOdryWthOE647EBE8b/q?= =?us-ascii?Q?Jed0izIv+SuyZRdPkRoAncGImXGRFh67JLlGP42neFnZpQlYQqzThf9DUvJK?= =?us-ascii?Q?1kka6TWSNNWFXRW7zh3Qd3Awstl2Vd4J60ebVB8yPRSXfvALKDkUazUK3Mdk?= =?us-ascii?Q?MgAdGU7Q5g1aX3KuGs2qRr3k0ZE5SOzppIk29llySjxmoFJYp15Dh5hWOG7k?= =?us-ascii?Q?eKN5ImXFYZk4ea9y3FQuYcJiUWuEGGGJDtQtUkmxdjTklOLwlsBjh6o2wSsM?= =?us-ascii?Q?qALv462RHiWskgoINTmmyGupGyW5CbKTs4ezs/V45jDkOLXIk8KBYWHgn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hShMecs1nw7ej5UsQlgsruw22IYuqurWu1CLVbbN+AAmYhvMrNRw5StTGCMbo99blp9hJpSWyHgHhhw78hqGBY2pZulXA75wZUKRHx6IjF0a2mC6qZcvaTgzu+HZ2x7u+BZwoxrLgqEssf+5gEqd0JKj8FBWh1bbsFgR34+qsOufFSuzt/GeT4HPLbv7evW5CIr/jQvpeBFqfvlCtKW7jBK+yjVX SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2017 16:34:31.8062 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2771f0ed-9b50-4ccd-fe65-08d53bfe11a8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0701MB3834 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1111 Lines: 37 For DOS-formatted patches, extra ^M symbol at the end of line increases overall line length by 1. It triggers unneeded warning if line is exactly 80 chars length. This patch fixes it. Discovered in discussion to this patch: https://lkml.org/lkml/2017/11/25/24 v2: simplify as suggested by Joe Perches. Signed-off-by: Yury Norov CC: Joe Perches --- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 040aa79e1d9d..e7b941b8e6d7 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2732,6 +2732,13 @@ sub process { #trailing whitespace if ($line =~ /^\+.*\015/) { + # If DOS line detected, additional ^M symbol at the end + # of line increases line length, so remove that ^M and + # decrease $length to avoid false positives when + # checking length of the line. + $line =~ s/[\s\015]+$//; + $length--; + my $herevet = "$here\n" . cat_vet($rawline) . "\n"; if (ERROR("DOS_LINE_ENDINGS", "DOS line endings\n" . $herevet) && -- 2.11.0