diff options
author | maximilian attems <max@stro.at> | 2011-07-07 18:31:58 +0200 |
---|---|---|
committer | maximilian attems <max@stro.at> | 2011-07-08 13:27:09 +0200 |
commit | 16569ade271efae49329d1af8ceaa56a41806e16 (patch) | |
tree | 93889df7c70ee92bb09565f9f3e12018fe8c37fb | |
parent | 9c4561efb4ce645f212075f07e1e61faf7ee96f0 (diff) | |
download | klibc-16569ade271efae49329d1af8ceaa56a41806e16.tar.gz |
[klibc] kinit: checkpatch cleanup
fix:
ERROR: do not use assignment in if condition
..
WARNING: line over 80 characters
..
WARNING: labels should not be indented
..
ERROR: space required after that ',' (ctx:VxV)
..
Signed-off-by: maximilian attems <max@stro.at>
-rw-r--r-- | usr/kinit/devname.c | 6 | ||||
-rw-r--r-- | usr/kinit/do_mounts.c | 7 | ||||
-rw-r--r-- | usr/kinit/do_mounts.h | 8 | ||||
-rw-r--r-- | usr/kinit/do_mounts_md.c | 8 |
4 files changed, 16 insertions, 13 deletions
diff --git a/usr/kinit/devname.c b/usr/kinit/devname.c index 03f360e7b43d2..c327e3b98080d 100644 --- a/usr/kinit/devname.c +++ b/usr/kinit/devname.c @@ -25,7 +25,8 @@ static int scansysdir(char *namebuf, char *sysdir, dev_t dev) char *ep; ssize_t rd; - if (!(dir = opendir(sysdir))) + dir = opendir(sysdir); + if (!dir) return 0; *dirtailptr++ = '/'; @@ -46,7 +47,8 @@ static int scansysdir(char *namebuf, char *sysdir, dev_t dev) systail = strchr(sysdir, '\0'); strcpy(systail, "/dev"); - if (!(sysdev = fopen(sysdir, "r"))) + sysdev = fopen(sysdir, "r"); + if (!sysdev) continue; /* Abusing the namebuf as temporary storage here. */ diff --git a/usr/kinit/do_mounts.c b/usr/kinit/do_mounts.c index 63840421734fc..3ffac91967522 100644 --- a/usr/kinit/do_mounts.c +++ b/usr/kinit/do_mounts.c @@ -78,7 +78,8 @@ const char *mount_block(const char *source, const char *target, if (!p) break; *p++ = '\0'; - if (*type != '\t') /* We can't mount a block device as a "nodev" fs */ + /* We can't mount a block device as a "nodev" fs */ + if (*type != '\t') continue; type++; @@ -116,7 +117,7 @@ mount_block_root(int argc, char *argv[], dev_t root_dev, && (rp = mount_block("/dev/root", "/root", NULL, flags, data))) goto ok; - bad: +bad: if (errno != EINVAL) { /* * Allow the user to distinguish between failed open @@ -131,7 +132,7 @@ mount_block_root(int argc, char *argv[], dev_t root_dev, return -ESRCH; } - ok: +ok: printf("%s: Mounted root (%s filesystem)%s.\n", progname, rp, (flags & MS_RDONLY) ? " readonly" : ""); return 0; diff --git a/usr/kinit/do_mounts.h b/usr/kinit/do_mounts.h index c3092899c0f62..99bc6a67b6dad 100644 --- a/usr/kinit/do_mounts.h +++ b/usr/kinit/do_mounts.h @@ -9,12 +9,12 @@ #include <sys/sysmacros.h> #include <sys/stat.h> -#define Root_RAM0 __makedev(1,0) +#define Root_RAM0 __makedev(1, 0) /* These device numbers are only used internally */ -#define Root_NFS __makedev(0,255) -#define Root_MTD __makedev(0,254) -#define Root_MULTI __makedev(0,253) +#define Root_NFS __makedev(0, 255) +#define Root_MTD __makedev(0, 254) +#define Root_MULTI __makedev(0, 253) int create_dev(const char *name, dev_t dev); diff --git a/usr/kinit/do_mounts_md.c b/usr/kinit/do_mounts_md.c index 7c6ed8d458387..f446620c43c83 100644 --- a/usr/kinit/do_mounts_md.c +++ b/usr/kinit/do_mounts_md.c @@ -204,7 +204,7 @@ static int md_setup(char *str) } fprintf(stderr, "md: Will configure md%s%d (%s) from %s, below.\n", - partitioned?"_d":"", minor_num, pername, str); + partitioned ? "_d" : "", minor_num, pername, str); md_setup_args[ent].device_names = str; md_setup_args[ent].partitioned = partitioned; md_setup_args[ent].minor = minor_num; @@ -330,9 +330,9 @@ static void md_setup_drive(void) dev_minor); else { /* reread the partition table. - * I (neilb) and not sure why this is needed, but I cannot - * boot a kernel with devfs compiled in from partitioned md - * array without it + * I (neilb) and not sure why this is needed, but I + * cannot boot a kernel with devfs compiled in from + * partitioned md array without it */ close(fd); fd = open(name, 0, 0); |