Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp4678964ybn; Sat, 28 Sep 2019 05:34:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvYDoKVyiAAPyYSSJJelpUhPliTCK7ajCpMTCgAUjq7P3jR5dvsNGCimIJAsZTqLJQ3PfO X-Received: by 2002:a17:906:11c3:: with SMTP id o3mr11997005eja.297.1569674053658; Sat, 28 Sep 2019 05:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569674053; cv=none; d=google.com; s=arc-20160816; b=FVxaUeN3j7PI/09DyewASTZfPg8e4Q6cUCCKB+byqZ9LEG198SvFsKAitJ3cppCfx0 llUf0YfizwqSJGDYTYl4Ej7lfkTWTS4GX7maAJpY76kMNni3OUHTSndtssO4RQZkx+q/ O2feEuSNcr7o9DtUHaOfyxT7kKra8Qon3YEVsnMkU85M1f2qW9N8NVarAr42y5rT1RXn JMfxr9WXvsI7crs7nnHLDAC9eFMzd+9eZ+9eB+y8wxtzNefjzH0vmhvvAOJH4EZGFeDE VnqMZq+KlE8SgvfgLCYoV+fthFBqqQez8ENjfCyhO2rQsmkQFXoGLNfLSf99OnK/WjPw qGHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=Dglk6lNuABzootfdmf5RgAJW7+y1FrWEJ/tsGFGZWrw=; b=cxPrmrH5y9KDWePEbunKwDWEE9IiR0vH7ntzzNJaB/Gkgz1nuETyQMvJwTCdGZbdcH aQWmSyaDtoIHJHDlBTooqYmqQ+o6X2AhkrhbmNHA/SAcXpT+eBooo8LeXJ3sicET7N9E BEElTcuWL5fkAtcra4q05GMgCj7yNpGJLN4nuuvo9y8OyfH4tuLLhXN3ZaBeoX7LtFz3 +oyGdLYBC85RGEQOoQEr0iJ6agupZnTnTPW850nSLK9z47nyH3vC64tq0l/kmhekBIbS nCepkiT6EXy58Gw1DVDrkEjX54J0vwWhSJXhZKicvoF37WF50oRyHgl82ozrWWQYZ/1x yA2Q== 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 c54si3500133edb.230.2019.09.28.05.33.39; Sat, 28 Sep 2019 05:34:13 -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 S1726450AbfI1Mdf (ORCPT + 99 others); Sat, 28 Sep 2019 08:33:35 -0400 Received: from 2.mo6.mail-out.ovh.net ([46.105.76.65]:43511 "EHLO 2.mo6.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725932AbfI1Mdf (ORCPT ); Sat, 28 Sep 2019 08:33:35 -0400 Received: from player731.ha.ovh.net (unknown [10.109.159.132]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id 0E0AF1E240D for ; Sat, 28 Sep 2019 10:55:34 +0200 (CEST) Received: from sk2.org (gw.sk2.org [88.186.243.14]) (Authenticated sender: steve@sk2.org) by player731.ha.ovh.net (Postfix) with ESMTPSA id 6DB3AA260E0B; Sat, 28 Sep 2019 08:55:23 +0000 (UTC) Date: Sat, 28 Sep 2019 10:55:57 +0200 From: Stephen Kitt To: Jonathan Corbet Cc: linux-doc@vger.kernel.org, bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-can@vger.kernel.org, linux-afs@lists.infradead.org, kvm@vger.kernel.org, "Gustavo A . R . Silva" Subject: Re: [PATCH] docs: use flexible array members, not zero-length Message-ID: <20190928105557.221fb119@heffalump.sk2.org> In-Reply-To: <20190928011639.7c983e77@lwn.net> References: <20190927142927.27968-1-steve@sk2.org> <20190928011639.7c983e77@lwn.net> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/6lwZ.M0KIAOHFlu0tCvHt6N"; protocol="application/pgp-signature" X-Ovh-Tracer-Id: 2307531860306840965 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedufedrfeekgddtlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/6lwZ.M0KIAOHFlu0tCvHt6N Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sat, 28 Sep 2019 01:16:39 -0600, Jonathan Corbet wrote: > On Fri, 27 Sep 2019 16:29:27 +0200 > Stephen Kitt wrote: > > diff --git a/Documentation/bpf/btf.rst b/Documentation/bpf/btf.rst > > index 4d565d202ce3..24ce50fc1fc1 100644 > > --- a/Documentation/bpf/btf.rst > > +++ b/Documentation/bpf/btf.rst > > @@ -670,7 +670,7 @@ func_info for each specific ELF section.:: > > __u32 sec_name_off; /* offset to section name */ > > __u32 num_info; > > /* Followed by num_info * record_size number of bytes */ > > - __u8 data[0]; > > + __u8 data[]; > > }; =20 >=20 > I only checked this one, but found what I had expected: the actual > definition of this structure (found in tools/lib/bpf/libbpf_internal.h) > says "data[0]". We can't really make the documentation read the way we > *wish* the source would be, we need to document reality. >=20 > I'm pretty sure that most of the other examples will be the same. Aargh, yes, of course, thanks for checking! I was locked in a =E2=80=9Cpres= criptive=E2=80=9D documentation mode, but this type of documentation has to be descriptive since it=E2=80=99s documenting shared structures, not structures which deve= lopers have to write. > If you really want to fix these, the right solution is to fix the offendi= ng > structures =E2=80=94 one patch per structure =E2=80=94 in the source, the= n update the > documentation to match the new reality. Yes. I have a Coccinelle script which takes care of the code, but it doesn= =E2=80=99t work for docs ;-). Wouldn=E2=80=99t it be better to update the docs simultaneously in each pat= ch which fixes a structure? Or is that unworkable with current development practices? Regards, Stephen --Sig_/6lwZ.M0KIAOHFlu0tCvHt6N Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEnPVX/hPLkMoq7x0ggNMC9Yhtg5wFAl2PIB4ACgkQgNMC9Yht g5zsMRAAlq0QqSRyK8SmkZrHHi9ZrsTUhy9uZ0IHYFiFaDl5/P9JHqCOMgWCqjLI vjR/pTj6+Gc1h/87XgrOoWt72eqGmkP5TfqRFfrMmgTKyabiqnXjrhEEy/JpEegp wI1qjOrs/y2gWacnVssUmbrprK7dZWQ9DxSA5glafzxWyZgLgT5dEGCQKdHQX+1v QdYG7wZChDSuVUFxVryqIJM0zKGrOhbSlj3xHSGLDZa6+k6pvM+Sv+i7de0EJHkZ qssPQCsxIXBvS0Md1f1NqHS5K+7y4inCoh3U88A/YfEw2zPH7CwGXo+NrD8ihKkp aSAPICVP+ei48uuj8zGZcoCrCql7BiKSNgiTgguu3VZQ9+lIkzGuuidw84RcI4BU OHo3sKz1HE9+QeMowg0QcEpE5RJflJDMb/9PFciMkpSjFTOAZHQvvA8zZkLjVm2Y kSVmIoYAtGKb7PxqwBmZYyWGaHS090pie8PrdGAfo/KJPSHzPlK8ZnEwZJqGb2Ko GUyw/xNFefziyA35xSptguK4K4sSsIeD+Z5+Vt6xvyATEf5PS+9pQsKL3uxczUEV 2WDYg6SXW2CU2nEpkGndHIQPcQSKZE2hASRwL7dtl89nM5tgviYAfOWdo1eBje0Q HkXRsGAUe6tlnlUDBjYa4VYLJMZS5vYTjY551oHzlfMmGQErvQM= =rxn4 -----END PGP SIGNATURE----- --Sig_/6lwZ.M0KIAOHFlu0tCvHt6N--