From patchwork Mon Mar 28 15:23:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Uvarov X-Patchwork-Id: 64533 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1507063lbc; Mon, 28 Mar 2016 08:23:51 -0700 (PDT) X-Received: by 10.107.136.156 with SMTP id s28mr27234606ioi.21.1459178631318; Mon, 28 Mar 2016 08:23:51 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id qm12si8720587igb.6.2016.03.28.08.23.50; Mon, 28 Mar 2016 08:23:51 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 80EB16184E; Mon, 28 Mar 2016 15:23:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 71DB56160F; Mon, 28 Mar 2016 15:23:45 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id EBBFD6162F; Mon, 28 Mar 2016 15:23:42 +0000 (UTC) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) by lists.linaro.org (Postfix) with ESMTPS id B99686160D for ; Mon, 28 Mar 2016 15:23:41 +0000 (UTC) Received: by mail-lb0-f179.google.com with SMTP id bc4so83609268lbc.2 for ; Mon, 28 Mar 2016 08:23:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=vaWpQIII6xqpJaKGw2XU1knaiofyJ4wwOTh3WJrAIFg=; b=geGGpWIc3NkDEyBiOIEuxh4u8tq0yTQaXwXcQGZJfTFqQZQyDi3Hmy8eYDhuubF0ew wCFNNX0jRNwvehjggFD41HRXOSfSGDZwPgQRvpXHWQR/h7qGjRsx8URXx98GXeOx5qwp N/5+tqoKhD3LS4KIyRyIwCRq1zpN4GGQR0Pu+MEtNYl25VJj6881+4TlmYHGrPj9Eh0K taYSCSXwykuyxgSOBAacFrrZPpv3T73m1sbj0qD+52G3xvJ7jeHY59KOPRv2QdieDdma gaVDGuKnDY1irXtGbYSK3P2n/aUyemEEh69xp7e0OnSNjQlkhNeWNbs4tef9V6U9pQI+ nrdg== X-Gm-Message-State: AD7BkJJkptE+LusAPJX26pQzVtCAmyckaok80FAw5axKuyS7awtY66UpZHx6IUqeDi5fGn6Xyq4= X-Received: by 10.112.201.105 with SMTP id jz9mr8435915lbc.139.1459178619840; Mon, 28 Mar 2016 08:23:39 -0700 (PDT) Received: from localhost.localdomain (ppp91-77-172-79.pppoe.mtu-net.ru. [91.77.172.79]) by smtp.gmail.com with ESMTPSA id f7sm4641720lfg.19.2016.03.28.08.23.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Mar 2016 08:23:39 -0700 (PDT) From: Maxim Uvarov To: lng-odp@lists.linaro.org Date: Mon, 28 Mar 2016 18:23:31 +0300 Message-Id: <1459178612-10830-1-git-send-email-maxim.uvarov@linaro.org> X-Mailer: git-send-email 2.7.1.250.gff4ea60 X-Topics: patch Subject: [lng-odp] [PATCH 1/2] checkpatch.pl: do not require kstrtoint X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" For one line sscanf checkpatch requires kernels kstrtoint helper function. Comment this check out. Signed-off-by: Maxim Uvarov --- scripts/checkpatch.pl | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 16316b9..8882757 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5093,25 +5093,25 @@ sub process { } # check for simple sscanf that should be kstrto - if ($^V && $^V ge 5.10.0 && - defined $stat && - $line =~ /\bsscanf\b/) { - my $lc = $stat =~ tr@\n@@; - $lc = $lc + $linenr; - my $stat_real = raw_line($linenr, 0); - for (my $count = $linenr + 1; $count <= $lc; $count++) { - $stat_real = $stat_real . "\n" . raw_line($count, 0); - } - if ($stat_real =~ /\bsscanf\b\s*\(\s*$FuncArg\s*,\s*("[^"]+")/) { - my $format = $6; - my $count = $format =~ tr@%@%@; - if ($count == 1 && - $format =~ /^"\%(?i:ll[udxi]|[udxi]ll|ll|[hl]h?[udxi]|[udxi][hl]h?|[hl]h?|[udxi])"$/) { - WARN("SSCANF_TO_KSTRTO", - "Prefer kstrto to single variable sscanf\n" . "$here\n$stat_real\n"); - } - } - } +# if ($^V && $^V ge 5.10.0 && +# defined $stat && +# $line =~ /\bsscanf\b/) { +# my $lc = $stat =~ tr@\n@@; +# $lc = $lc + $linenr; +# my $stat_real = raw_line($linenr, 0); +# for (my $count = $linenr + 1; $count <= $lc; $count++) { +# $stat_real = $stat_real . "\n" . raw_line($count, 0); +# } +# if ($stat_real =~ /\bsscanf\b\s*\(\s*$FuncArg\s*,\s*("[^"]+")/) { +# my $format = $6; +# my $count = $format =~ tr@%@%@; +# if ($count == 1 && +# $format =~ /^"\%(?i:ll[udxi]|[udxi]ll|ll|[hl]h?[udxi]|[udxi][hl]h?|[hl]h?|[udxi])"$/) { +# WARN("SSCANF_TO_KSTRTO", +# "Prefer kstrto to single variable sscanf\n" . "$here\n$stat_real\n"); +# } +# } +# } # check for new externs in .h files. if ($realfile =~ /\.h$/ &&