aboutsummaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorSamuel Holland <samuel.holland@sifive.com>2024-07-30 21:58:51 -0700
committerAnup Patel <anup@brainfault.org>2024-08-24 13:02:46 +0530
commitbd76eb49502c25d3553da4aaeff846e8762a612d (patch)
treec31b6d7b26bb6ec480d63138903545eb0b3bfac3 /lib/utils
parent57a047930219f0599a0aa27a72de681efa2856aa (diff)
downloadopensbi-bd76eb49502c25d3553da4aaeff846e8762a612d.tar.gz
opensbi-bd76eb49502c25d3553da4aaeff846e8762a612d.tar.bz2
opensbi-bd76eb49502c25d3553da4aaeff846e8762a612d.zip
lib: utils/serial: Constify FDT pointers in parsing functions
Indicate that none of these functions modify the devicetree by constifying the parameter type. Signed-off-by: Samuel Holland <samuel.holland@sifive.com> Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/serial/fdt_serial.c2
-rw-r--r--lib/utils/serial/fdt_serial_cadence.c2
-rw-r--r--lib/utils/serial/fdt_serial_gaisler.c2
-rw-r--r--lib/utils/serial/fdt_serial_htif.c2
-rw-r--r--lib/utils/serial/fdt_serial_litex.c2
-rw-r--r--lib/utils/serial/fdt_serial_renesas_scif.c2
-rw-r--r--lib/utils/serial/fdt_serial_shakti.c4
-rw-r--r--lib/utils/serial/fdt_serial_sifive.c4
-rw-r--r--lib/utils/serial/fdt_serial_uart8250.c2
-rw-r--r--lib/utils/serial/fdt_serial_xlnx_uartlite.c4
10 files changed, 13 insertions, 13 deletions
diff --git a/lib/utils/serial/fdt_serial.c b/lib/utils/serial/fdt_serial.c
index 798ac749..6f995cf7 100644
--- a/lib/utils/serial/fdt_serial.c
+++ b/lib/utils/serial/fdt_serial.c
@@ -23,7 +23,7 @@ int fdt_serial_init(void)
struct fdt_serial *drv;
const struct fdt_match *match;
int pos, noff = -1, len, coff, rc;
- void *fdt = fdt_get_address();
+ const void *fdt = fdt_get_address();
/* Find offset of node pointed to by stdout-path */
coff = fdt_path_offset(fdt, "/chosen");
diff --git a/lib/utils/serial/fdt_serial_cadence.c b/lib/utils/serial/fdt_serial_cadence.c
index ae59e4c1..ee7d7797 100644
--- a/lib/utils/serial/fdt_serial_cadence.c
+++ b/lib/utils/serial/fdt_serial_cadence.c
@@ -10,7 +10,7 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/cadence-uart.h>
-static int serial_cadence_init(void *fdt, int nodeoff,
+static int serial_cadence_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
diff --git a/lib/utils/serial/fdt_serial_gaisler.c b/lib/utils/serial/fdt_serial_gaisler.c
index 74988e34..cae1727d 100644
--- a/lib/utils/serial/fdt_serial_gaisler.c
+++ b/lib/utils/serial/fdt_serial_gaisler.c
@@ -11,7 +11,7 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/gaisler-uart.h>
-static int serial_gaisler_init(void *fdt, int nodeoff,
+static int serial_gaisler_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
diff --git a/lib/utils/serial/fdt_serial_htif.c b/lib/utils/serial/fdt_serial_htif.c
index 7d88e7a1..43557f6c 100644
--- a/lib/utils/serial/fdt_serial_htif.c
+++ b/lib/utils/serial/fdt_serial_htif.c
@@ -18,7 +18,7 @@ static const struct fdt_match serial_htif_match[] = {
{ },
};
-static int serial_htif_init(void *fdt, int nodeoff,
+static int serial_htif_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
diff --git a/lib/utils/serial/fdt_serial_litex.c b/lib/utils/serial/fdt_serial_litex.c
index 3b3b306b..9aed719f 100644
--- a/lib/utils/serial/fdt_serial_litex.c
+++ b/lib/utils/serial/fdt_serial_litex.c
@@ -12,7 +12,7 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/litex-uart.h>
-static int serial_litex_init(void *fdt, int nodeoff,
+static int serial_litex_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
uint64_t reg_addr, reg_size;
diff --git a/lib/utils/serial/fdt_serial_renesas_scif.c b/lib/utils/serial/fdt_serial_renesas_scif.c
index c331ca1a..41356d1d 100644
--- a/lib/utils/serial/fdt_serial_renesas_scif.c
+++ b/lib/utils/serial/fdt_serial_renesas_scif.c
@@ -7,7 +7,7 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/renesas-scif.h>
-static int serial_renesas_scif_init(void *fdt, int nodeoff,
+static int serial_renesas_scif_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
struct platform_uart_data uart = { 0 };
diff --git a/lib/utils/serial/fdt_serial_shakti.c b/lib/utils/serial/fdt_serial_shakti.c
index 0e056303..2bafc99b 100644
--- a/lib/utils/serial/fdt_serial_shakti.c
+++ b/lib/utils/serial/fdt_serial_shakti.c
@@ -9,8 +9,8 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/shakti-uart.h>
-static int serial_shakti_init(void *fdt, int nodeoff,
- const struct fdt_match *match)
+static int serial_shakti_init(const void *fdt, int nodeoff,
+ const struct fdt_match *match)
{
int rc;
struct platform_uart_data uart = { 0 };
diff --git a/lib/utils/serial/fdt_serial_sifive.c b/lib/utils/serial/fdt_serial_sifive.c
index 3ca10913..f551b78c 100644
--- a/lib/utils/serial/fdt_serial_sifive.c
+++ b/lib/utils/serial/fdt_serial_sifive.c
@@ -11,8 +11,8 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/sifive-uart.h>
-static int serial_sifive_init(void *fdt, int nodeoff,
- const struct fdt_match *match)
+static int serial_sifive_init(const void *fdt, int nodeoff,
+ const struct fdt_match *match)
{
int rc;
struct platform_uart_data uart = { 0 };
diff --git a/lib/utils/serial/fdt_serial_uart8250.c b/lib/utils/serial/fdt_serial_uart8250.c
index 7b5d6a4c..10d201cc 100644
--- a/lib/utils/serial/fdt_serial_uart8250.c
+++ b/lib/utils/serial/fdt_serial_uart8250.c
@@ -11,7 +11,7 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/uart8250.h>
-static int serial_uart8250_init(void *fdt, int nodeoff,
+static int serial_uart8250_init(const void *fdt, int nodeoff,
const struct fdt_match *match)
{
int rc;
diff --git a/lib/utils/serial/fdt_serial_xlnx_uartlite.c b/lib/utils/serial/fdt_serial_xlnx_uartlite.c
index 9f04aea3..0a829ad2 100644
--- a/lib/utils/serial/fdt_serial_xlnx_uartlite.c
+++ b/lib/utils/serial/fdt_serial_xlnx_uartlite.c
@@ -11,8 +11,8 @@
#include <sbi_utils/serial/fdt_serial.h>
#include <sbi_utils/serial/xlnx_uartlite.h>
-static int serial_xlnx_uartlite_init(void *fdt, int nodeoff,
- const struct fdt_match *match)
+static int serial_xlnx_uartlite_init(const void *fdt, int nodeoff,
+ const struct fdt_match *match)
{
int rc;
struct platform_uart_data uart = { 0 };