* [PATCH] bootstrap: constify strings
@ 2015-12-10 21:50 Trent Piepho
2015-12-11 8:16 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Trent Piepho @ 2015-12-10 21:50 UTC (permalink / raw)
To: barebox
Various parameters for device names, etc. should be const strings.
Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
---
include/bootstrap.h | 8 ++++----
lib/bootstrap/devfs.c | 2 +-
lib/bootstrap/disk.c | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/bootstrap.h b/include/bootstrap.h
index 9863ff4..d3ee6be 100644
--- a/include/bootstrap.h
+++ b/include/bootstrap.h
@@ -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;
}
diff --git a/lib/bootstrap/devfs.c b/lib/bootstrap/devfs.c
index 5a64477..6a3dd76 100644
--- a/lib/bootstrap/devfs.c
+++ b/lib/bootstrap/devfs.c
@@ -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;
diff --git a/lib/bootstrap/disk.c b/lib/bootstrap/disk.c
index ebf9ee5..a55d5d7 100644
--- a/lib/bootstrap/disk.c
+++ b/lib/bootstrap/disk.c
@@ -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) {
--
1.8.3.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] bootstrap: constify strings
2015-12-10 21:50 [PATCH] bootstrap: constify strings Trent Piepho
@ 2015-12-11 8:16 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2015-12-11 8:16 UTC (permalink / raw)
To: Trent Piepho; +Cc: barebox
On Thu, Dec 10, 2015 at 09:50:51PM +0000, Trent Piepho wrote:
> Various parameters for device names, etc. should be const strings.
>
> Signed-off-by: Trent Piepho <tpiepho@kymetacorp.com>
> ---
> include/bootstrap.h | 8 ++++----
> lib/bootstrap/devfs.c | 2 +-
> lib/bootstrap/disk.c | 4 ++--
> 3 files changed, 7 insertions(+), 7 deletions(-)
Applied, thanks
Sascha
--
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-12-11 8:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 21:50 [PATCH] bootstrap: constify strings Trent Piepho
2015-12-11 8:16 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox