summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-01-22 09:49:21 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-01-22 09:49:21 +0100
commit5ebdae4863f64a32826c25c6e0d1dfbc1612d904 (patch)
treef7c8ae79050fd00a708bfcda11f6681ebb9a32ce /fs
parent034637fbd9dfc5cbcffca1f8f392c6ab0dd6f229 (diff)
parent2f9b25f41362e99e2b31684b5c9a1a02abc1ae8b (diff)
downloadbarebox-5ebdae4863f64a32826c25c6e0d1dfbc1612d904.tar.gz
barebox-5ebdae4863f64a32826c25c6e0d1dfbc1612d904.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'fs')
-rw-r--r--fs/Makefile2
-rw-r--r--fs/fs.c3
-rw-r--r--fs/nfs.c3
-rw-r--r--fs/parseopt.c60
-rw-r--r--fs/parseopt.h2
5 files changed, 3 insertions, 67 deletions
diff --git a/fs/Makefile b/fs/Makefile
index b3f929f506..8e3fd78e92 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -4,7 +4,7 @@ obj-$(CONFIG_FS_RAMFS) += ramfs.o
obj-y += devfs-core.o
obj-$(CONFIG_FS_DEVFS) += devfs.o
obj-$(CONFIG_FS_FAT) += fat/
-obj-y += fs.o parseopt.o
+obj-y += fs.o
obj-$(CONFIG_FS_UBIFS) += ubifs/
obj-$(CONFIG_FS_TFTP) += tftp.o
obj-$(CONFIG_FS_OMAP4_USBBOOT) += omap4_usbbootfs.o
diff --git a/fs/fs.c b/fs/fs.c
index 051af8d19f..6f15e93ba9 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -35,8 +35,7 @@
#include <libgen.h>
#include <block.h>
#include <libfile.h>
-
-#include "parseopt.h"
+#include <parseopt.h>
char *mkmodestr(unsigned long mode, char *str)
{
diff --git a/fs/nfs.c b/fs/nfs.c
index 97f01cfb34..75cd127eeb 100644
--- a/fs/nfs.c
+++ b/fs/nfs.c
@@ -36,8 +36,7 @@
#include <linux/sizes.h>
#include <byteorder.h>
#include <globalvar.h>
-
-#include "parseopt.h"
+#include <parseopt.h>
#define SUNRPC_PORT 111
diff --git a/fs/parseopt.c b/fs/parseopt.c
deleted file mode 100644
index 8ff83019a7..0000000000
--- a/fs/parseopt.c
+++ /dev/null
@@ -1,60 +0,0 @@
-#include <common.h>
-
-#include "parseopt.h"
-
-void parseopt_b(const char *options, const char *opt, bool *val)
-{
- const char *start;
- size_t optlen = strlen(opt);
-
-again:
- start = strstr(options, opt);
-
- if (!start) {
- *val = false;
- return;
- }
-
- if (start > options && start[-1] != ',') {
- options = start;
- goto again;
- }
-
- if (start[optlen] != ',' && start[optlen] != '\0') {
- options = start;
- goto again;
- }
-
- *val = true;
-}
-
-void parseopt_hu(const char *options, const char *opt, unsigned short *val)
-{
- const char *start;
- size_t optlen = strlen(opt);
- ulong v;
- char *endp;
-
-again:
- start = strstr(options, opt);
-
- if (!start)
- return;
-
- if (start > options && start[-1] != ',') {
- options = start;
- goto again;
- }
-
- if (start[optlen] != '=') {
- options = start;
- goto again;
- }
-
- v = simple_strtoul(start + optlen + 1, &endp, 0);
- if (v > USHRT_MAX)
- return;
-
- if (*endp == ',' || *endp == '\0')
- *val = v;
-}
diff --git a/fs/parseopt.h b/fs/parseopt.h
deleted file mode 100644
index abf3be3f35..0000000000
--- a/fs/parseopt.h
+++ /dev/null
@@ -1,2 +0,0 @@
-void parseopt_b(const char *options, const char *opt, bool *val);
-void parseopt_hu(const char *options, const char *opt, unsigned short *val);