Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144889774
D49703.1776847976.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D49703.1776847976.diff
View Options
diff --git a/sys/dev/fdt/fdt_common.h b/sys/dev/fdt/fdt_common.h
--- a/sys/dev/fdt/fdt_common.h
+++ b/sys/dev/fdt/fdt_common.h
@@ -79,8 +79,8 @@
typedef void (*fdt_mem_region_cb)(const struct mem_region *, void *);
int fdt_addrsize_cells(phandle_t, int *, int *);
-u_long fdt_data_get(void *, int);
-int fdt_data_to_res(pcell_t *, int, int, u_long *, u_long *);
+u_long fdt_data_get(const void *, int);
+int fdt_data_to_res(const pcell_t *, int, int, u_long *, u_long *);
phandle_t fdt_find_compatible(phandle_t, const char *, int);
phandle_t fdt_depth_search_compatible(phandle_t, const char *, int);
int fdt_foreach_mem_region(fdt_mem_region_cb, void *);
diff --git a/sys/dev/fdt/fdt_common.c b/sys/dev/fdt/fdt_common.c
--- a/sys/dev/fdt/fdt_common.c
+++ b/sys/dev/fdt/fdt_common.c
@@ -303,13 +303,13 @@
}
u_long
-fdt_data_get(void *data, int cells)
+fdt_data_get(const void *data, int cells)
{
if (cells == 1)
- return (fdt32_to_cpu(*((uint32_t *)data)));
+ return (fdt32_to_cpu(*((const uint32_t *)data)));
- return (fdt64_to_cpu(*((uint64_t *)data)));
+ return (fdt64_to_cpu(*((const uint64_t *)data)));
}
int
@@ -336,22 +336,22 @@
}
int
-fdt_data_to_res(pcell_t *data, int addr_cells, int size_cells, u_long *start,
- u_long *count)
+fdt_data_to_res(const pcell_t *data, int addr_cells, int size_cells,
+ u_long *start, u_long *count)
{
/* Address portion. */
if (addr_cells > 2)
return (ERANGE);
- *start = fdt_data_get((void *)data, addr_cells);
+ *start = fdt_data_get((const void *)data, addr_cells);
data += addr_cells;
/* Size portion. */
if (size_cells > 2)
return (ERANGE);
- *count = fdt_data_get((void *)data, size_cells);
+ *count = fdt_data_get((const void *)data, size_cells);
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 8:52 AM (29 m, 46 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28405837
Default Alt Text
D49703.1776847976.diff (1 KB)
Attached To
Mode
D49703: dev/fdt: Add const to pointers to const data
Attached
Detach File
Event Timeline
Log In to Comment