summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-05-09 08:49:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-05-09 08:49:42 +0200
commit55aca0a48c5cb68eeddf723a5bc69fc052071e61 (patch)
tree00961bee994725f5d3ee678c5630b53ecc5a02fe /fs
parent216f412ede9cb78ccdfd00df89246ab1ffc9e300 (diff)
parent18f0d2221a4c781dad2a224f8ac17e7c95fd1d9c (diff)
downloadbarebox-55aca0a48c5cb68eeddf723a5bc69fc052071e61.tar.gz
barebox-55aca0a48c5cb68eeddf723a5bc69fc052071e61.tar.xz
Merge branch 'for-next/include-cleanup'
Diffstat (limited to 'fs')
-rw-r--r--fs/bpkfs.c7
-rw-r--r--fs/efi.c5
-rw-r--r--fs/efivarfs.c4
-rw-r--r--fs/fs.c9
-rw-r--r--fs/nfs.c9
-rw-r--r--fs/ubifs/ubifs.c4
-rw-r--r--fs/ubifs/ubifs.h1
-rw-r--r--fs/uimagefs.c11
8 files changed, 28 insertions, 22 deletions
diff --git a/fs/bpkfs.c b/fs/bpkfs.c
index 1e2619e5cd..f1db963d09 100644
--- a/fs/bpkfs.c
+++ b/fs/bpkfs.c
@@ -14,6 +14,7 @@
#include <fcntl.h>
#include <malloc.h>
#include <init.h>
+#include <crc.h>
#include <linux/stat.h>
#include <linux/err.h>
#include <bpkfs.h>
@@ -102,7 +103,7 @@ static struct bpkfs_handle_hw *bpkfs_get_or_add_hw_id(
INIT_LIST_HEAD(&h->list_data);
h->hw_id = hw_id;
- h->name = asprintf("hw_id_%x", hw_id);
+ h->name = basprintf("hw_id_%x", hw_id);
list_add_tail(&h->list_hw_id, &handle->list);
return h;
@@ -430,7 +431,7 @@ static int bpkfs_probe(struct device_d *dev)
if (!type) {
type = "unknown";
- d->name = asprintf("%s_%08x", type, d->type);
+ d->name = basprintf("%s_%08x", type, d->type);
} else {
d->name = xstrdup(type);
}
@@ -463,7 +464,7 @@ static int bpkfs_probe(struct device_d *dev)
type = d->name;
d = xzalloc(sizeof(*d));
d->type = be32_to_cpu(data_header.type);
- d->name = asprintf("%s.crc", type);
+ d->name = basprintf("%s.crc", type);
d->type |= (1 << 31);
d->size = 8;
sprintf(d->data, "%08x", be32_to_cpu(data_header.crc));
diff --git a/fs/efi.c b/fs/efi.c
index 0f74cdafff..26f2f669bb 100644
--- a/fs/efi.c
+++ b/fs/efi.c
@@ -30,6 +30,7 @@
#include <fcntl.h>
#include <wchar.h>
#include <efi.h>
+#include <libfile.h>
#include <mach/efi.h>
#include <mach/efi-device.h>
@@ -530,8 +531,8 @@ int efi_fs_probe(struct efi_device *efidev)
if (efi_loaded_image && efidev->protocol == volume)
path = xstrdup("/boot");
else
- path = asprintf("/efi%d", index);
- device = asprintf("%s", dev_name(&efidev->dev));
+ path = basprintf("/efi%d", index);
+ device = basprintf("%s", dev_name(&efidev->dev));
ret = make_directory(path);
if (ret)
diff --git a/fs/efivarfs.c b/fs/efivarfs.c
index c7a282b05c..86cdcf0b59 100644
--- a/fs/efivarfs.c
+++ b/fs/efivarfs.c
@@ -154,7 +154,7 @@ static int efivars_create(struct device_d *dev, const char *pathname, mode_t mod
name8 = xstrdup_wchar_to_char(inode->name);
- inode->full_name = asprintf("%s-%pUl", name8, &inode->vendor);
+ inode->full_name = basprintf("%s-%pUl", name8, &inode->vendor);
free(name8);
efiret = RT->set_variable(inode->name, &inode->vendor,
@@ -405,7 +405,7 @@ static int efivarfs_probe(struct device_d *dev)
inode->vendor = vendor;
name8 = xstrdup_wchar_to_char(inode->name);
- inode->full_name = asprintf("%s-%pUl", name8, &vendor);
+ inode->full_name = basprintf("%s-%pUl", name8, &vendor);
free(name8);
list_add_tail(&inode->node, &priv->inodes);
diff --git a/fs/fs.c b/fs/fs.c
index 966abe9408..f63a2dde51 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -18,6 +18,7 @@
*/
#include <common.h>
+#include <command.h>
#include <fs.h>
#include <driver.h>
#include <errno.h>
@@ -33,6 +34,7 @@
#include <environment.h>
#include <libgen.h>
#include <block.h>
+#include <libfile.h>
char *mkmodestr(unsigned long mode, char *str)
{
@@ -1299,7 +1301,8 @@ int mount(const char *device, const char *fsname, const char *_path,
}
if (!fsdev->linux_rootarg && fsdev->cdev && fsdev->cdev->partuuid[0] != 0) {
- char *str = asprintf("root=PARTUUID=%s", fsdev->cdev->partuuid);
+ char *str = basprintf("root=PARTUUID=%s",
+ fsdev->cdev->partuuid);
fsdev_set_linux_rootarg(fsdev, str);
}
@@ -1718,10 +1721,10 @@ const char *cdev_mount_default(struct cdev *cdev, const char *fsoptions)
if (path)
return path;
- newpath = asprintf("/mnt/%s", cdev->name);
+ newpath = basprintf("/mnt/%s", cdev->name);
make_directory(newpath);
- devpath = asprintf("/dev/%s", cdev->name);
+ devpath = basprintf("/dev/%s", cdev->name);
ret = mount(devpath, NULL, newpath, fsoptions);
diff --git a/fs/nfs.c b/fs/nfs.c
index 87828fce13..1e874d541e 100644
--- a/fs/nfs.c
+++ b/fs/nfs.c
@@ -1317,19 +1317,18 @@ static void nfs_set_rootarg(struct nfs_priv *npriv, struct fs_device_d *fsdev)
const char *ip;
ip = ip_to_string(npriv->server);
- str = asprintf("root=/dev/nfs nfsroot=%s:%s%s%s",
- ip, npriv->path, rootnfsopts[0] ? "," : "",
- rootnfsopts);
+ str = basprintf("root=/dev/nfs nfsroot=%s:%s%s%s", ip, npriv->path,
+ rootnfsopts[0] ? "," : "", rootnfsopts);
/* forward specific mount options on demand */
if (npriv->manual_nfs_port == 1) {
- tmp = asprintf("%s,port=%hu", str, npriv->nfs_port);
+ tmp = basprintf("%s,port=%hu", str, npriv->nfs_port);
free(str);
str = tmp;
}
if (npriv->manual_mount_port == 1) {
- tmp = asprintf("%s,mountport=%hu", str, npriv->mount_port);
+ tmp = basprintf("%s,mountport=%hu", str, npriv->mount_port);
free(str);
str = tmp;
}
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index f07ad5e7f9..8062baaa85 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -1269,8 +1269,8 @@ void ubifs_set_rootarg(struct ubifs_priv *priv, struct fs_device_d *fsdev)
mtd = di.mtd;
- str = asprintf("root=ubi0:%s ubi.mtd=%s rootfstype=ubifs",
- vi.name, mtd->cdev.partname);
+ str = basprintf("root=ubi0:%s ubi.mtd=%s rootfstype=ubifs",
+ vi.name, mtd->cdev.partname);
fsdev_set_linux_rootarg(fsdev, str);
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h
index 75e54e7fef..d2dcf7e180 100644
--- a/fs/ubifs/ubifs.h
+++ b/fs/ubifs/ubifs.h
@@ -34,6 +34,7 @@
#else
#include <common.h>
#include <lzo.h>
+#include <crc.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/ctype.h>
diff --git a/fs/uimagefs.c b/fs/uimagefs.c
index 3fdc5bd2be..13c1fbac05 100644
--- a/fs/uimagefs.c
+++ b/fs/uimagefs.c
@@ -17,6 +17,7 @@
#include <uimagefs.h>
#include <libbb.h>
#include <rtc.h>
+#include <crc.h>
#include <libfile.h>
static bool uimagefs_is_data_file(struct uimagefs_handle_data *d)
@@ -249,7 +250,7 @@ static int uimagefs_add_name(struct uimagefs_handle *priv)
static int uimagefs_add_hex(struct uimagefs_handle *priv, enum uimagefs_type type,
uint32_t data)
{
- char *val = asprintf("0x%x", data);
+ char *val = basprintf("0x%x", data);
return uimagefs_add_str(priv, type, val);
}
@@ -265,7 +266,7 @@ static int __uimagefs_add_data(struct uimagefs_handle *priv, size_t offset,
if (i < 0)
d->name = xstrdup(name);
else
- d->name = asprintf("%s%d", name, i);
+ d->name = basprintf("%s%d", name, i);
d->offset = offset;
d->size = size;
@@ -303,7 +304,7 @@ static int uimagefs_add_time(struct uimagefs_handle *priv)
char *val;
to_tm(header->ih_time, &tm);
- val = asprintf("%4d-%02d-%02d %2d:%02d:%02d UTC",
+ val = basprintf("%4d-%02d-%02d %2d:%02d:%02d UTC",
tm.tm_year, tm.tm_mon, tm.tm_mday,
tm.tm_hour, tm.tm_min, tm.tm_sec);
@@ -514,8 +515,8 @@ static int uimagefs_probe(struct device_d *dev)
dev_dbg(dev, "mount: %s\n", fsdev->backingstore);
if (IS_BUILTIN(CONFIG_FS_TFTP))
- priv->tmp = asprintf("/.uImage_tmp_%08x",
- crc32(0, fsdev->path, strlen(fsdev->path)));
+ priv->tmp = basprintf("/.uImage_tmp_%08x",
+ crc32(0, fsdev->path, strlen(fsdev->path)));
ret = __uimage_open(priv);
if (ret)