From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932946AbbIUQpA (ORCPT ); Mon, 21 Sep 2015 12:45:00 -0400 Received: from mga03.intel.com ([134.134.136.65]:52381 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932159AbbIUQos (ORCPT ); Mon, 21 Sep 2015 12:44:48 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,568,1437462000"; d="scan'208";a="809559171" From: Octavian Purdila To: apw@canonical.com, joe@perches.com Cc: linux-kernel@vger.kernel.org, Octavian Purdila Subject: [PATCH] checkpatch: avoid showing BIT_ULL warnings for tools/ files Date: Mon, 21 Sep 2015 19:30:46 +0300 Message-Id: <1442853046-29397-2-git-send-email-octavian.purdila@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442853046-29397-1-git-send-email-octavian.purdila@intel.com> References: <1442853046-29397-1-git-send-email-octavian.purdila@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Directly using shift operations in userspace compiled code should not trigger warnings as BIT_ULL macros are not available outside the kernel. Signed-off-by: Octavian Purdila --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 407eb6c..93557bf 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5527,7 +5527,8 @@ sub process { if ($line =~ /#\s*define\s+\w+\s+\(?\s*1\s*([ulUL]*)\s*\<\<\s*(?:\d+|$Ident)\s*\)?/) { my $ull = ""; $ull = "_ULL" if (defined($1) && $1 =~ /ll/i); - if (CHK("BIT_MACRO", + if ($realfile !~ m@\btools/@ && + CHK("BIT_MACRO", "Prefer using the BIT$ull macro\n" . $herecurr) && $fix) { $fixed[$fixlinenr] =~ s/\(?\s*1\s*[ulUL]*\s*<<\s*(\d+|$Ident)\s*\)?/BIT${ull}($1)/; -- 1.9.1