Skip to content

Commit

Permalink
Remove lots of unnecessary white space.
Browse files Browse the repository at this point in the history
Now that I am using white-space mode in Emacs I can see all of this,
and I don't like it :-)

Signed-off-by: NeilBrown <[email protected]>
  • Loading branch information
neilbrown committed Jun 19, 2013
1 parent e6dd89d commit 1011e83
Show file tree
Hide file tree
Showing 51 changed files with 68 additions and 201 deletions.
3 changes: 1 addition & 2 deletions Assemble.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ int Assemble(struct supertype *st, char *mddev,
inargv, auto_assem);
if (num_devs < 0)
return 1;

if (!st || !st->sb || !content)
return 2;

Expand Down Expand Up @@ -1897,4 +1897,3 @@ int assemble_container_content(struct supertype *st, int mdfd,
}
}
#endif

6 changes: 3 additions & 3 deletions Build.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@

#include "mdadm.h"

#define REGISTER_DEV _IO (MD_MAJOR, 1)
#define START_MD _IO (MD_MAJOR, 2)
#define STOP_MD _IO (MD_MAJOR, 3)
#define REGISTER_DEV _IO (MD_MAJOR, 1)
#define START_MD _IO (MD_MAJOR, 2)
#define STOP_MD _IO (MD_MAJOR, 3)

int Build(char *mddev, struct mddev_dev *devlist,
struct shape *s, struct context *c)
Expand Down
2 changes: 0 additions & 2 deletions Grow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1537,7 +1537,6 @@ int Grow_reshape(char *devname, int fd,
struct mdinfo info;
struct mdinfo *sra;


if (ioctl(fd, GET_ARRAY_INFO, &array) < 0) {
pr_err("%s is not an active md array - aborting\n",
devname);
Expand Down Expand Up @@ -2793,7 +2792,6 @@ static int reshape_array(char *container, int fd, char *devname,
Manage_subdevs(devname, fd, devlist, verbose,
0,NULL, 0);


if (reshape.backup_blocks == 0 && data_offset)
reshape.backup_blocks = reshape.before.data_disks * info->array.chunk_size/512;
if (reshape.backup_blocks == 0) {
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,3 @@ DISTRO_MAKEFILE := $(wildcard distropkg/Makefile)
ifdef DISTRO_MAKEFILE
include $(DISTRO_MAKEFILE)
endif

8 changes: 4 additions & 4 deletions Manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
#include "md_p.h"
#include <ctype.h>

#define REGISTER_DEV _IO (MD_MAJOR, 1)
#define START_MD _IO (MD_MAJOR, 2)
#define STOP_MD _IO (MD_MAJOR, 3)
#define REGISTER_DEV _IO (MD_MAJOR, 1)
#define START_MD _IO (MD_MAJOR, 2)
#define STOP_MD _IO (MD_MAJOR, 3)

int Manage_ro(char *devname, int fd, int readonly)
{
Expand Down Expand Up @@ -1358,7 +1358,7 @@ int Manage_subdevs(char *devname, int fd,
*/
close(tfd);
tfd = dev_open(dv->devname, O_RDONLY);
}
}
if (tfd < 0) {
if (dv->disposition == 'M')
continue;
Expand Down
12 changes: 5 additions & 7 deletions Monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ int Monitor(struct mddev_dev *devlist,
return rv;
}

if (share)
if (share)
if (check_one_sharer(c->scan))
return 1;

Expand Down Expand Up @@ -204,7 +204,6 @@ int Monitor(struct mddev_dev *devlist,
}
}


while (! finished) {
int new_found = 0;
struct state *st;
Expand All @@ -218,7 +217,7 @@ int Monitor(struct mddev_dev *devlist,
if (check_array(st, mdstat, c->test, &info,
increments, c->prefer))
anydegraded = 1;

/* now check if there are any new devices found in mdstat */
if (c->scan)
new_found = add_new_arrays(mdstat, &statelist, c->test,
Expand Down Expand Up @@ -809,12 +808,12 @@ static dev_t container_choose_spare(struct state *from, struct state *to,
close(fd);
return 0;
}

err = st->ss->load_container(st, fd, NULL);
close(fd);
if (err)
return 0;

if (from == to) {
/* We must check if number of active disks has not increased
* since ioctl in main loop. mdmon may have added spare
Expand Down Expand Up @@ -855,7 +854,6 @@ static dev_t container_choose_spare(struct state *from, struct state *to,
return dev;
}


static void try_spare_migration(struct state *statelist, struct alert_info *info)
{
struct state *from;
Expand All @@ -874,7 +872,7 @@ static void try_spare_migration(struct state *statelist, struct alert_info *info
/* subarray monitored without parent container
* we can't move spares here */
continue;

if (to->parent)
/* member of a container */
to = to->parent;
Expand Down
1 change: 0 additions & 1 deletion Query.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,3 @@ int Query(char *dev)
}
return 0;
}

5 changes: 1 addition & 4 deletions config.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ void free_line(char *line)
dl_free(line);
}


struct conf_dev {
struct conf_dev *next;
char *name;
Expand Down Expand Up @@ -417,7 +416,7 @@ void arrayline(char *line)
if (strcasecmp(w, "<ignore>") == 0 ||
strncmp(w, "/dev/md/", 8) == 0 ||
(w[0] != '/' && w[0] != '<') ||
(strncmp(w, "/dev/md", 7) == 0 &&
(strncmp(w, "/dev/md", 7) == 0 &&
is_number(w+7)) ||
(strncmp(w, "/dev/md_d", 9) == 0 &&
is_number(w+9))
Expand Down Expand Up @@ -568,7 +567,6 @@ void mailfromline(char *line)
}
}


static char *alert_program = NULL;
void programline(char *line)
{
Expand Down Expand Up @@ -987,7 +985,6 @@ int devname_matches(char *name, char *match)
else if (strncmp(match, "/dev/", 5) == 0)
match += 5;


if (strncmp(name, "md", 2) == 0 &&
isdigit(name[2]))
name += 2;
Expand Down
1 change: 0 additions & 1 deletion dlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ char *strncpy(char *dest, const char *src, size_t n) __THROW;
void *xcalloc(size_t num, size_t size);
#include "dlink.h"


void *dl_head()
{
void *h;
Expand Down
4 changes: 0 additions & 4 deletions lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ char *fd2devnm(int fd)
return NULL;
}



/*
* convert a major/minor pair for a block device into a name in /dev, if possible.
* On the first call, walk /dev collecting name.
Expand Down Expand Up @@ -233,8 +231,6 @@ char *map_dev_preferred(int major, int minor, int create,
return preferred ? preferred : regular;
}



/* conf_word gets one word from the conf file.
* if "allow_key", then accept words at the start of a line,
* otherwise stop when such a word is found.
Expand Down
5 changes: 2 additions & 3 deletions managemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ static void manage_container(struct mdstat_ent *mdstat,
struct supertype *container)
{
/* Of interest here are:
* - if a new device has been added to the container, we
* - if a new device has been added to the container, we
* add it to the array ignoring any metadata on it.
* - if a device has been removed from the container, we
* remove it from the device list and update the metadata.
Expand Down Expand Up @@ -639,7 +639,6 @@ static void manage_new(struct mdstat_ent *mdstat,
GET_LEVEL|GET_CHUNK|GET_DISKS|GET_COMPONENT|
GET_DEGRADED|GET_DEVS|GET_OFFSET|GET_SIZE|GET_STATE);


if (!mdi)
return;
new = xcalloc(1, sizeof(*new));
Expand Down Expand Up @@ -769,7 +768,7 @@ static void handle_message(struct supertype *container, struct metadata_update *

if (msg->len == 0) { /* ping_monitor */
int cnt;

cnt = monitor_loop_cnt;
if (cnt & 1)
cnt += 2; /* wait until next pselect */
Expand Down
6 changes: 2 additions & 4 deletions mapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
#include <sys/file.h>
#include <ctype.h>


#define MAP_READ 0
#define MAP_NEW 1
#define MAP_LOCK 2
Expand Down Expand Up @@ -105,7 +104,6 @@ int map_write(struct map_ent *mel)
mapname[0]) == 0;
}


static FILE *lf = NULL;
int map_lock(struct map_ent **melp)
{
Expand Down Expand Up @@ -416,11 +414,11 @@ void RebuildMap(void)
* It needs to match what -I or -As would come
* up with.
* That means:
* Check if array is in mdadm.conf
* Check if array is in mdadm.conf
* - if so use that.
* determine trustworthy from homehost etc
* find a unique name based on metadata name.
*
*
*/
struct mddev_ident *match = conf_match(st, info,
NULL, 0,
Expand Down
3 changes: 0 additions & 3 deletions maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

#include "mdadm.h"


/* name/number mappings */

mapping_t r5layout[] = {
Expand Down Expand Up @@ -97,7 +96,6 @@ mapping_t pers[] = {
{ NULL, 0}
};


mapping_t modes[] = {
{ "assemble", ASSEMBLE},
{ "build", BUILD},
Expand Down Expand Up @@ -150,4 +148,3 @@ int map_name(mapping_t *map, char *name)
}
return UnSet;
}

3 changes: 1 addition & 2 deletions md_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ typedef struct mdp_superblock_s {
/*
* Constant generic information
*/
__u32 md_magic; /* 0 MD identifier */
__u32 md_magic; /* 0 MD identifier */
__u32 major_version; /* 1 major version to which the set conforms */
__u32 minor_version; /* 2 minor version ... */
__u32 patch_version; /* 3 patchlevel version ... */
Expand Down Expand Up @@ -196,4 +196,3 @@ static inline __u64 md_event(mdp_super_t *sb) {
}

#endif

1 change: 0 additions & 1 deletion md_u.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,3 @@ typedef struct mdu_param_s
} mdu_param_t;

#endif

5 changes: 1 addition & 4 deletions mdadm.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "md_p.h"
#include <ctype.h>


static int scan_assemble(struct supertype *ss,
struct context *c,
struct mddev_ident *ident);
Expand All @@ -40,7 +39,6 @@ static int misc_list(struct mddev_dev *devlist,
char *dump_directory,
struct supertype *ss, struct context *c);


int main(int argc, char *argv[])
{
int mode = 0;
Expand Down Expand Up @@ -423,7 +421,6 @@ int main(int argc, char *argv[])
writemostly = 2;
continue;


case O(GROW,'z'):
case O(CREATE,'z'):
case O(BUILD,'z'): /* size */
Expand Down Expand Up @@ -1611,7 +1608,7 @@ static int scan_assemble(struct supertype *ss,
if (a->devname &&
strcasecmp(a->devname, "<ignore>") == 0)
continue;

r = Assemble(ss, a->devname,
a, NULL, c);
if (r == 0) {
Expand Down
1 change: 0 additions & 1 deletion mdadm.conf.5
Original file line number Diff line number Diff line change
Expand Up @@ -621,4 +621,3 @@ AUTO +1.x homehost \-all
.SH SEE ALSO
.BR mdadm (8),
.BR md (4).

Loading

0 comments on commit 1011e83

Please sign in to comment.