Re: s3c24xx nand: add command line partition table parsing support (resend)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Russell King - ARM Linux
Date: Thursday, September 18, 2008 - 4:27 am

On Thu, Sep 18, 2008 at 09:13:01AM +0800, Conke Hu wrote:

Why not make the 'name' part of struct s3c2410_nand_mtd?  IOW:

 struct s3c2410_nand_mtd {
 	struct mtd_info 		mtd;
 	struct nand_chip		chip;
 	struct s3c2410_nand_set 	*set;
 	struct s3c2410_nand_info	*info;
 	int				scan_res;
+       char				name[S3C_NAND_NAME_LEN];
 };

That way you can avoid...


This pointer arithmetic.


And this can become the more safe:

		snprintf(nmtd->name, sizeof(nmtd->name), "s3c_nand%d", setno);
		nmtd->mtd.name = nmtd->name;

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: s3c24xx nand: add command line partition table parsing ..., Russell King - ARM Linux, (Thu Sep 18, 4:27 am)
Re: s3c24xx nand: add command line partition table parsing ..., Russell King - ARM Linux, (Thu Oct 9, 9:26 am)