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.coop...@citrix.com>

Acked-by: Jan Beulich <jbeul...@suse.com>



Reply via email to