From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DFC26C433ED for ; Fri, 21 May 2021 13:30:49 +0000 (UTC) Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by mail.kernel.org (Postfix) with ESMTP id 24C0461164 for ; Fri, 21 May 2021 13:30:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24C0461164 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=monjalon.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF85C40686; Fri, 21 May 2021 15:30:46 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 06F2A40143 for ; Fri, 21 May 2021 15:30:44 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 0D88616CE; Fri, 21 May 2021 09:30:43 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 21 May 2021 09:30:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=HkPrImToCEQ5g hfvsT+wv5Rrnuhoedd20k4J6wvgSmM=; b=HFzUVjv3wSVIXxX3s7FssTK6eX93m rmcha6q/5P8jXGkUHbZ94lRkWUISeeTiRefaknvczxOFLUP+YdcC6YsnMOe7j3lQ jvnrLfUQL6loaH6YvVxw3vqkuSLb+iKZF0xoyXCIn9umGh/RLxoFMZirzQDu5xhs FhNeUEnU+HYwN1EeafAaJ2TQAIBS+Xv7JYC6DNNYnNL7qUeIOjKSXYpf1Z85XURC cQx2mtT2RJQCH4FQgJXi86jwOaoICLOs+avHdNFAiHRSmPTFsLn2sw0H3YQw/wVS sd98PvuQIjG+S1Yg3MNvM2Oz8+/XEGNZBbxo0GE+RbR/WQBNI9kyPuHSA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=HkPrImToCEQ5ghfvsT+wv5Rrnuhoedd20k4J6wvgSmM=; b=dfqXqVcG xlfi3LIGX28rNE0ofoF0p02WPCUvxqWqaN/gajJceu5inmM8+ZsDDt+gxDqd0/cX kw8y9FdmxAgCbwtOUImG1h2U2iccqpG8xar0MP5J6CqrjFus5peTR6Exm07zPPcU mbsLfArbb6Tj5Pj0jeG8T6GgCghe0CuL/PejPTXu0WdT6i0565LD8Tmpel31DpP+ 7I6NiPNr4eIajaYQr5HMX1J14pDAKMkMKUE+srFy6Sh8RWqtNtHlEIxrqgopfzSV 3hivco5QDSn/U1knLrHjjEUdxwp1L+LqW88DRNa27HuZUInAsLjrfPCHgM02ecYj o0mEhlYp0iR+og== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejfedgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 May 2021 09:30:42 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Ferruh Yigit Date: Fri, 21 May 2021 15:30:37 +0200 Message-Id: <20210521133038.1165002-1-thomas@monjalon.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210209152643.1832506-1-ferruh.yigit@intel.com> References: <20210209152643.1832506-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3] devtools: check %l format specifier 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 Sender: "dev" From: Ferruh Yigit %lx or %llx tend to be wrong for 32-bit platform if used for fixed size variable like uint64_t. A checkpatch warning will avoid this common mistake. Signed-off-by: Ferruh Yigit Signed-off-by: Thomas Monjalon --- v3: more explicit message v2: proposal to reword the message and comment --- devtools/checkpatches.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index ba43f84e64..c30dadd962 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -69,6 +69,14 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # check %l or %ll format specifier + awk -v FOLDERS='lib drivers app examples' \ + -v EXPRESSIONS='%ll*[xud]' \ + -v RET_ON_FAIL=1 \ + -v MESSAGE='Using %l format, prefer %PRI*64 if type is [u]int64_t' \ + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ + "$1" || res=1 + # forbid variable declaration inside "for" loop awk -v FOLDERS='.' \ -v EXPRESSIONS='for[[:space:]]*\\((char|u?int|unsigned|s?size_t)' \ -- 2.31.1