// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* * Copyright(c) 2015, 2016 Intel Corporation. */ #include <linux/string.h> #include <linux/string_helpers.h> #include "efivar.h" /* GUID for HFI1 variables in EFI */ #define HFI1_EFIVAR_GUID … /* largest EFI data size we expect */ #define EFI_DATA_SIZE … /* * Read the named EFI variable. Return the size of the actual data in *size * and a kmalloc'ed buffer in *return_data. The caller must free the * data. It is guaranteed that *return_data will be NULL and *size = 0 * if this routine fails. * * Return 0 on success, -errno on failure. */ static int read_efi_var(const char *name, unsigned long *size, void **return_data) { … } /* * Read an HFI1 EFI variable of the form: * <PCIe address>-<kind> * Return an kalloc'ed array and size of the data. * * Returns 0 on success, -errno on failure. */ int read_hfi1_efi_var(struct hfi1_devdata *dd, const char *kind, unsigned long *size, void **return_data) { … }