Skip to contentSkip to conversation

bootstrap: constify strings

PATCH Applied Trent Piepho 2 participants 2 messages Dec 10, 2015 – Dec 11, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bootstrap: constify strings

Various parameters for device names, etc. should be const strings.

---
 include/bootstrap.h   | 8 ++++----
 lib/bootstrap/devfs.c | 2 +-
 lib/bootstrap/disk.c  | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)
include/bootstrap.h +4 -4
index 9863ff4..d3ee6be 100644
@@ -15,10 +15,10 @@ typedef void (*kernel_entry_func)(int zero, int arch, void *params);
 void bootstrap_boot(kernel_entry_func func, bool barebox);
 
 #ifdef CONFIG_BOOTSTRAP_DEVFS
-void* bootstrap_read_devfs(char *devname, bool use_bb, int offset,
+void* bootstrap_read_devfs(const char *devname, bool use_bb, int offset,
 			   int default_size, int max_size);
 #else
-static inline void* bootstrap_read_devfs(char *devname, bool use_bb, int offset,
+static inline void* bootstrap_read_devfs(const char *devname, bool use_bb, int offset,
 			   int default_size, int max_size)
 {
 	return NULL;
@@ -26,9 +26,9 @@ static inline void* bootstrap_read_devfs(char *devname, bool use_bb, int offset,
 #endif
 
 #ifdef CONFIG_BOOTSTRAP_DISK
-void* bootstrap_read_disk(char *devname, char *fstype);
+void* bootstrap_read_disk(const char *devname, const char *fstype);
 #else
-static inline void* bootstrap_read_disk(char *devname, char *fstype)
+static inline void* bootstrap_read_disk(const char *devname, const char *fstype)
 {
 	return NULL;
 }
lib/bootstrap/devfs.c +1 -1
index 5a64477..6a3dd76 100644
@@ -80,7 +80,7 @@ static unsigned int get_image_size(void *head)
 }
 #endif
 
-void* bootstrap_read_devfs(char *devname, bool use_bb, int offset,
+void* bootstrap_read_devfs(const char *devname, bool use_bb, int offset,
 			   int default_size, int max_size)
 {
 	int ret;
lib/bootstrap/disk.c +2 -2
index ebf9ee5..a55d5d7 100644
@@ -14,12 +14,12 @@
 #include <libfile.h>
 #include <bootstrap.h>
 
-void* bootstrap_read_disk(char *dev, char *fstype)
+void* bootstrap_read_disk(const char *dev, const char *fstype)
 {
 	int ret;
 	void *buf;
 	int len;
-	char *path = "/";
+	const char *path = "/";
 
 	ret = mount(dev, fstype, path, NULL);
 	if (ret) {
Signature · 7 lines
1.8.3.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Applied
#1 lore raw
Quoted 8 lines · Trent Piepho

Various parameters for device names, etc. should be const strings.

---
 include/bootstrap.h   | 8 ++++----
 lib/bootstrap/devfs.c | 2 +-
 lib/bootstrap/disk.c  | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

Applied, thanks

Sascha

Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox