From d2ec82d137448dc9b851d2d60b715fabdc6e78ec Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Tue, 13 Oct 2020 17:27:19 +0200 Subject: libpayload/libpci: Clean up pci_alloc() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clean up pci_alloc() and return pointer to allocated memory directly. Change-Id: Ib2ee8dbfaabbf7a824b4fd75ad7c779393af2900 Signed-off-by: Felix Singer Reviewed-on: https://review.coreboot.org/c/coreboot/+/46345 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Michael Niewöhner --- payloads/libpayload/libpci/libpci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/payloads/libpayload/libpci/libpci.c b/payloads/libpayload/libpci/libpci.c index 27347e3bf8..3e3513ccb0 100644 --- a/payloads/libpayload/libpci/libpci.c +++ b/payloads/libpayload/libpci/libpci.c @@ -72,8 +72,7 @@ int pci_write_long(struct pci_dev *dev, int pos, u32 data) struct pci_access *pci_alloc(void) { - struct pci_access *pacc = malloc(sizeof(*pacc)); - return pacc; + return malloc(sizeof(struct pci_access)); } void pci_init(struct pci_access *pacc) -- cgit v1.2.3