From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a17:906:14cc:b0:9b2:89ee:1eb8 with SMTP id y12csp62123ejc; Wed, 4 Oct 2023 21:28:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkTYtuq8pBvGIDWT2l3HGHcbucTCLn5hPlHwDE0hVqBB+QEmCP40CQW2mt+1f7y06ozTn6 X-Received: by 2002:a05:620a:3949:b0:760:6b8e:eba with SMTP id qs9-20020a05620a394900b007606b8e0ebamr4820437qkn.12.1696480091391; Wed, 04 Oct 2023 21:28:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696480091; cv=none; d=google.com; s=arc-20160816; b=L/zHcztWezucXoujwjmGyv0Ly1T5u5ZuC5BKDJfpGf0nysLUD41WtkPJ2yLBtRNKUq MaQf0pEsBCI9Pjz+9rUI7fQA4l5yFxcIBrqU0HYURO55LO5L6XVTNVfLdaWKR7mxrk8o 97JR3/YCpXNb2ssMG08dCtxvu8cA+nraZk42BPq/K8/Gou28eHpUyF4gXNS+MXEPpvSU c7ZTCiKvFYxKoPK2qpM/1uy9oF6WliEiZAtZ+yI4CkhqZcAPhNhQI6xEmXnoD/2W9ow4 xjTxUllHqmCI1mD0uRVk0aBFI9yaCu3QeNDH0ScteZeWRqfj7r0sQW9/RcaUiiniSM4N v88Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=JyARwz5g+qIO6iCsgXaWy8OpoudmDME00w3m4DWPCAs=; fh=3rWcHQAVF4xoMbWlGmE15z9fUhwP7e8rCDvDdXgBjWY=; b=jngTmjtoo9xZC847MA3rkz4pC6fZUeS41lLt0E+Z4A/KqhReAjyipnG1x2u1UuLOmW HQ1aO5N+EGx4DSpUwsfHRW0XaudUab4CBgCKcHTMWkINx7ETYeMFfWIcSm49q5tA2BoJ Ev1FNKB1WFq5YIUkZtG7Slk4lOce2b4KgG+km0JV8fgIy09kQrPrR9zJWENKWii3G171 jDCzHF9eAz9gOHTIwiPaJ9u90F5Ss1LJbCz8RFGly8MS+Th0WZTi0QG/bWIbBH1EssHw IoqhCJGMvEIdr1f1DVcWwuhT2hflh98JfzMjpHf1OsIInLG8JVzLxNjD/3WetyCL7lWL LH8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TIjOEjFj; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j4-20020a37ef04000000b0076c6f87a455si385921qkk.624.2023.10.04.21.28.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 04 Oct 2023 21:28:11 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TIjOEjFj; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoFxw-0005SS-3j; Thu, 05 Oct 2023 00:28:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoFxs-0005Rt-Th for qemu-arm@nongnu.org; Thu, 05 Oct 2023 00:27:57 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qoFxq-0006fX-Qd for qemu-arm@nongnu.org; Thu, 05 Oct 2023 00:27:56 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4065dea9a33so4878835e9.3 for ; Wed, 04 Oct 2023 21:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1696480073; x=1697084873; darn=nongnu.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=JyARwz5g+qIO6iCsgXaWy8OpoudmDME00w3m4DWPCAs=; b=TIjOEjFjlyXNoPTK5/joPiRIR0Zt8RFx97dTlT6AmOKmCEKTfFl0qpK0odzsZZyEeU f7GXfPffRQeC6Yy5PhDdFr65Qt1BRkhgp43vMFDHdNU0k8eWt5El5XHLNEo1dW2yAfWH GIsWqNYDmR96yN64jKXfv3B/apgcO9wMW4Th/CYToZI5MR8U/1fZXE11bYMbsx6uV2b2 Qg2xPVGYHfsh+6eZH07cv9iuXpEwaSw/Zk5rf5L7qOGl2lCuNViFwlxfXaq8yuI01B2Q kKfekOVDj205+GUoOMkX6CmQimS2ge+L1uTFsVgrgHgSAWf1WgXGyDEYqSzQG4BQtD1G VT3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696480073; x=1697084873; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JyARwz5g+qIO6iCsgXaWy8OpoudmDME00w3m4DWPCAs=; b=fPDVnN2jyrmZt1atDseFmmyQtmH9zCVctCHV1HsUqgDAJbwF4mb83UHTBSca0l6zOs WmtdqTOnFQisxI2qW4eVzLM5+cY+FO4V9boMSeF+nI9v0OtklxDlu91ApSBp4QEY0dmq k6vMiO3Ven/TdGJRT1AvR5XMi80AFXYdk/tL3i996gcF5mnGpMaU6SU/fyzisJJwSctY fp94zwYk2HBZbzSfpsjXh7g8CKoT75WcSRy1bFLjydEfKh05aOt2L2B0q+f9TM/Dz7qO aIr1F5NAkvWDHrqHeJe2p88wfJlY6Leqs8NwGw5lCzvHcWGUxM+5gbHga4Jjs7zd1RGT Ly1w== X-Gm-Message-State: AOJu0YwT1RadzubP1jiAODwh4e30HXHarNLcdyR/GA0MI6MdumFiAWOp V8cCU7zjpUkS6eN5lChBwDEJvA== X-Received: by 2002:a05:600c:b59:b0:3ff:233f:2cfb with SMTP id k25-20020a05600c0b5900b003ff233f2cfbmr3932702wmr.23.1696480073001; Wed, 04 Oct 2023 21:27:53 -0700 (PDT) Received: from [192.168.69.115] (tbo33-h01-176-171-211-120.dsl.sta.abo.bbox.fr. [176.171.211.120]) by smtp.gmail.com with ESMTPSA id e17-20020a05600c219100b0040646a708dasm597311wme.15.2023.10.04.21.27.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Oct 2023 21:27:52 -0700 (PDT) Message-ID: <5d6eb736-04da-b0e5-0e88-e09fc7c122bc@linaro.org> Date: Thu, 5 Oct 2023 06:27:49 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH 10/21] qapi: Inline QERR_INVALID_PARAMETER_VALUE definition (constant value) To: quintela@redhat.com Cc: qemu-devel@nongnu.org, Markus Armbruster , qemu-block@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, "Gonglei (Arei)" , Zhenwei Pi , Laurent Vivier , Amit Shah , Alberto Garcia , Kevin Wolf , Hanna Reitz , John Snow , Vladimir Sementsov-Ogievskiy , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Paolo Bonzini , Gerd Hoffmann , Peter Xu , Leonardo Bras , Jason Wang , Konstantin Kostiuk , Michael Roth , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , Eduardo Habkost , "Michael S. Tsirkin" , David Hildenbrand , Richard Henderson References: <20231004173158.42591-1-philmd@linaro.org> <20231004173158.42591-11-philmd@linaro.org> <871qeas18v.fsf@secure.mitica> Content-Language: en-US From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: <871qeas18v.fsf@secure.mitica> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.528, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org X-TUID: oYo1vBLWLEsO On 4/10/23 20:15, Juan Quintela wrote: > Philippe Mathieu-Daudé wrote: >> Address the comment added in commit 4629ed1e98 >> ("qerror: Finally unused, clean up"), from 2015: >> >> /* >> * These macros will go away, please don't use >> * in new code, and do not add new ones! >> */ >> >> Mechanical transformation using the following >> coccinelle semantic patch: >> >> @match@ >> expression errp; >> constant param; >> constant value; >> @@ >> error_setg(errp, QERR_INVALID_PARAMETER_VALUE, param, value); >> >> @script:python strformat depends on match@ >> param << match.param; >> value << match.value; >> fixedfmt; // new var >> @@ >> fixedfmt = "\"Parameter '%s' expects %s\"" % (param[1:-1], value[1:-1]) >> coccinelle.fixedfmt = cocci.make_ident(fixedfmt) >> >> @replace@ >> expression match.errp; >> constant match.param; >> constant match.value; >> identifier strformat.fixedfmt; >> @@ >> - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, param, value); >> + error_setg(errp, fixedfmt); >> >> Signed-off-by: Philippe Mathieu-Daudé > > Reviewed-by: Juan Quintela > > And like the approach, but > >> if (granularity != 0 && (granularity < 512 || granularity > 1048576 * 64)) { >> - error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "granularity", >> - "a value in range [512B, 64MB]"); >> + error_setg(errp, >> + "Parameter 'granularity' expects a value in range [512B, 64MB]"); >> return; > > There are several lines like this one that become way bigger than 80 > characters. Yes, I just realized I forgot to run checkpatch.pl :/ Now done, this is the single patch producing: ERROR: line over 90 characters > Later, Juan. > > PD. No, I have no clue about how to convince coccinelle to obey qemu > indentation rules. Well this use Python, so we could check the length and split (returning some tuple) but: $ ./scripts/checkpatch.pl origin/master.. | fgrep 'ERROR:' | wc -l 10 So I guess I'll just manually adapt :)