summaryrefslogtreecommitdiffstats
path: root/arch/riscv
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-07-13 11:57:29 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-07-14 10:27:41 +0200
commit845524484c298bf173d682b48dd456b147ad5a61 (patch)
treead4842aebb8d65d49c03cff48699da1c21806fbb /arch/riscv
parent92262f8709c5de9776d45ab49aca38ee41413b2c (diff)
downloadbarebox-845524484c298bf173d682b48dd456b147ad5a61.tar.gz
barebox-845524484c298bf173d682b48dd456b147ad5a61.tar.xz
pbl: compressed-dtb: use flexible array member to access data
While data = compressed_dtb + 1 has the equivalent effect of skipping over the struct barebox_boarddata_compressed_dtb header, using a flexible array member aids code readability, so use that instead. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220713095730.1878941-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/riscv')
-rw-r--r--arch/riscv/boot/start.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/riscv/boot/start.c b/arch/riscv/boot/start.c
index 72ab93cb76..8b4c8bb2f0 100644
--- a/arch/riscv/boot/start.c
+++ b/arch/riscv/boot/start.c
@@ -32,7 +32,6 @@ unsigned barebox_riscv_pbl_flags;
void *barebox_riscv_boot_dtb(void)
{
void *dtb;
- void *data;
int ret;
struct barebox_boarddata_compressed_dtb *compressed_dtb;
static void *boot_dtb;
@@ -56,9 +55,8 @@ void *barebox_riscv_boot_dtb(void)
if (!dtb)
return NULL;
- data = compressed_dtb + 1;
-
- ret = uncompress(data, compressed_dtb->datalen, NULL, NULL, dtb, NULL, NULL);
+ ret = uncompress(compressed_dtb->data, compressed_dtb->datalen,
+ NULL, NULL, dtb, NULL, NULL);
if (ret) {
pr_err("uncompressing dtb failed\n");
free(dtb);