[MTD] mtdchar.c remove shadowed variable warnings

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Jul 11 13:59:01 EDT 2008


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=175428b2b3eeacf90dcc171d5915d6b4dc86e917
Commit:     175428b2b3eeacf90dcc171d5915d6b4dc86e917
Parent:     5f6928378b165c4b0d57a711e1c1eb925ad33846
Author:     Harvey Harrison <harvey.harrison at gmail.com>
AuthorDate: Thu Jul 3 23:40:14 2008 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Jul 11 14:47:25 2008 +0100

    [MTD] mtdchar.c remove shadowed variable warnings
    
    Use einfo, oinfo for the inner erase_info and otp_info structs used in
    individual case statements.
    
    drivers/mtd/mtdchar.c:582:26: warning: symbol 'info' shadows an earlier one
    drivers/mtd/mtdchar.c:380:23: originally declared here
    drivers/mtd/mtdchar.c:596:26: warning: symbol 'info' shadows an earlier one
    drivers/mtd/mtdchar.c:380:23: originally declared here
    drivers/mtd/mtdchar.c:704:19: warning: symbol 'info' shadows an earlier one
    drivers/mtd/mtdchar.c:380:23: originally declared here
    
    Signed-off-by: Harvey Harrison <harvey.harrison at gmail.com>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/mtdchar.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 5fc2c42..f5061fe 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -577,29 +577,29 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 
 	case MEMLOCK:
 	{
-		struct erase_info_user info;
+		struct erase_info_user einfo;
 
-		if (copy_from_user(&info, argp, sizeof(info)))
+		if (copy_from_user(&einfo, argp, sizeof(einfo)))
 			return -EFAULT;
 
 		if (!mtd->lock)
 			ret = -EOPNOTSUPP;
 		else
-			ret = mtd->lock(mtd, info.start, info.length);
+			ret = mtd->lock(mtd, einfo.start, einfo.length);
 		break;
 	}
 
 	case MEMUNLOCK:
 	{
-		struct erase_info_user info;
+		struct erase_info_user einfo;
 
-		if (copy_from_user(&info, argp, sizeof(info)))
+		if (copy_from_user(&einfo, argp, sizeof(einfo)))
 			return -EFAULT;
 
 		if (!mtd->unlock)
 			ret = -EOPNOTSUPP;
 		else
-			ret = mtd->unlock(mtd, info.start, info.length);
+			ret = mtd->unlock(mtd, einfo.start, einfo.length);
 		break;
 	}
 
@@ -699,15 +699,15 @@ static int mtd_ioctl(struct inode *inode, struct file *file,
 
 	case OTPLOCK:
 	{
-		struct otp_info info;
+		struct otp_info oinfo;
 
 		if (mfi->mode != MTD_MODE_OTP_USER)
 			return -EINVAL;
-		if (copy_from_user(&info, argp, sizeof(info)))
+		if (copy_from_user(&oinfo, argp, sizeof(oinfo)))
 			return -EFAULT;
 		if (!mtd->lock_user_prot_reg)
 			return -EOPNOTSUPP;
-		ret = mtd->lock_user_prot_reg(mtd, info.start, info.length);
+		ret = mtd->lock_user_prot_reg(mtd, oinfo.start, oinfo.length);
 		break;
 	}
 #endif



More information about the linux-mtd-cvs mailing list