ACK: [PATCH 20/27] acpi: stao: add in missing const to fix build warnings
Alex Hung
alex.hung at canonical.com
Wed Aug 15 18:11:28 UTC 2018
On 2018-08-15 06:11 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Add in missing const, cleans up warnings.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/acpi/stao/stao.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/src/acpi/stao/stao.c b/src/acpi/stao/stao.c
> index 56df440b..537e364f 100644
> --- a/src/acpi/stao/stao.c
> +++ b/src/acpi/stao/stao.c
> @@ -50,12 +50,12 @@ static int stao_init(fwts_framework *fw)
> */
> static bool stao_acpi_string(
> fwts_framework *fw,
> - char *str,
> - char *end,
> + const char *str,
> + const char *end,
> bool *passed,
> size_t *len)
> {
> - char *ptr = str;
> + const char *ptr = str;
>
> while (*ptr) {
> if (ptr > end) {
> @@ -82,7 +82,7 @@ static int stao_test1(fwts_framework *fw)
> {
> const fwts_acpi_table_stao *stao = (const fwts_acpi_table_stao *)table->data;
> bool passed = true;
> - char *ptr, *end;
> + const char *ptr, *end;
> int strings = 0;
>
> if (stao->header.length > (uint32_t)table->length) {
> @@ -101,8 +101,8 @@ static int stao_test1(fwts_framework *fw)
> fwts_log_info_verbatim(fw, "STAO Status Override Table:");
> fwts_log_info_verbatim(fw, " UART: 0x%2.2" PRIx8, stao->uart);
>
> - ptr = (char *)stao->namelist;
> - end = (char *)table->data + stao->header.length;
> + ptr = (const char *)stao->namelist;
> + end = (const char *)table->data + stao->header.length;
>
> while (ptr < end) {
> size_t len;
> @@ -118,8 +118,8 @@ static int stao_test1(fwts_framework *fw)
> if (!strings)
> goto done;
>
> - ptr = (char *)stao->namelist;
> - end = (char *)table->data + table->length;
> + ptr = (const char *)stao->namelist;
> + end = (const char *)table->data + table->length;
>
> while (ptr < end) {
> bool found;
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list