Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp24911ybl; Tue, 13 Aug 2019 15:08:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwecZj/WRCRsDvqyONBWfTcqvXIACVRSdY0z+y9nYYPCDH3kHczzlal3Gx+ppwv2NnOMGBR X-Received: by 2002:a17:902:9a85:: with SMTP id w5mr39494299plp.221.1565734132996; Tue, 13 Aug 2019 15:08:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565734132; cv=none; d=google.com; s=arc-20160816; b=G15VGleCGjmpy5ax+DMkybBvo1b7aRnjHI1jYmLAOSshRFOjZCgsi5MEx1KLZolX7z /3INhtfjTJwsPZeYmZO3oX42LgbKTOU6dv+gbRCeEtNqp1Kc9RO+eq/DlKUs9moodsfH nClyR2Zd8GQl3ThRYLnOAZSrt8IoAxY7dfe3PutZoG1AFtLoPbFoE0boQv8MbdUTHazZ Fz7nc3eIVTc4FWA9Y6NeWvjSP0nJ0q9/EW6ldcaKGihW88bKr04EJ93zQ962UR+GzFcw iyMS7O3cPY6rC2ERvE8aRkFeXfplCwhL0swcg+J/GZvbqpHj1OnGiCS/XTtMWDSH/zvP u3tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Gr55UBQP2wuz3FrXlTHgGeZcDPe/979tbfRNDo2BHq8=; b=k1HhE8eM/NbS3x3dp4Helq6bRpDUOVwjEcdyjLerKItRwcbXZz/bQ/gsqi2AOl23RD QJloU/afgjcAN3+IKPQnI2DGtLTd2SfDVUrYQUd/RGqai+bdsX0pMwOI09XGhAHk19eM bZrA++SNQR3Co3ELlfGCDxJodpmE+G3N8ce6Bd1N9wJNu+BxyYw4csh9mA4rI/bfPGhL fVkRw/8xjVzuoZ/osylMcb0YPm2c0TfVhk8rhhA6CP5SNQecg3mdh2aTefgSPFTLgGyG U1QZYhPjQYGhHUfPzSiTE5cVYZwn0OlxsL8T0QOM12SmkG66oqqjw01mY2VmOf1LMwsj 0FgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i24si70048997pgh.224.2019.08.13.15.08.37; Tue, 13 Aug 2019 15:08:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726838AbfHMWH2 (ORCPT + 99 others); Tue, 13 Aug 2019 18:07:28 -0400 Received: from ms.lwn.net ([45.79.88.28]:45646 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726677AbfHMWH1 (ORCPT ); Tue, 13 Aug 2019 18:07:27 -0400 Received: from lwn.net (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id 2C218738; Tue, 13 Aug 2019 22:07:27 +0000 (UTC) Date: Tue, 13 Aug 2019 16:07:26 -0600 From: Jonathan Corbet To: Sam Ravnborg Cc: Jonathan =?UTF-8?B?TmV1c2Now6RmZXI=?= , Mauro Carvalho Chehab , dri-devel@lists.freedesktop.org, Maxime Ripard , linux-kernel@vger.kernel.org, David Airlie , Sean Paul Subject: Re: Best practice for embedded code samles? [Was: drm/drv: Use // for comments in example code] Message-ID: <20190813160726.3f9eb8c8@lwn.net> In-Reply-To: <20190811213215.GA26468@ravnborg.org> References: <20190808163629.14280-1-j.neuschaefer@gmx.net> <20190811213215.GA26468@ravnborg.org> Organization: LWN.net MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 11 Aug 2019 23:32:15 +0200 Sam Ravnborg wrote: > I wonder if there is a better way to embed a code sample > than reverting to // style comments. > > As the kernel do not like // comments we should try to avoid them in > examples. If you're embedding a code sample *into a code comment* then I suspect this is about as good as it gets. The alternative is to put it in as a plain literal text block. That would lose the syntax highlighting; I think that's an entirely bearable cost, but others seem to feel differently about it. Thanks, jon