{"id":809620,"url":"http://patchwork.ozlabs.org/api/patches/809620/?format=json","web_url":"http://patchwork.ozlabs.org/project/fwts/patch/20170904120920.5932-1-colin.king@canonical.com/","project":{"id":24,"url":"http://patchwork.ozlabs.org/api/projects/24/?format=json","name":"Firmware Test Suite development","link_name":"fwts","list_id":"fwts-devel.lists.ubuntu.com","list_email":"fwts-devel@lists.ubuntu.com","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170904120920.5932-1-colin.king@canonical.com>","list_archive_url":null,"date":"2017-09-04T12:09:20","name":"lib: constify a couple of arrays","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"d12dca4bfe1442e80da42555440940a9e4457d29","submitter":{"id":2900,"url":"http://patchwork.ozlabs.org/api/people/2900/?format=json","name":"Colin Ian King","email":"colin.king@canonical.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/fwts/patch/20170904120920.5932-1-colin.king@canonical.com/mbox/","series":[{"id":1362,"url":"http://patchwork.ozlabs.org/api/series/1362/?format=json","web_url":"http://patchwork.ozlabs.org/project/fwts/list/?series=1362","date":"2017-09-04T12:09:20","name":"lib: constify a couple of arrays","version":1,"mbox":"http://patchwork.ozlabs.org/series/1362/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/809620/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809620/checks/","tags":{},"related":[],"headers":{"Return-Path":"<fwts-devel-bounces@lists.ubuntu.com>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com\n\t(client-ip=91.189.94.19; helo=huckleberry.canonical.com;\n\tenvelope-from=fwts-devel-bounces@lists.ubuntu.com;\n\treceiver=<UNKNOWN>)","Received":["from huckleberry.canonical.com (huckleberry.canonical.com\n\t[91.189.94.19])\n\tby ozlabs.org (Postfix) with ESMTP id 3xm7tq4RFCz9s82;\n\tMon,  4 Sep 2017 22:09:23 +1000 (AEST)","from localhost ([127.0.0.1] helo=huckleberry.canonical.com)\n\tby huckleberry.canonical.com with esmtp (Exim 4.86_2)\n\t(envelope-from <fwts-devel-bounces@lists.ubuntu.com>)\n\tid 1doqBu-0003t9-Bc; Mon, 04 Sep 2017 12:09:22 +0000","from youngberry.canonical.com ([91.189.89.112])\n\tby huckleberry.canonical.com with esmtps\n\t(TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128)\n\t(Exim 4.86_2) (envelope-from <colin.king@canonical.com>)\n\tid 1doqBt-0003t2-60\n\tfor fwts-devel@lists.ubuntu.com; Mon, 04 Sep 2017 12:09:21 +0000","from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost)\n\tby youngberry.canonical.com with esmtpsa\n\t(TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.76) (envelope-from <colin.king@canonical.com>)\n\tid 1doqBs-0005h7-SE; Mon, 04 Sep 2017 12:09:20 +0000"],"From":"Colin King <colin.king@canonical.com>","To":"fwts-devel@lists.ubuntu.com","Subject":"[PATCH] lib: constify a couple of arrays","Date":"Mon,  4 Sep 2017 13:09:20 +0100","Message-Id":"<20170904120920.5932-1-colin.king@canonical.com>","X-Mailer":"git-send-email 2.14.1","MIME-Version":"1.0","X-BeenThere":"fwts-devel@lists.ubuntu.com","X-Mailman-Version":"2.1.20","Precedence":"list","List-Id":"Firmware Test Suite Development <fwts-devel.lists.ubuntu.com>","List-Unsubscribe":"<https://lists.ubuntu.com/mailman/options/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=unsubscribe>","List-Archive":"<https://lists.ubuntu.com/archives/fwts-devel>","List-Post":"<mailto:fwts-devel@lists.ubuntu.com>","List-Help":"<mailto:fwts-devel-request@lists.ubuntu.com?subject=help>","List-Subscribe":"<https://lists.ubuntu.com/mailman/listinfo/fwts-devel>,\n\t<mailto:fwts-devel-request@lists.ubuntu.com?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"fwts-devel-bounces@lists.ubuntu.com","Sender":"\"fwts-devel\" <fwts-devel-bounces@lists.ubuntu.com>"},"content":"From: Colin Ian King <colin.king@canonical.com>\n\nSince these arrays are read-only and static we can also constify them too.\n\nSigned-off-by: Colin Ian King <colin.king@canonical.com>\n---\n src/lib/src/fwts_log.c  | 2 +-\n src/lib/src/fwts_uefi.c | 4 ++--\n 2 files changed, 3 insertions(+), 3 deletions(-)","diff":"diff --git a/src/lib/src/fwts_log.c b/src/lib/src/fwts_log.c\nindex 13d5f6ca..1660ae2a 100644\n--- a/src/lib/src/fwts_log.c\n+++ b/src/lib/src/fwts_log.c\n@@ -221,7 +221,7 @@ fwts_log_field fwts_log_str_to_field(const char *text)\n {\n \tint i;\n \n-\tstatic struct mapping {\n+\tstatic const struct mapping {\n \t\tchar *text;\n \t\tfwts_log_field field;\n \t} mappings[] = {\ndiff --git a/src/lib/src/fwts_uefi.c b/src/lib/src/fwts_uefi.c\nindex 1f9d31fa..263bd657 100644\n--- a/src/lib/src/fwts_uefi.c\n+++ b/src/lib/src/fwts_uefi.c\n@@ -425,7 +425,7 @@ int fwts_uefi_get_variable_names(fwts_list *list)\n         return ret;\n }\n \n-static uefistatus_info uefistatus_info_table[] = {\n+static const uefistatus_info uefistatus_info_table[] = {\n \t{ EFI_SUCCESS,\t\t\t\"EFI_SUCCESS\",\t\t\t\"The operation completed successfully.\" },\n \t{ EFI_LOAD_ERROR,\t\t\"EFI_LOAD_ERROR\",\t\t\"The image failed to load.\" },\n \t{ EFI_INVALID_PARAMETER,\t\"EFI_INVALID_PARAMETER\",\t\"A parameter was incorrect.\" },\n@@ -466,7 +466,7 @@ static uefistatus_info uefistatus_info_table[] = {\n void fwts_uefi_print_status_info(fwts_framework *fw, const uint64_t status)\n {\n \n-\tuefistatus_info *info;\n+\tconst uefistatus_info *info;\n \n \tfor (info = uefistatus_info_table; info->mnemonic != NULL; info++) {\n \t\tif (status == info->statusvalue) {\n","prefixes":[]}