From nobody Tue Nov 11 03:18:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1561116693; cv=none; d=zoho.com; s=zohoarc; b=eKEhLorMY45Nilq/nCjnwr3kcOcCIVhBkW/4MkiheuTd+qxoEDZ+wfl7/Fm5KRVZSvfP0bBahLyJy5j+YiVzZiX8vZFwSEOvk6x8biiaVGIR19pger3xbZRxByX1tLbWMIcqAkBcUze5r0oVu+O+/hvJL16SJFUhvhDFk6u1AmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1561116693; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=9pL/Z5DFJzohSpK1nhF7UHS5kALHqB6eeua8inxT02g=; b=cgUO47UCYP52+5jJH+h6P8huGors9Jn7f+mz2EhXzNA3aR0IZbHHUbwX3mnOXwdY0U2i1YVc5jUH285NoeXdlmbFR+sq+LeTfvuAwo/IP9GYGiQ1d+sjE8RN8ogeaWFrK3UsogEWUprB8z06Cvi+uFiAAELATDN4x1I0NtwE8Ro= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1561116693388602.2129785175421; Fri, 21 Jun 2019 04:31:33 -0700 (PDT) Received: from localhost ([::1]:59814 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1heHlR-0000Kl-OC for importer@patchew.org; Fri, 21 Jun 2019 07:31:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48570) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1heHj3-0007sx-At for qemu-devel@nongnu.org; Fri, 21 Jun 2019 07:29:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1heHj0-0003ae-8T for qemu-devel@nongnu.org; Fri, 21 Jun 2019 07:29:01 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:34932) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1heHj0-0003Xu-2l for qemu-devel@nongnu.org; Fri, 21 Jun 2019 07:28:58 -0400 Received: by mail-wr1-x432.google.com with SMTP id m3so6256320wrv.2 for ; Fri, 21 Jun 2019 04:28:58 -0700 (PDT) Received: from 640k.lan ([93.56.166.5]) by smtp.gmail.com with ESMTPSA id y6sm2578525wrp.12.2019.06.21.04.28.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Jun 2019 04:28:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=9pL/Z5DFJzohSpK1nhF7UHS5kALHqB6eeua8inxT02g=; b=ORUvkXVLFYLfGu/VEWYLZ/xWciYV5whQOi2CQeGMK2tBR4o4K+uDSPVFF3KnpTz007 CMZtKgo7ckwfBLj7NL3fo2Ao5/EHsZa/TrVcWyhXskJO7+mE27j/HEx3GqxEw3uTrql6 SOmPzk13LQJMQBIssaQngc5/Euo/qwPMxb2GVqnwqFYpwnrsl8tKQFsnr84Ex09361nI 79YhwzR0K6kul0oghAxpnSrvyWornrebdfpfRGJq+Eq/xcAIWDk5OibrTsRA3Sa2w0zD CbNMt88P3mAmVsWQacXrkDj0PQWSDtOlxyRabO+CoVTS49xW0hkuNShtWgDxcjFJ7Svh 9ULA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=9pL/Z5DFJzohSpK1nhF7UHS5kALHqB6eeua8inxT02g=; b=W02LaeuRivPLbjh66iKd3kcd16697QHMQtTn9PlaKEIcPQVQeuQ9oefCyFee/g8+kd PDOD/oWFuG0GU554JKRl60BzohWJ1EhIPjWZC17u/4k0I75TquYNUd7KBoJOqwymHQh/ AqM4wzg64b/PI0WikPdUuuyg5l9aHb9+5xP+MTuHg46ZySFnTZFs+O5LMrfDxCxFOUSm yfaI9Ju0+EZcAeUF+9KogNFGo+k7JC9/EZuLv3pjk3m+GhJXUL2JRN3ZBhEIpFt89/GF zkgbY3PFUrqNprUBEpZhW8SRyWH7uGoK8Jp117suej8ujXJQ3N/7xJwCTpske09t3lm8 CIFA== X-Gm-Message-State: APjAAAWDw/Wn897AtLRvogDYEunCPvChVVFeWlual95sIydAPK4xplBu WOzmlqMGpkUJeuQ+SMyIfXYLtzCn X-Google-Smtp-Source: APXvYqxPzF5Z/C9UjV+VWq0q+br6kBEPhgZBPSQKfwSL4X7Xnw2R8U0rhawQZZu3UwGGPwi9fCDcaQ== X-Received: by 2002:adf:afd5:: with SMTP id y21mr94446674wrd.12.1561116536149; Fri, 21 Jun 2019 04:28:56 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Fri, 21 Jun 2019 13:28:54 +0200 Message-Id: <1561116534-21814-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 Subject: [Qemu-devel] [PATCH RFC] checkpatch: do not warn for multiline parenthesized returned value 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: armbru@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" While indeed we do not want to have return (a); it is less clear that this applies to return (a && b); Some editors indent more nicely if you have parentheses, and some people's eyes may appreciate that as well. Signed-off-by: Paolo Bonzini Reviewed-by: Eric Blake Reviewed-by: Richard Henderson --- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index c2aaf42..2f81371 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2296,7 +2296,8 @@ sub process { $value =3D~ s/\([^\(\)]*\)/1/) { } #print "value<$value>\n"; - if ($value =3D~ /^\s*(?:$Ident|-?$Constant)\s*$/) { + if ($value =3D~ /^\s*(?:$Ident|-?$Constant)\s*$/ && + $line =3D~ /;$/) { ERROR("return is not a function, parentheses are not required\n" . $he= recurr); =20 } elsif ($spacing !~ /\s+/) { --=20 1.8.3.1