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

Re: [PATCH] xen/ACPI: Remove the acpi_string type


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 14 Jul 2023 15:16:29 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=z/UviPzAr2Jb6nh5ZiFajggBrwubaESZiky78CfUFL0=; b=mW/ZUp091rcbBnHd9c5T4CbAldLv1ntZ5xDoTcORHIzvKnEzPB9cPuUL5WvC46wK7T/Jv5jjkzRHW8Bie0Fxp7kUx3ObuYCdfAhWbOQGsoSXigZFDJQO+ku06+kz1KUjOrwzM70xbPT4NwC8dkaOBmzhhY4QZZ3IA75T9UCYJcVcSabUO2pqy5aSTjqrB1srIZZJXHxIhEEvMJDWwcCn2vt7b1BxMLa9AJGX2/BTqam3JTLZMI3Cx3NZmYvVY9IS9HE1XDEDDKGvmRIqFDURBQUBX4SBfOEbz0gUEkkJOAKNY2qyEGT+quNUUHD17CH0onqrLgt0frOqvmvmDP9GIw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nKt90J/R28tEpJMUHcwXkZt4jPH4u/eXzjPX000lK2/0tKckzEH4+RLQJHn2CHH5fjhFsWfQLXx3XfROpcTb9Rp+aabspJyL6zcj9hk+opY9aNr1ZII1E8J5CLQe3pxMVciyZf4th2zbPGgQnpa1J/D5KUxjV9+LcmOzh18v5LSU+M51RTpyHUPcIqj5Ot7BzyYy7jSuRVAK/aus10yIQVxlGfBuM3x7djP9FUcHfrsQRwo/eALWld+eiEyKwLPyzwH+HF2ExtMWNS/znef/z3Qu0SJf9JdLlkl3SlR9TCWtuym9mnimesCkgzSpmNGxRsrWUTZjylj3vvcLswWf7A==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>
  • Delivery-date: Fri, 14 Jul 2023 14:17:05 +0000
  • Ironport-data: A9a23:TzGXuqyZ/hL0CNx/pnx6t+e7xyrEfRIJ4+MujC+fZmUNrF6WrkUBz jEbXDuPb62INzD8f9snYYW3o0kPuMXQyYA2Tgo9pSAxQypGp/SeCIXCJC8cHc8wwu7rFxs7s ppEOrEsCOhuExcwcz/0auCJQUFUjP3OHfykTrafYEidfCc8IA85kxVvhuUltYBhhNm9Emult Mj75sbSIzdJ4RYtWo4vw/zF8EoHUMja4mtC5QRhPKwT5TcyqlFOZH4hDfDpR5fHatE88t6SH 47r0Ly/92XFyBYhYvvNfmHTKxBirhb6ZGBiu1IOM0SQqkEqSh8ai87XAME0e0ZP4whlqvgqo Dl7WT5cfi9yVkHEsLx1vxC1iEiSN4UekFPMCSDXXcB+UyQq2pYjqhljJBheAGEWxgp4KWIX8 PInAzZdUjmKicGWwfW6UfdCl/12eaEHPKtH0p1h5RfwKK98BLzmHeDN79Ie2yosjMdTG/qYf 9AedTdkcBXHZVtIJ0sTD5U92uyvgxETcRUB8A7T+fVxvjmVlVMtuFTuGIO9ltiibMNZhEuH4 EnB+Hz0GEoyP92D0zuVtHmrg4cjmAuiAdxISuXhra8CbFu74DU6Vi1HfHKHj+SYml+6XPRxA A8M0397xUQ13AnxJjXnZDW+oXWDuhdaRddMCew86SmH16XP7gCWQGMDS1ZpeNEg8cM7WzEu/ luIhM/yQyxitqWPTnCQ/avSqim9UQA3B2IfYS4PTSMe/sLu5oo0i3rnVc1/GaS4itn0HzDYw D2QqiU6wbIJgqYjyKGT7V3BxTW2qfDhTBMx5wjRdnKo6EV+foHNT5av41XB8fEGJo+WSFCbt VAOhseF4eYBS5qKkUSwrP4lGbio47OJNWPaiFs2RZ05rW3ypzikYJxa5yx4KAFxKMEYdDT1Y UjV/wRM+JtUO3jsZqhyC26sN/kXIWHbPYyNfpjpghBmPvCdqCfvEPlSWHOt
  • Ironport-hdrordr: A9a23:3eusHq6YCAIktQ+JtgPXwOrXdLJyesId70hD6qkRc20xTiX8ra rCoB1173PJYVoqN03I4OrwX5VoIkmsl6Kdg7NwAV7KZmCPhILPFu9fBODZsl7d8kPFl9K14p 0QF5SWWOeaMbGjt7eB3OBjKadZ/DBbytHPuQ4D9QYXcei1UdAc0+8XYjzra3FLeA==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14/07/2023 2:44 pm, Nicola Vetrini wrote:
>
> On 14/07/23 15:04, Andrew Cooper wrote:
>> Typedef-ing a naked pointer like this an anti-pattern which is best
>> avoided.
>
> s/this an/this is an/
>
>> Furthermore, it's bad to pass a string literate in a mutable type. 
>> Delete the
>
> s/literate/literal/

Fixed, thanks.  And the 3rd typo below.

>
>> type entirely, and replace it with a plain 'const char *'.
>>
>> This highlights two futher bugs.  acpi_get_table() already had a
>> mismatch in
>> types between it's declaration and definition, and we have
>> declarations for
>> acpi_get_handle() and acpi_get_table_header() but no definition at
>> all (nor
>> any callers).
>>
>> This fixes violations of MISRA Rule 7.4:
>>
>>    A string literal shall not be assigned to an object unless the
>> object's type
>>    is "pointer to const-qualified char".
>>
>> and of Rule 8.3:
>>
>>    All declarations of an object or function shall use the same names
>> and type
>>    qualifiers.
>>
>> and of Rule 8.6:
>>
>>    An identifier with external linkage shall have exactly one external
>>    definition.
>
> The choice of rules looks good to me, but perhaps Roberto has some
> additional insight on this.

Thanks.

~Andrew



 


Rackspace

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