From nobody Mon Feb 9 18:46:40 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1637247464; cv=none; d=zohomail.com; s=zohoarc; b=Pt4zoXQRvus+KrgvicWsDr5XFRwQ/IA52vHqxMdKjruma9ANK0IBnohdncl+U0b4kSFOLcK/Y2WB1NiWsEFDj3Q4hfTrOkVmQu+M/X/ITRdKOWyjowjEwL0Kgy+nkYrWZvrOeYnLD43Bmuc9qY64+0LagWYVhKiV9VkRzKh6qB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1637247464; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=995klPDX33rmzvSoWGVJ6V1EGfWuQDmUmdzVzSbmtDc=; b=LjJXfpYtlglzcEFO4CKfKMNyFn+Al9anAOY1fQ6bSVD51Snajaj9MDgbz58VInwb+lK+LzhAU2iRwAm2O/77LF1LSjWnmTlYmjR5x5RsjW3x8OygG9wiRykzJgMtWXn9mvjuv2GXV+t3v3fx0AzqtZkmcqZhhvYkK/9p/FVW2UY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1637247464521856.4706760222874; Thu, 18 Nov 2021 06:57:44 -0800 (PST) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-540-d-tvIO6hOgKFAQay9Jx4Jg-1; Thu, 18 Nov 2021 09:57:40 -0500 Received: by mail-wm1-f72.google.com with SMTP id j193-20020a1c23ca000000b003306ae8bfb7so2691608wmj.7 for ; Thu, 18 Nov 2021 06:57:40 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (62.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.62]) by smtp.gmail.com with ESMTPSA id q123sm9051755wma.30.2021.11.18.06.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Nov 2021 06:57:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1637247463; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=995klPDX33rmzvSoWGVJ6V1EGfWuQDmUmdzVzSbmtDc=; b=OA5rWNVVqGYNzy8W6XMXi9QRTl1evtFNQizwJBsGJScJCtsJhnXQ/XLRCHbb+QL3aWFGhS Hid4NM2BVMhIsir+ZP2MftUBaWh+zzvTwmaiPq746tYN1YKMts/QLiAXdCoNZrclTohfv5 QcjeBR95RntmS+E9BcuYMIGj3IM+u+g= X-MC-Unique: d-tvIO6hOgKFAQay9Jx4Jg-1 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=995klPDX33rmzvSoWGVJ6V1EGfWuQDmUmdzVzSbmtDc=; b=kd392eA1z70QKASFSJmEZ/Xkc43cspPDssapg9vK4cI0ZB24UXf4PL33navA9HwoJ0 L/+fwC8bYPacsZnpbyJyV27tvjxYmN0KBwtkgeBA4tM290NUBnFfi4cEN2ZN/+0HimR0 B1OC4MMi2ZrOGCz2suUj9Lk+7zMfrhd1SOyRcxalVO+H0tbmZKcMjpTukUYhCv0dXjGL Nte4aXcquvIK+c3bIOsxhGNxyBfw4oitFi2yzIH78BTb+8zS/Dnnt0a0CU+OE49xUUXE Og51bINGRV9OfRubHqM0GbmJeYAePYWt2nShh2BvhyeGFqV+Ojn8rJ1/3PMn4nm7L7p7 G6JA== X-Gm-Message-State: AOAM530sPk3cxFegUL3qcN99YD6u6ehfzZbq/yEkUo3FObifK3OHoTQU AUU3qx5VrxaudWNYAaGPtFsuYEAGpLlqBJ068gilDNoWaIxWXAnoIM1A4zNIylPLC6GQuQNSVxr FsKqIoDt0CQ1Ixg== X-Received: by 2002:adf:ce0e:: with SMTP id p14mr31229414wrn.423.1637247459394; Thu, 18 Nov 2021 06:57:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyzA9z6QrKZQxNpKCdTMNZz5Kdu7G0oiAbK9lXyLgLEfb7M5V6ubx7stOrU/w/u2ubttfOFqQ== X-Received: by 2002:adf:ce0e:: with SMTP id p14mr31229388wrn.423.1637247459149; Thu, 18 Nov 2021 06:57:39 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , Peter Maydell , Darren Kenny , "Daniel P . Berrange" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-6.2? v2 5/5] docs/devel/style: Misc rST rendering improvements Date: Thu, 18 Nov 2021 15:57:16 +0100 Message-Id: <20211118145716.4116731-6-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211118145716.4116731-1-philmd@redhat.com> References: <20211118145716.4116731-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1637247465747100001 Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alex Benn=C3=A9e --- docs/devel/style.rst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/devel/style.rst b/docs/devel/style.rst index 0397971e528..1db50b70544 100644 --- a/docs/devel/style.rst +++ b/docs/devel/style.rst @@ -4,7 +4,7 @@ QEMU Coding Style =20 .. contents:: Table of Contents =20 -Please use the script checkpatch.pl in the scripts directory to check +Please use the script ``checkpatch.pl`` in the scripts directory to check patches before submitting. =20 Formatting and style @@ -195,9 +195,9 @@ blocks) are generally not allowed; declarations should = be at the beginning of blocks. =20 Every now and then, an exception is made for declarations inside a -#ifdef or #ifndef block: if the code looks nicer, such declarations can +``#ifdef`` or ``#ifndef`` block: if the code looks nicer, such declaration= s can be placed at the top of the block even if there are statements above. -On the other hand, however, it's often best to move that #ifdef/#ifndef +On the other hand, however, it's often best to move that ``#ifdef/#ifndef`` block to a separate function altogether. =20 Conditional statements @@ -220,13 +220,13 @@ even when the constant is on the right. Comment style =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -We use traditional C-style /``*`` ``*``/ comments and avoid // comments. +We use traditional C-style ``/* */`` comments and avoid ``//`` comments. =20 -Rationale: The // form is valid in C99, so this is purely a matter of +Rationale: The ``//`` form is valid in C99, so this is purely a matter of consistency of style. The checkpatch script will warn you about this. =20 Multiline comment blocks should have a row of stars on the left, -and the initial /``*`` and terminating ``*``/ both on their own lines: +and the initial ``/*`` and terminating ``*/`` both on their own lines: =20 .. code-block:: c =20 @@ -274,11 +274,11 @@ Order include directives as follows: #include "..." /* and finally QEMU headers. */ =20 The "qemu/osdep.h" header contains preprocessor macros that affect the beh= avior -of core system headers like . It must be the first include so t= hat -core system headers included by external libraries get the preprocessor ma= cros -that QEMU depends on. +of core system headers like ````. It must be the first include = so +that core system headers included by external libraries get the preprocess= or +macros that QEMU depends on. =20 -Do not include "qemu/osdep.h" from header files since the .c file will have +Do not include ``"qemu/osdep.h"`` from header files since the .c file will= have already included it. =20 C types @@ -352,9 +352,9 @@ casts, then reconsider or ask for help. Pointers -------- =20 -Ensure that all of your pointers are "const-correct". +Ensure that all of your pointers are "``const``-correct". Unless a pointer is used to modify the pointed-to storage, -give it the "const" attribute. That way, the reader knows +give it the '``const``' attribute. That way, the reader knows up-front that this is a read-only pointer. Perhaps more importantly, if we're diligent about this, when you see a non-const pointer, you're guaranteed that it is used to modify the storage @@ -505,7 +505,7 @@ painful. These are: the sign bit (ie it is an arithmetic shift, not a logical shift) =20 In addition, QEMU assumes that the compiler does not use the latitude -given in C99 and C11 to treat aspects of signed '<<' as undefined, as +given in C99 and C11 to treat aspects of signed '``<<``' as undefined, as documented in the GNU Compiler Collection manual starting at version 4.0. =20 .. _autofree-ref: --=20 2.31.1