[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] docs/misra: add Rule 5.1


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 26 May 2022 11:40:05 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=W61iktpzTnKmgSm6nbbdsEvacfyQfreBrED76hKaPIQ=; b=DKEKM2S1dOu20JEj8KXOhRABxBnefKV6nZi7D4ZnIjciKDVHDgzGJgRsk4OFTP+O6aEQw2tenmo2PL6LEqqSPRax0F822Ai/Ausa7pUzdIZswWIzig6MP/cBq6baMVO8y1MqGdIx/SW27aB1dujUd72Z6SiiVJSZ021tymUtnb6lZIqFtnAHGXhoUj6KGYj6zx0yo8jhjKyhBRVNQOQbLwg0VhosyBKMA9Pl1uQp4Ngi37XeFLG1c4vPfWr17ZK+TZl19X9rYhUObWi1NawQhUV2U4ctXQconrcJ0N/E4UsEAstPgcAHxZuzpxEYAo3BCtD6zAqI+nbZWBXe+xWj5A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=B+2zil9uEW4JN0btdLIbMXpdG1f4L9l0E2rBjW14uYTm6BhM4YmxpBHjHQbp5AzmKbemNUgNFtMynLYCtbjkDW5FLnLDA4ldsoXpH4gvS1uGJBXGYnIZrqx9I1zHBg826YJPN5C79EGGh8FtJQTG6OFo5d94E7FsPKw6SiCR0oR85Zmop75dI2f3FUJtZuZXrga4LnB70wJLtuGuSpnOoE2QBQhg0e5xBZpsVIt1Zyx4iUQyPq6bCZng/pARNqhA5EljyDn4PP5UD6ZV/IHmj7pIlm9bNHbJVveIK0I0uNjNgXOBgRE+hYZ/O6c3/Ysh/dWrHZAtBU4xQGPlB8qqGg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: andrew.cooper3@xxxxxxxxxx, roger.pau@xxxxxxxxxx, julien@xxxxxxx, Bertrand.Marquis@xxxxxxx, George.Dunlap@xxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 26 May 2022 09:40:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 26.05.2022 03:18, Stefano Stabellini wrote:
> On Wed, 25 May 2022, Jan Beulich wrote:
>> On 25.05.2022 02:35, Stefano Stabellini wrote:
>>> From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
>>>
>>> Add Rule 5.1, with the additional note that the character limit for Xen
>>> is 63 characters.
>>>
>>> The max length identifiers found by ECLAIR are:
>>>
>>> __mitigate_spectre_bhb_clear_insn_start
>>> domain_pause_by_systemcontroller_nosync
>>>
>>> Both of them are 40 characters long. A limit of 63 characters work for
>>> the existing code.
>>
>> I have to admit that it hasn't become clear to me why we want to
>> permit (if not to say encourage) the use of such long identifiers.
>> If 40 is the longest we've got, why not limit it to 40 for now
>> with a goal of further reducing? A 40-char symbol plus some
>> indentation will already pose problems with 80-char line length.
>  
> We can go lower than 63 if we want to. I chose the closest power-of-two
> length -1 for the NUL terminator. But it doesn't have to be a
> power-of-two. So we could go with "41" if we want to.
> 
> Anyone in favor of that? I am happy with any number between 41 and 63.

Why 41, not 40? 41 seems yet more arbitrary to me than e.g. 40.

>> Otoh, as said on the call, I think the public headers want
>> mentioning explicitly here in some way. Part of them (most or all
>> of what's under io/) aren't used when building Xen, so won't be
>> seen by Eclair (aiui). Yet they are a formal part of the code
>> base, and e.g. ring.h has some pretty long names (albeit still
>> below 40 chars as it looks). So once we're able to go down to e.g.
>> 32 for the bulk of the code base, public headers should imo still
>> be explicitly allowed to use longer identifiers.
> 
> Actually I thought about writing something for the public header but I
> wasn't sure what to write. What about:
> 
> - Note: the Xen characters limit for identifiers is 41. Public headers
>   (xen/include/public/) are allowed to retain longer identifiers for
>   backward compatibility.

Fine with me, except I wonder in how far going forward we actually
need to play by that limit there. Proper name-spacing is particularly
important in the public headers, so may warrant a higher limit for
certain (unusual?) circumstances.

Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.