From patchwork Wed Sep 13 02:59:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 813146 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xsRKX4rr5z9t39 for ; Wed, 13 Sep 2017 13:02:24 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6C80BC22363; Wed, 13 Sep 2017 03:01:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C02ABC22411; Wed, 13 Sep 2017 03:01:15 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 62CF8C22447; Wed, 13 Sep 2017 02:59:32 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lists.denx.de (Postfix) with ESMTPS id 5EBE9C224C5 for ; Wed, 13 Sep 2017 02:59:32 +0000 (UTC) Received: from laptop1.fritz.box ([94.197.121.167]) by mail.gmx.com (mrgmx002 [212.227.17.184]) with ESMTPSA (Nemesis) id 0MexFh-1e3HW70Paz-00OTuA; Wed, 13 Sep 2017 04:59:22 +0200 From: Heinrich Schuchardt To: Tom Rini Date: Wed, 13 Sep 2017 04:59:05 +0200 Message-Id: <20170913025905.16419-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170912213344.GC4474@bill-the-cat> References: <20170912213344.GC4474@bill-the-cat> X-Provags-ID: V03:K0:pESk1yFqPRzF1Qt+vvWy142eUsDcFskJslXx3pJEDeipKhMhhyU ErUlj4t+4tIpwESbjn0ucjjJD1RzgglNk8TeQ20GUtWKIP7k1yZ0Z6V6C3zVPTKeCtALFnT ojMRlJ3IQGLi5fQCKoyzZGBGfgCvcFfQp9N9Lc1ldcYYelzyHbX5bFI4Tatm5AiLjQWZGrq 9f3NHr/ny1I82p9RtB+MA== X-UI-Out-Filterresults: notjunk:1; V01:K0:8DPSXuOwqm0=:FQmmEQRVzjyzeh/yAX6O5h D4WOZgH6nfm9nLNWDPXdxrK2PGWYlLKhZjUxrQr9LWHnmkoiMM24vmfj6224EvQZz/XLqyJ55 /+TiyptFjhnOsFty1JS4NJYxAhbQjs65nfZhTkdanUbFc1tLMM8o20BMPSWVzSXPH4H+sF1EU fl04l8NXJvh6a9S5ICFhDVUV/puInCpCUw3pnK3rJTQclKxwZZneV6lFnWXwooNliiV4no3k1 p+NRYuTfEBvPE/GxslYYUoffiAG89GBkvHTh5SaEVoKF6EYNaIvP61SdxwxkeWnsdoiZeMqEO Gz5IFvIpQyAAxNe8BN/kMYDGD4vAJB2LQEcgUXv6H+6xFEYE0Gcu/E5/QuMxxG59p/rEsOaTb TCkga99sm5TJE1EsAzHO9Mq/BLnlA68seMivz5UEA5Sq7wzmCa0li0BmYI2ptLGV0DTuqm82T Q5zoxfRcV+Qz3RWr2b0LPGKjQrBONvUpkcaNvUKeqQH0eZciJKENRAQ/7cevVIDNMlOXQQndU qYgGMxx2vcy9obIlOAO1FXPnHfUdsojiuMi0932JVtzYFWwuzoC74BTjLOQOV03CL8QgQP/Vw pfaElBMxNDU8IZwMiG/eVbFL7zuO9Z0fX+N9HiKFwdueIk1sVjaudhYdHdn/sLXbmGfwsLHMu uQwhSqSZhbNh++mIuiHO8/Jn426D5AlVBkFlv6DcF626DSGjAkKPeJA9C2/iRfNZTyYCfRp+q lF1XV65UEjQbQnDR/2+ePq6y/tRoxPw4W6QcrQknuklOBPso5jFi9XrW1YVelREASRwy0bdOX Rb61dcMvGomfTMvhdhxZZIDj8In581+4kfaKhdgtuRx8DEnX7w= Cc: Jagan Teki , u-boot@lists.denx.de, Stefan Roese , Heinrich Schuchardt Subject: [U-Boot] [PATCH 1/1] checkpatch.pl: Add warning for new __packed additions X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" While there are valid reasons to use __packed, often the answer is that you should be doing something else here instead. This reintroduces the changes of f503cc49a570 (Add warning for new __packed additions) Signed-off-by: Heinrich Schuchardt --- This patch is to go after [PATCH v2 1/1] checkpatch: update from Linux v4.13-rc6 In the git log I found no other contributions that we loose by upgrading to the new checkpatch version. I just wonder if the warning text makes sense. Wouldn't it be more helpful to write: "Sequencing structure members in a packed order is preferable to using __packed." Maybe this is also the reason why this check was not accepted by upstream. --- scripts/checkpatch.pl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 2287a0bca8..4142f5c837 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5616,6 +5616,13 @@ sub process { "__packed is preferred over __attribute__((packed))\n" . $herecurr); } +# Check for new packed members, warn to use care + if ($realfile !~ m@\binclude/uapi/@ && + $line =~ /\b(__attribute__\s*\(\s*\(.*\bpacked|__packed)\b/) { + WARN("NEW_PACKED", + "Adding new packed members is to be done with care\n" . $herecurr); + } + # Check for __attribute__ aligned, prefer __aligned if ($realfile !~ m@\binclude/uapi/@ && $line =~ /\b__attribute__\s*\(\s*\(.*aligned/) {