From patchwork Tue Jan 31 13:21:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 92980 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp1923334qgi; Tue, 31 Jan 2017 05:26:30 -0800 (PST) X-Received: by 10.84.176.1 with SMTP id u1mr39314057plb.71.1485869190565; Tue, 31 Jan 2017 05:26:30 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8si10801575pgd.294.2017.01.31.05.26.30; Tue, 31 Jan 2017 05:26:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752330AbdAaN00 (ORCPT + 2 others); Tue, 31 Jan 2017 08:26:26 -0500 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37020 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752220AbdAaN0G (ORCPT ); Tue, 31 Jan 2017 08:26:06 -0500 Received: by mail-wm0-f43.google.com with SMTP id v77so93364724wmv.0 for ; Tue, 31 Jan 2017 05:26:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZZke4etvapEowh1Z4IVIWU7YtcoZvz6d068RuujjCqU=; b=dAR5HqH6jlU3/G3qcy4WVRf5DPT9Le5zCmvF2d8w9qxeOUGhkPiC4UiwPm2PkvDxKW 9BY1YugLZzYpXQ981WE/XHIXWh1INk01P1xXHAEq3TWjq0NyheTvP9oHP3kw1DVI19At 61bCWMRkb1zu0TyNa8eDPXqYDlU/Hb6o8OxJc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZZke4etvapEowh1Z4IVIWU7YtcoZvz6d068RuujjCqU=; b=op0q9cNYJ6pt4oBFMEZYImTsYWjcRBk4RZSyQr52Zv3eFjCiDda0WOO9RKOKQRIxL2 +VKDG+JAe7oCHIqMSr3LFbeHbX/SmHEfjp+duolB0wRxAeCQiQbzli4v7v2HExF/1Dle 1ZWv0nPaLGFILusvhZ3Pz3bTjubHK3fXlNjAxezKmyeaiN8RsjHdO7vB6hhHYtdpMSJu bUMSou5G0PaCUoc34jEUzxU0VJJhdgz4iX/1t/iSf4perxOVhlegwfROJEOdyT6rMDfT lyklrDjlaxirSoOhid70w0PTMY5OR6jXiIyjOXIFtKAC/CshR9nhciGRoqBdWtd8a2si vUsA== X-Gm-Message-State: AIkVDXKCsFzFp06Lu56eGUFVZWsmjhRoi0vVSv13aUZjGC/lG7m6AdrEjdVpEht1jPkxsH5D X-Received: by 10.223.172.107 with SMTP id v98mr23743850wrc.77.1485869164622; Tue, 31 Jan 2017 05:26:04 -0800 (PST) Received: from localhost.localdomain ([105.130.17.13]) by smtp.gmail.com with ESMTPSA id i73sm23961714wmd.11.2017.01.31.05.26.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Jan 2017 05:26:04 -0800 (PST) From: Ard Biesheuvel To: linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner , "H . Peter Anvin" Cc: Ard Biesheuvel , linux-efi@vger.kernel.org Subject: [PATCH 07/10] efi: Use typed function pointers for runtime services table Date: Tue, 31 Jan 2017 13:21:39 +0000 Message-Id: <1485868902-20401-8-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485868902-20401-1-git-send-email-ard.biesheuvel@linaro.org> References: <1485868902-20401-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Instead of using void pointers, and casting them to correctly typed function pointers upon use, declare the runtime services pointers as function pointers using their respective prototypes, for which typedefs are already available. Reviewed-by: Matt Fleming Signed-off-by: Ard Biesheuvel --- include/linux/efi.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/efi.h b/include/linux/efi.h index b17f73113bd2..8c6e007a5408 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -509,24 +509,6 @@ typedef struct { u64 query_variable_info; } efi_runtime_services_64_t; -typedef struct { - efi_table_hdr_t hdr; - void *get_time; - void *set_time; - void *get_wakeup_time; - void *set_wakeup_time; - void *set_virtual_address_map; - void *convert_pointer; - void *get_variable; - void *get_next_variable; - void *set_variable; - void *get_next_high_mono_count; - void *reset_system; - void *update_capsule; - void *query_capsule_caps; - void *query_variable_info; -} efi_runtime_services_t; - typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); typedef efi_status_t efi_set_time_t (efi_time_t *tm); typedef efi_status_t efi_get_wakeup_time_t (efi_bool_t *enabled, efi_bool_t *pending, @@ -561,6 +543,24 @@ typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size, bool nonblocking); +typedef struct { + efi_table_hdr_t hdr; + efi_get_time_t *get_time; + efi_set_time_t *set_time; + efi_get_wakeup_time_t *get_wakeup_time; + efi_set_wakeup_time_t *set_wakeup_time; + efi_set_virtual_address_map_t *set_virtual_address_map; + void *convert_pointer; + efi_get_variable_t *get_variable; + efi_get_next_variable_t *get_next_variable; + efi_set_variable_t *set_variable; + efi_get_next_high_mono_count_t *get_next_high_mono_count; + efi_reset_system_t *reset_system; + efi_update_capsule_t *update_capsule; + efi_query_capsule_caps_t *query_capsule_caps; + efi_query_variable_info_t *query_variable_info; +} efi_runtime_services_t; + void efi_native_runtime_setup(void); /*