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

Re: [XEN PATCH 4/5] x86/x86_emulate: change parameter name from 's' to 'state'


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 6 Jul 2023 08:40:08 +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=W1bAXBIljCermuSp5k0xbELbiX6Vm0XgYNfSgB3Om90=; b=igwPotojeLX0fNKSOgkGdChXGrC6uFrOqJ9SWxRiXC1rQYTVYDp8icsVkoxlyr22Nmcw5w2XiqJii4RJWsFebRJzpM0lxBKWtMmsuU1XmnprJl+IOnyUHETKDqqghoVn2maacQjVexcaw+CUVoVfxAAxYvwU7KPNUDoHnv/eVPuvgTU3RH3NVBaMQX3Y3XBPMI6tzuqcVO/K0vmlUUNfehuaw3+pc70fzfwmxY/xnUjO+F08eOVTb5upXY/abVJUAY+bQF1Q4CNXOeaaOs8Q/iJ+mWAjhGvXOu3n9K4GUE2qL5dm5laWIMRoYEkVFE09tq7eMMdbGXRPqqbJOHzylQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=drJ+2L/69BDEbUsgdqrqwhS0Roi8duIxv6n0r+tXhFqv6poxyKm5ULBqC6noV+SLleS2sWw2kgcOYFay3GZGCZQQlJ1NF6S+tko/E7AnCwQX6QxE3g+6rzoOFsx27dSlfJCW3iaA7KEcTbgzJ9wGBpeEaRw6kHHYqgvAWao83ZMlg/51XneFj2AFjNb3dgxfA0hAUIfS01RfMc2eI28gVNOrI2VEZItJ5YfMLdsqEuJPTOQo10692ILivme/EIql6F6Mz6DGl+RxMA1Lw8sc4mEJB+6Xehxxf7a6omvivYjttW97M7uLfikGWIBgvs+YVNquJ1SCcrU4N7sQIoGZZw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Federico Serafini <federico.serafini@xxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, consulting@xxxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Xenia Ragiadakou <xenia.ragiadakou@xxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Delivery-date: Thu, 06 Jul 2023 06:40:27 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.07.2023 00:49, Stefano Stabellini wrote:
> On Tue, 4 Jul 2023, Jan Beulich wrote:
>> On 29.06.2023 21:31, Stefano Stabellini wrote:
>>> On Thu, 29 Jun 2023, Federico Serafini wrote:
>>>> Change parameter name from 's' to 'state' in function definitions in
>>>> order to:
>>>> 1) keep consistency with the parameter names used in the corresponding
>>>>    declarations;
>>>> 2) keep consistency with parameter names used within x86_emulate.h;
>>>> 3) fix violations of MISRA C:2012 Rule 8.3.
>>>>
>>>> Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx>
>>>
>>> You could use x86emul: as tag in the title. I'll let Jan choose the tag
>>> he prefers.
>>
>> x86emul: or x86/emul: is what we commonly use. That said, I don't like
>> this change. The files touched are pretty new, and it was deliberate
>> that I used s, not state, for the names. This is shorthand much like
>> (globally) we use v (instead of vcpu) and d (instead of domain).
> 
> Are you suggesting that the functions changed in this patch should be
> adapted in the other direction instead?  Meaning that the declaration is
> changed to match the definition instead of the opposite?
> 
> If so, are you referring to all the functions changed in this patch? Or
> only some?

All of the files touched here are ones which were recently introduced,
and which are deliberately the way they are. This "deliberately" really
goes as far as declarations and definitions disagreeing in names: For
the former, what matters are adjacent declarations in the header. For
the latter what matters is code readability. I'm sorry, I think the
Misra rule simply gets in the way of the original intentions here (and
I continue to disagree with there being any confusion from name
mismatches between declarations and definitions, the more that in the
case here it would be easy to avoid by simply omitting names in
declarations, but that is violating yet another rule I don't fully
agree with either, as voiced when discussing it).

My preferred course of action here would be to simply drop the patch.
The least bad adjustment, if one is absolutely necessary, would be to
change the declarations, but then in a way that all adjacent ones
remain consistent (which may in turn require some _other_ definitions
to change). The mid- to long-term goal certainly is to use "s" more
where "state" may be used right now.

Jan



 


Rackspace

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