summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Singer <felix.singer@secunet.com>2020-10-13 17:27:19 +0200
committerNico Huber <nico.h@gmx.de>2020-10-17 16:33:06 +0000
commitd2ec82d137448dc9b851d2d60b715fabdc6e78ec (patch)
treef5500dfa55227b7783b7a18863ad555f34037e92
parente1194ae6b6b9b02371d1e9e9c3b00aa658f30213 (diff)
downloadcoreboot-d2ec82d137448dc9b851d2d60b715fabdc6e78ec.tar.xz
libpayload/libpci: Clean up pci_alloc()
Clean up pci_alloc() and return pointer to allocated memory directly. Change-Id: Ib2ee8dbfaabbf7a824b4fd75ad7c779393af2900 Signed-off-by: Felix Singer <felix.singer@secunet.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/46345 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
-rw-r--r--payloads/libpayload/libpci/libpci.c3
1 files changed, 1 insertions, 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)