diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-07-11 09:03:29 -0400 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2007-07-18 09:58:53 -0400 |
commit | 503990ebb21e5aabe497a3eb1d39bef0bbc1be6f (patch) | |
tree | 9236566c401828cedc2785cabbf4d85d5f26d215 | |
parent | 2db61c95c03d08bb885c87a816540e75190c924a (diff) |
UBI: remove unneeded error checks
Pointed to by viro.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r-- | drivers/mtd/ubi/build.c | 12 | ||||
-rw-r--r-- | drivers/mtd/ubi/kapi.c | 3 |
2 files changed, 2 insertions, 13 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 336482a55f84..1cb22bfae750 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c | |||
@@ -685,13 +685,6 @@ static int __init ubi_init(void) | |||
685 | struct mtd_dev_param *p = &mtd_dev_param[i]; | 685 | struct mtd_dev_param *p = &mtd_dev_param[i]; |
686 | 686 | ||
687 | cond_resched(); | 687 | cond_resched(); |
688 | |||
689 | if (!p->name) { | ||
690 | dbg_err("empty name"); | ||
691 | err = -EINVAL; | ||
692 | goto out_detach; | ||
693 | } | ||
694 | |||
695 | err = attach_mtd_dev(p->name, p->vid_hdr_offs, p->data_offs); | 688 | err = attach_mtd_dev(p->name, p->vid_hdr_offs, p->data_offs); |
696 | if (err) | 689 | if (err) |
697 | goto out_detach; | 690 | goto out_detach; |
@@ -798,7 +791,7 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp) | |||
798 | 791 | ||
799 | /* Get rid of the final newline */ | 792 | /* Get rid of the final newline */ |
800 | if (buf[len - 1] == '\n') | 793 | if (buf[len - 1] == '\n') |
801 | buf[len - 1] = 0; | 794 | buf[len - 1] = '\0'; |
802 | 795 | ||
803 | for (i = 0; i < 3; i++) | 796 | for (i = 0; i < 3; i++) |
804 | tokens[i] = strsep(&pbuf, ","); | 797 | tokens[i] = strsep(&pbuf, ","); |
@@ -808,9 +801,6 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp) | |||
808 | return -EINVAL; | 801 | return -EINVAL; |
809 | } | 802 | } |
810 | 803 | ||
811 | if (tokens[0] == '\0') | ||
812 | return -EINVAL; | ||
813 | |||
814 | p = &mtd_dev_param[mtd_devs]; | 804 | p = &mtd_dev_param[mtd_devs]; |
815 | strcpy(&p->name[0], tokens[0]); | 805 | strcpy(&p->name[0], tokens[0]); |
816 | 806 | ||
diff --git a/drivers/mtd/ubi/kapi.c b/drivers/mtd/ubi/kapi.c index 78cae4940875..4a458e83e4e9 100644 --- a/drivers/mtd/ubi/kapi.c +++ b/drivers/mtd/ubi/kapi.c | |||
@@ -38,9 +38,8 @@ int ubi_get_device_info(int ubi_num, struct ubi_device_info *di) | |||
38 | const struct ubi_device *ubi; | 38 | const struct ubi_device *ubi; |
39 | 39 | ||
40 | if (ubi_num < 0 || ubi_num >= UBI_MAX_DEVICES || | 40 | if (ubi_num < 0 || ubi_num >= UBI_MAX_DEVICES || |
41 | !ubi_devices[ubi_num]) { | 41 | !ubi_devices[ubi_num]) |
42 | return -ENODEV; | 42 | return -ENODEV; |
43 | } | ||
44 | 43 | ||
45 | ubi = ubi_devices[ubi_num]; | 44 | ubi = ubi_devices[ubi_num]; |
46 | di->ubi_num = ubi->ubi_num; | 45 | di->ubi_num = ubi->ubi_num; |