From nobody Thu Nov 13 19:24:55 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org ARC-Seal: i=1; a=rsa-sha256; t=1582107669; cv=none; d=zohomail.com; s=zohoarc; b=hSEtL+OaDmpXRGDtGNb5aTppf3Fe3Q8hVs6KiAIwVHQmBUntTxcX/wJmqdJnYRRX7Q7z3w3ijd/Se/4sCTDhDn+QCAiuYPnT0Sj2iQJybZzxK9fZCbE0ocQcU2EDGCbElQAruwqXdUs1Sr3mqtasbhGV2yfqE0sIaLGIfKmUm0E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582107669; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vzvB/qjJiqdTjEn/lLbs5mcPMANf7FSjEh2lGoQmFv0=; b=FgynDOQtADecKKPGIjBToGluhp+aAyNoto6HeXaG/7AZkLDvXkT8JD/kk6pBwGEh/f+tOOjzQ0Zaox0ZK7P2kOU402vWuhIwgFdXb0PnfVJsFSyNQWhjymMjdb6IpB40VP/qiO2CEfySQHC8eK1q9gPJD1FxcwM4tnOPDLKagl4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1582107669225349.26113376277533; Wed, 19 Feb 2020 02:21:09 -0800 (PST) Received: from localhost ([::1]:48398 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4MTc-0001Ya-7b for importer@patchew.org; Wed, 19 Feb 2020 05:21:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53248) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4MPd-0003VN-4P for qemu-devel@nongnu.org; Wed, 19 Feb 2020 05:17:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4MPb-00053Y-Ur for qemu-devel@nongnu.org; Wed, 19 Feb 2020 05:17:01 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:48735) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4MPY-0004wJ-KJ; Wed, 19 Feb 2020 05:16:57 -0500 Received: from localhost.localdomain ([78.238.229.36]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MA844-1jBX864Afq-00BZbZ; Wed, 19 Feb 2020 11:16:25 +0100 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 03/17] scripts/checkpatch.pl: Detect superfluous semicolon in C code Date: Wed, 19 Feb 2020 11:15:58 +0100 Message-Id: <20200219101612.1033925-4-laurent@vivier.eu> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200219101612.1033925-1-laurent@vivier.eu> References: <20200219101612.1033925-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:IXjQSl0/la5Z164rm+NUocD7xxaoxaSU6n1TNuuHRPZySrnB6ZK ERe9mV2ShoYfilQNcB/XWW26hyR3PLF4xK4+AmGpRcGl3/5CD9liea+WM0dbL9DOi+qkCeP QuR2bJN3cFWKOsZNa6YfHyJndq8+/GWKYzTDzP5C74KkPHePbTCmVZg4fwhAC7USJnIHXFj bF47FrPpZzFc5ljlKUGag== X-UI-Out-Filterresults: notjunk:1;V03:K0:AkDA87X+Y5E=:6ksXsQXRv/pp0BO0P6vdkL o/cUtpoes6GpFbmnioboLNgjaKlV4Dhc7/87lXiP++/TDvJGwn5TySJ3ZoJM69bl67Uh0L4S7 jALtHU25lPO1+uif/yuHJBLir6mDnfGbLhezdXcuHLwhv7m4sTS2PWIWA3A9burkzV0jGmMC+ OvAQumCZj8zS1BuLtg8cQFGFb6tB4qiMXbtACVYcMIo5t7lKDLgirJOrZ2GXpg/6To6V6GCwF //Gs7Tp0epABuZsTCsxeQJNIT/qJjsiMq2MSpvHIATR+mTIXkPYIfHLQjWliyKmGHhAS5g3ca Jj/Xh0A3fl1J0myDlkrFjVXprYc5IfWmYhS7AmRnDtzclQI07atDTXK6YE6njQVBwPgA2geLK zFi+sZgY2L4uEo17kUiNm2dIDEVRWTDQMEeg9UQd3hzictBTULpxJdYGpMhIY34AQ9s12AHx9 dgqfVWxZ0AGDHeOPn+P9LEaQ0CleOfpuIBsvPElMrw4IMKQHAr1/HKx7cm/SjOlxf2smfsDbR 4s7qJQPn/vvxXvJSVacsEJTUoCp+3e036hYnbqNVlKfi4WkhU3puasGfDAk0K/1sdsmm3cHVE xdz7EdAhPu2HxPg9px1WILlj5xJ+pRFKhxYE9Rf30RkFDxdTw9u1SaXt0sg+dbQD5fErstm6B s4UEzPDCssKhyJyvhJfYAvLgvuZi1C6DChw1wk8ZjtKIW1C5agBWBcnKXk2nIHwW4LdwgqJYv oUniudlqOJq5RndusmdFVoHV7eGkkfZb83gISD1duhCvAxvXycl/OXK3DYnbC/cIe+awVbCt2 ixwyqBRUOydiBRtsVzi6p/iMLnqGZ0FzObvMiR2E1DbfNcJkGXVSIVOF1xqOebA0tj8uUrj X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 217.72.192.74 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Peter Maydell , Jason Wang , Michael Tokarev , Yuval Shaia , Max Filippov , Gerd Hoffmann , "Edgar E. Iglesias" , Marek Vasut , qemu-block@nongnu.org, Juan Quintela , qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth , Jiri Pirko , Eduardo Habkost , Alistair Francis , "Dr . David Alan Gilbert" , Alex Williamson , qemu-arm@nongnu.org, Richard Henderson , Kevin Wolf , Thomas Huth , Chris Wulff , Laurent Vivier , Max Reitz , Paolo Bonzini , Luc Michel Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daud=C3=A9 Display error when a commit contains superfluous semicolon: $ git show 6663a0a3376 | scripts/checkpatch.pl -q - ERROR: superfluous trailing semicolon #276: FILE: block/io_uring.c:186: + ret =3D -ENOSPC;; total: 1 errors, 1 warnings, 485 lines checked Reported-by: Luc Michel Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Paolo Bonzini Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela Reviewed-by: Luc Michel Message-Id: <20200218094402.26625-2-philmd@redhat.com> Signed-off-by: Laurent Vivier --- scripts/checkpatch.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index ce43a306f867..11512a8a09b8 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1830,6 +1830,11 @@ sub process { ERROR("suspicious ; after while (0)\n" . $herecurr); } =20 +# Check superfluous trailing ';' + if ($line =3D~ /;;$/) { + ERROR("superfluous trailing semicolon\n" . $herecurr); + } + # Check relative indent for conditionals and blocks. if ($line =3D~ /\b(?:(?:if|while|for)\s*\(|do\b)/ && $line !~ /^.\s*#/ &= & $line !~ /\}\s*while\s*/) { my ($s, $c) =3D ($stat, $cond); --=20 2.24.1