Received: by 10.223.164.202 with SMTP id h10csp2499574wrb; Mon, 27 Nov 2017 18:41:15 -0800 (PST) X-Google-Smtp-Source: AGs4zMbYrUBm6oaNnC20kfv2c8+yGNThryriVtMKp1aT0/1DwQjzrJNPXkxiNjdEGiwp5TyutOQe X-Received: by 10.84.235.202 with SMTP id m10mr40214579plt.57.1511836875546; Mon, 27 Nov 2017 18:41:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511836875; cv=none; d=google.com; s=arc-20160816; b=O1I80JIWTtzRMhjCwBMoiN1kVOQY/hOjsbUGV/nSy91xcYOGzC+wHuvfeNyEkD06Wu f03a4R3PZKB8LrqM2OysveWlEr2ZF1GpQ6VZ92bW0jao+rXiLCgOfUjETc6jgYOyW5yW KbZf7J4m/eWRVoCSYDZujsa2BUB1/EDYMXo1rnLKTHoXuvvNfzTbkU7N17cuG4nds4zd YJojOGI3vcR1MH9ARU4iyTTjbGbA5MFtaXilVKhLcvWpxHC3SezAiK8DM3nH3rNdMj3Q K/PxwPMrV+uIJv5AJDmFgYFvO8Z6XHa14jq8FL4G0o9bDrSx5U1APHJi2fSxDBJP+xdA tHKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=4SjP3rsBY5pRPJ5t8UlO3wVQFKjAeR3W1ZgpE3sZnAk=; b=MvB2wl+ekY06lWTSh/2gr3yHcIUSI3f+9zIZKiHQZhyEbFyl9q9Tzi7PsLvlA/SzFd 5NtIYKCvOxK1bNKng/Co1SJO1sZLqMnlTyP3MOLp5+uRWLIYVek0pu9MzCj6TI5igt+9 0kRDLgBudtzOtcINt3B9/n3ex7DB7TX7APSJhIoncwf1eK2CnhlrqMsB0hwlpzJ47hcB K18MaAAgG52tBSY8KWhoBO9crg/PZ8rHmz0tsSTlW3mYFr81uEavhRKREg3NwgvIJJUv K/Hyi3+Sh4noMFKCE8BFzyL9p0ccxR5wioGGuaphHu8pv3ciaSP74CV5UTZr5nz4zj4S cb6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=dZxcM7D5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h70si18992566pfc.186.2017.11.27.18.41.03; Mon, 27 Nov 2017 18:41:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@CAVIUMNETWORKS.onmicrosoft.com header.s=selector1-cavium-com header.b=dZxcM7D5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932154AbdK1Cj5 (ORCPT + 77 others); Mon, 27 Nov 2017 21:39:57 -0500 Received: from mail-sn1nam02on0089.outbound.protection.outlook.com ([104.47.36.89]:6814 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753408AbdK1Cjz (ORCPT ); Mon, 27 Nov 2017 21:39:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4SjP3rsBY5pRPJ5t8UlO3wVQFKjAeR3W1ZgpE3sZnAk=; b=dZxcM7D5cSpsXOzgpM5fPTLOt5TxdOxYbfY0EgyitVGC96VXkrlKNUC405KdfWMFNU1quKBCO7L5FpE7In8NBOgs7xssN+qAXypwckkNbjSuoe1PO1igjFy42wJdLyEmBQqi8yfUSEr6IO7MJgPzOZrDD5OqYe+in+/UrpieXyo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (42.107.66.181) by DM5PR0701MB3832.namprd07.prod.outlook.com (2603:10b6:4:7f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Tue, 28 Nov 2017 02:39:51 +0000 From: Yury Norov To: Andy Whitcroft , Joe Perches , linux-kernel@vger.kernel.org Cc: Yury Norov Subject: [PATCH] checkpatch: suppress false long-line warining Date: Tue, 28 Nov 2017 05:39:38 +0300 Message-Id: <20171128023938.19872-1-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [42.107.66.181] X-ClientProxiedBy: HE1P191CA0011.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::21) To DM5PR0701MB3832.namprd07.prod.outlook.com (2603:10b6:4:7f::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 460a4335-d22c-4612-ede1-08d536094db7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199);SRVR:DM5PR0701MB3832; X-Microsoft-Exchange-Diagnostics: 1;DM5PR0701MB3832;3:dA5ziZWjRq28b3bUCYv8860FrbqqyB+EtosCVk197cAm/dPrthC4pCZTUf5Mwrtpd/0M+QsDonIx8loP85+S94qFXSfZewtF5lwwqkRGc07ixwVfaLo8ERY2Tz5p2IOpEPH5mM0rmxBUjdhZ6Ok6dBQqQuyWMkjmDfljkBWvxfpo1G0RshDKdYZBfbZLHzPlMqrLLmWRje0Ynj5sfFijeia9hFKQDCrLS3tz82Jhn5hE1saCcudLAsfxsuE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vJfOc6+OrWgpzHwt6HlwwrRKvaAORSGLmY9eNlUEb5WaurIhrP4LXai4QzcY0m/7zRo0xY+A5gmTpQimnvF/8cCTPsudblyMpUhTufpaCw4pMEguWyPK23RauMW97XawcCvBY42V32ovfXGDAItZaAmWFV8bMdLyjY+4/yhpr8OMkjqM01GrtI2X8r+pUPz8xufR7cpG5F0VD1xflcuDl2OdTFM0=;4:Z3QyNzimE1ZwG3GUQASyB7lxBdeGLFPA8OXfbkz738kSRflrG6VC1hs9x5kFM0ELUbWdQ6oMPHBE0+wdOIv1VOYJLJkXN11hjHkNEx64gyf+AwlNHN6j6nfxc7suXenQdzphjNdBDHNn1i1ivs8amftx4seUdgDVVIIcqhSvzFK44KlzvFifKPOwuKhsv/jhn8bzyG18lzBjQvV6Ojt5C4ZvIIyP6pobvyCIbtZZnAlYw1Fca7XARNsVm1FO/iL8JS63HnaFJXus2/5sIEnwVQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(2401047)(8121501046)(5005006)(3231022)(93006095)(3002001)(10201501046)(6041248)(20161123562025)(20161123555025)(20161123560025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR0701MB3832;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM5PR0701MB3832; X-Forefront-PRVS: 0505147DDB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6069001)(6009001)(376002)(346002)(366004)(189002)(199003)(8676002)(305945005)(5009440100003)(81166006)(3846002)(47776003)(5660300001)(6666003)(42882006)(16526018)(101416001)(7736002)(51416003)(66066001)(316002)(8936002)(1076002)(50986999)(6496006)(6116002)(2906002)(97736004)(52116002)(16586007)(966005)(72206003)(25786009)(6306002)(50466002)(76506005)(478600001)(106356001)(36756003)(189998001)(105586002)(48376002)(50226002)(110136005)(53936002)(68736007)(81156014)(6486002)(4326008)(107886003)(33646002);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR0701MB3832;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR0701MB3832;23:X0Zius9YwUYMGw/l2RCH0HyWyPO00dP5AJQzdS8?= =?us-ascii?Q?l2jVhXoR8capCyvs6JUy0L/vt5weKiHpJabrm7LcTsxVAvrdPmJe0l/GlZho?= =?us-ascii?Q?moYPQOX9fS/JuXMG4i7WLcDh4oZvQb+QUhCDeHSoo7I0lXW8hou2f4+KfZMf?= =?us-ascii?Q?/tcuDXT3hCWyq6GFntDhC9gizt19wIixLhVTPQy+nRPUU+nJ316r0/IbzCPT?= =?us-ascii?Q?OMmxgEePXe55EjEFzVKtFk2zSVbXe6Q0UR9fViJUvmCJhzaDEOQ+xTEmXy6F?= =?us-ascii?Q?GXMZTqaL+TH2hHNsCCP0HxXMSSFeS2+nOYIL25Qjk8pz7imR0QWbspMBBa+P?= =?us-ascii?Q?fNgdWvM7sSQ5I5lTQtuSEW3V26G3j/KXVGQf00z7+BE++1oylA60oSrw5Gs5?= =?us-ascii?Q?Qv7pdCu24D54nNH8VTIoTPvBUBalMaJEuJW2/WoEw0OntNRRi7qZniNYHap+?= =?us-ascii?Q?Xb2rjOs2TuNh4lasu9iMyZAI87JxmUODH6Gr4rAIHmmGFVd5405Wrd7rf/hO?= =?us-ascii?Q?Ddw3TTD4A7XoBOuFJ5UfqXzZw6JOkk1lav9NTO7WzC3UT7o4ttPn8NZSi/BX?= =?us-ascii?Q?iKNasUNUE0UVsojKhKSyayNb/p1UWi8JTcg0rwSN1gqs0CFLWdaO9nX/gazX?= =?us-ascii?Q?Bg+IPuNa4x5S4yc0fUSDr6Pq3kTf3zwDig+fQzLhSG/QMSPAsJjOIUJ8JW8s?= =?us-ascii?Q?vQpLZpybsoD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FM2YTD78MIYHHGtqNU3KSJI2y8of1QhWgEGXzNhyl2KIFf6RcscJr9XqnWX1+w8Rtag7sxmWu5AGrlC/knxpukrQLBYaboS58ag0iwkk=;24:JDtS2IIbG2eZ5IlIslNkFg8fO+R8hYBfMsYtYyAz/jI+5cexjhaRlehQnGg1oO752b63dBLve4gzKiWopy7bY2FJVLEa8BgseDXi/XCqYUs=;7:eb2muXAN13P+MIVYFADxNbOE+pw7hWXB1fCiucEsRRnr221jLONTL0NBBgQO6urZ8iuplxm34iJxmDWnDrWWwf6s2hzz/gofdhm1f7JrMJ7kFNX+XJTzWOlWKEhQR0onmztgmjJqy1q0H+SqLO8D2tzROFV0YNHaJfQmbN73MhzynspPlinH3hxaGeOgmHKF1WKMyja4hCJTPo23x7nnwCF0AbJY9Df1mOWPWARpqBVDpfgLV4BUvn+blMBvbIQy SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2017 02:39:51.9298 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 460a4335-d22c-4612-ede1-08d536094db7 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0701MB3832 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Signed-off-by: Yury Norov --- scripts/checkpatch.pl | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 95cda3ecc66b..a14d36f7df13 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -59,6 +59,7 @@ my $conststructsfile = "$D/const_structs.checkpatch"; my $typedefsfile = ""; my $color = "auto"; my $allow_c99_comments = 1; +my $is_dos_line; sub help { my ($exitcode) = @_; @@ -2731,7 +2732,9 @@ sub process { next if (!$hunk_line || $line =~ /^-/); #trailing whitespace + $is_dos_line = 0; if ($line =~ /^\+.*\015/) { + $is_dos_line = 1 if (!$fix_inplace); my $herevet = "$here\n" . cat_vet($rawline) . "\n"; if (ERROR("DOS_LINE_ENDINGS", "DOS line endings\n" . $herevet) && @@ -2884,7 +2887,12 @@ sub process { # if LONG_LINE is ignored, the other 2 types are also ignored # - if ($line =~ /^\+/ && $length > $max_line_length) { + # If DOS line detected, additional ^M symbol at the end of + # line increases line length, so increase max_line_length + # accordingly. + my $__max_line_length = $max_line_length + $is_dos_line; + + if ($line =~ /^\+/ && $length > $__max_line_length) { my $msg_type = "LONG_LINE"; # Check the allowed long line types first @@ -2892,7 +2900,7 @@ sub process { # logging functions that end in a string that starts # before $max_line_length if ($line =~ /^\+\s*$logFunctions\s*\(\s*(?:(?:KERN_\S+\s*|[^"]*))?($String\s*(?:|,|\)\s*;)\s*)$/ && - length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) { + length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $__max_line_length) { $msg_type = ""; # lines with only strings (w/ possible termination) @@ -2910,12 +2918,12 @@ sub process { # a comment starts before $max_line_length } elsif ($line =~ /($;[\s$;]*)$/ && - length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) { + length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $__max_line_length) { $msg_type = "LONG_LINE_COMMENT" # a quoted string starts before $max_line_length } elsif ($sline =~ /\s*($String(?:\s*(?:\\|,\s*|\)\s*;\s*))?)$/ && - length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $max_line_length) { + length(expand_tabs(substr($line, 1, length($line) - length($1) - 1))) <= $__max_line_length) { $msg_type = "LONG_LINE_STRING" } -- 2.11.0 From 1585366510204160257@xxx Wed Nov 29 02:42:02 +0000 2017 X-GM-THRID: 1582991338864972567 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread