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

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


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 14 Jul 2023 16:40:39 +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=s9xcCZ5bULcjU42W+HOvGot+c19JR3wgzQ1lNA+t24M=; b=IC3y1NIuKY4xOcatgLjjW/BAhylsByywPVUpqpXoQG+urC+NEGBEs2GXLkwZciE6/jd1wrrEpqtvgHWagA/FVw88qGt2ttN210Ma2VCY5sjpzjbXo7O2PhbKkwYzYqVigqGoT3JioG+1u8xnTEIxx8fQruJNWRQ8Zeg31qxseIPq9OMp0zRexCnJWWZHxM6nq7K3wQaUf5fbB8zlmRd211J4p72dZAOhFM3BMkS8SkI3WG4Jx+TFwADB0OKy1rD4Enp+V4+vwj/PG0v1ykOCKusz8eeJJS82Mq8ScugjZvgJSmp370HZu7nEdiPzVlUeyXGQ7/I8s7SqBgu4MFThQQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lH/6N6NI1YGBsBsHZgbln0EYwciZkBRewVvGWlDKiyf98wSTk/Y+6LKbG1pNLq7gZD3IsVoN9jmoF+IP29Nq+eWeIUk8AUPMjlmLqOaha+DhK09pCmiv3xr1W53aq2Ik7Y8XG4FONw5VPiI77IxEeEt/pRTsGhNG7KpalTQotbsQYNV/LWcBNA7IKzCtaNXIiIopkgAYoS/WZvJk3EzU+N/IgZbl75m3fU5NJHGHFJfjkrsarfguTcvAQll+NLFnszvg+XYJxbOlPIi+CsmNE+uQyeUhpMtWN5kfTD63b/fzh+GKlX3b+kWZKwMOXf2WSmYpHooP63AaIJEqHocXmg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 14 Jul 2023 14:41:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.07.2023 15:04, Andrew Cooper wrote:
> Typedef-ing a naked pointer like this an anti-pattern which is best avoided.
> Furthermore, it's bad to pass a string literate in a mutable type.  Delete the
> 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.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>





 


Rackspace

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