commit 78494f8b0744c87f128f42389d356eb135178da0
Author: Yiannis Pericleous <[EMAIL PROTECTED]>
Date: Thu May 24 22:12:13 2007 -0400
coding style: use switch statement to avoid ugly if/else nesting
diff --git a/fs/unionfs/config.c b/fs/unionfs/config.c
index b94dfaf..d93fd6a 100644
--- a/fs/unionfs/config.c
+++ b/fs/unionfs/config.c
@@ -109,21 +109,25 @@ static ssize_t unionfs_write_num(struct
unionfs_config_attr *attr,
attr->unionfs_attr->min,
attr->unionfs_attr->max);
return -ERANGE;
}
- if (attr->depended) {
- if (attr->depend_mode == DEPEND_MAX) {
+
+ /* if min/max depends on another val, check if its valid */
+ switch(attr->depend_mode) {
+
+ case DEPEND_MAX:
if (tmp >= attr->depended->val) {
printk("unionfs: the value must be lower than
the value of %s\n",
attr->depended->name);
return -ERANGE;
}
- }
- else if (attr->depend_mode == DEPEND_MIN) {
+ break;
+
+ case DEPEND_MIN:
if (tmp <= attr->depended->val) {
printk("unionfs: the value must be higher than
the value of %s\n",
attr->depended->name);
return -ERANGE;
}
- }
+ break;
}
attr->unionfs_attr->val = tmp;
_______________________________________________
unionfs-cvs mailing list: http://unionfs.filesystems.org/
[email protected]
http://www.fsl.cs.sunysb.edu/mailman/listinfo/unionfs-cvs