From patchwork Wed Jan 5 13:49:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 530159 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp320302imp; Wed, 5 Jan 2022 06:20:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxe39TsCL25oOzbHzCRF7yy7vYZsO5wCz0SDA9HCM6tdeDOvmgdIyXW4QYzviSb9imqTJUD X-Received: by 2002:a25:b748:: with SMTP id e8mr43979570ybm.313.1641392434726; Wed, 05 Jan 2022 06:20:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641392434; cv=none; d=google.com; s=arc-20160816; b=pz0dec+ylSg/APyLj4eomergB6joqdb0prrB5QSVZ0EzR4CS6alYxynOuvhjlp4ZWP Vt/9Qb0LBXFZUvATwU8kIVnG41ukT4fSpdeA9zhLOab0octjyjsES1dNBOtnLkym/QqE VB2N7MfqabriwN7TBI1+Z901dPh3XsScgNm1vbT+qS8eY4Xb7+EXuQ394lqCuUTn4Ylx BGU822Wchpm5J9DHQVGPqQUdIf4eMaRYZzlg50oDR/0qcAqTrHxqqGlhwHeqQiJ3n9dM 1ufXnDEMuacKkI+LqQKr3KUqyoWl5uF2SErPWvjQC1z63lAP3/wRHX4GWDJqCAbfsz3W lsVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ii+bvDWS85y0YClHEww7vyHUW9uUGIcI4psZCWKaqA8=; b=Ufzs5vSooRq7fNJQ7Bo3SQ+6yvM5JefMtHkB8/F734XWRIEnchxPDTRm7su3nyD3Kj olG/iaMYLBj41DKr2mi2pQuIfMJuZkUgY1vvyiLu+WBUCMse5YCYE/1w0ayk2TscJB0K HPql3sWrZ/KCGJmIZwxML+ec4KderGTZooWYMNJ+Ciq4UtnvrQ6LwQwZu3m0Epd3ZbUC lh3J/bhgjfCqmcnpulaGT0sooCp9cTkXuMknssC2Q7QrgZkc/KU0cCICzBTVAHxduhPe DkspNb9xvsVXhMjMdFfU6iEWQdcD2CfIN3/mIk+VZV9KG9Ock2vKFJtPLpNIadgR/jzf iX+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FyWtna+r; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (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 q184si8137431ybc.379.2022.01.05.06.20.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 Jan 2022 06:20:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FyWtna+r; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n579W-0006S6-5X for patch@linaro.org; Wed, 05 Jan 2022 09:20:34 -0500 Received: from eggs.gnu.org ([209.51.188.92]:51916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n56q8-0004dW-EF for qemu-devel@nongnu.org; Wed, 05 Jan 2022 09:00:33 -0500 Received: from [2a00:1450:4864:20::435] (port=34371 helo=mail-wr1-x435.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n56q6-0006T7-6a for qemu-devel@nongnu.org; Wed, 05 Jan 2022 09:00:31 -0500 Received: by mail-wr1-x435.google.com with SMTP id h23so299653wrc.1 for ; Wed, 05 Jan 2022 06:00:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ii+bvDWS85y0YClHEww7vyHUW9uUGIcI4psZCWKaqA8=; b=FyWtna+r5w4a2fvJI1OSujWrXqUHRamWGsIEez/OLbCydY3f7RbsK9qwMDvVsrCm5W +RVO21VoRHV4RMjW4+OjgJXdZceZsiz6bDp75lgywaFtuqhVKZ0/seuVUnT/J3LDRU6o v2RxjuaHnKP8bd8Go7/QI+iyGz50OL8mQetE/ZqfChtc0ghvQ53aYDtVjHBHZBxEo5vr q9yzE3yr+gc+MJna94V94OaRjNyxnqIsLGJqKV7a9avp0QxMOpRM90V0aR3I15Tf48qs 6+7w1iQeMdiZTz/MmWRwEG+QdadXIP9deCjKcCE4LCpqwfM+Cc/WFBh6mO2XCju3/OkW lsNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ii+bvDWS85y0YClHEww7vyHUW9uUGIcI4psZCWKaqA8=; b=diuJf5ZpJU6SIIXtG9jfiX8isXXAjlffXTIyvNkNTuNqEh7wK4S2bgX+gMSS/8sdI9 1rX78SxbO3G1Z3UJ+oUGD52q/6IGyGegAfSwyR0VPxojrzC09BP/PiJyddC3v8LqCJ/q 8sUEikbFB/X1rfqKm63y3GReIcXRruZSzhXIQeQuVdtqGivIXyaWDhJuwqdr5nmkfdGw ELJXs6JNerraWEAfODxyeDUIF+UQVJxkcc2Rs3cZWv5u5FgNR6zKfSldCH02SY9httt0 BXt90P4YMD0l/nfKNzWf2JIeWhQWNGSKvKex9E3hgCt8Sba3+4rkWkGc7229V189HGI2 pHRg== X-Gm-Message-State: AOAM531/yBufmPO6Th8Om2v5SDBiCPzinqWa6TFL57oO3gzfyEJsGYRx 264rAPSJUgdcTZs/0C75qKNApA== X-Received: by 2002:a05:6000:1886:: with SMTP id a6mr27965898wri.703.1641391227480; Wed, 05 Jan 2022 06:00:27 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 11sm52666446wrz.63.2022.01.05.06.00.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 06:00:19 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4F07B1FFCF; Wed, 5 Jan 2022 13:50:11 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 24/34] docs/devel: more documentation on the use of suffixes Date: Wed, 5 Jan 2022 13:49:59 +0000 Message-Id: <20220105135009.1584676-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220105135009.1584676-1-alex.bennee@linaro.org> References: <20220105135009.1584676-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::435 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , f4bug@amsat.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Using _qemu is a little confusing. Let's use _compat for these sorts of things. We should also mention _impl which is another common suffix in the code base. Signed-off-by: Alex Bennée Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20211217171902.2668674-1-alex.bennee@linaro.org> --- v2 - use Paolo's suggested wording for _impl --- docs/devel/style.rst | 6 ++++++ include/glib-compat.h | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/devel/style.rst b/docs/devel/style.rst index 4f770002a7..793a8d4280 100644 --- a/docs/devel/style.rst +++ b/docs/devel/style.rst @@ -151,6 +151,12 @@ If there are two versions of a function to be called with or without a lock held, the function that expects the lock to be already held usually uses the suffix ``_locked``. +If a function is a shim designed to deal with compatibility +workarounds we use the suffix ``_compat``. These are generally not +called directly and aliased to the plain function name via the +pre-processor. Another common suffix is ``_impl``; it is used for the +concrete implementation of a function that will not be called +directly, but rather through a macro or an inline function. Block structure =============== diff --git a/include/glib-compat.h b/include/glib-compat.h index 8d01a8c01f..3113a7d2af 100644 --- a/include/glib-compat.h +++ b/include/glib-compat.h @@ -46,9 +46,9 @@ * int g_foo(const char *wibble) * * We must define a static inline function with the same signature that does - * what we need, but with a "_qemu" suffix e.g. + * what we need, but with a "_compat" suffix e.g. * - * static inline void g_foo_qemu(const char *wibble) + * static inline void g_foo_compat(const char *wibble) * { * #if GLIB_CHECK_VERSION(X, Y, 0) * g_foo(wibble) @@ -61,7 +61,7 @@ * ensuring this wrapper function impl doesn't trigger the compiler warning * about using too new glib APIs. Finally we can do * - * #define g_foo(a) g_foo_qemu(a) + * #define g_foo(a) g_foo_compat(a) * * So now the code elsewhere in QEMU, which *does* have the * -Wdeprecated-declarations warning active, can call g_foo(...) as normal,