Patchwork [1/2] mtd: s3c2410: Change return type of s3c2410_nand_add_partition function

login
register
mail settings
Submitter Sachin Kamat
Date Nov. 8, 2012, 10:08 a.m.
Message ID <1352369324-25771-1-git-send-email-sachin.kamat@linaro.org>
Download mbox | patch
Permalink /patch/197819/
State New
Headers show

Comments

Sachin Kamat - Nov. 8, 2012, 10:08 a.m.
The return value of s3c2410_nand_add_partition() is not checked for error
or success in the calling function. Hence change the return type to void.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/mtd/nand/s3c2410.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Artem Bityutskiy - Nov. 16, 2012, 8:48 a.m.
On Thu, 2012-11-08 at 15:38 +0530, Sachin Kamat wrote:
> The return value of s3c2410_nand_add_partition() is not checked for error
> or success in the calling function. Hence change the return type to void.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

This means you should fix the calling function instead hiding errors.

Patch

diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c
index 295e4be..dfb8636 100644
--- a/drivers/mtd/nand/s3c2410.c
+++ b/drivers/mtd/nand/s3c2410.c
@@ -726,15 +726,15 @@  static int s3c24xx_nand_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info,
+static void s3c2410_nand_add_partition(struct s3c2410_nand_info *info,
 				      struct s3c2410_nand_mtd *mtd,
 				      struct s3c2410_nand_set *set)
 {
 	if (set)
 		mtd->mtd.name = set->name;
 
-	return mtd_device_parse_register(&mtd->mtd, NULL, NULL,
-					 set->partitions, set->nr_partitions);
+	mtd_device_parse_register(&mtd->mtd, NULL, NULL,
+				  set->partitions, set->nr_partitions);
 }
 
 /**