mtd/drivers/mtd/chips jedec_probe.c,1.42,1.43

David Woodhouse dwmw2 at infradead.org
Sun Nov 16 18:09:57 EST 2003


Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv28981

Modified Files:
	jedec_probe.c 
Log Message:
Fix unlock address masking.


Index: jedec_probe.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/jedec_probe.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- jedec_probe.c	16 Nov 2003 23:03:39 -0000	1.42
+++ jedec_probe.c	16 Nov 2003 23:09:54 -0000	1.43
@@ -1560,7 +1560,7 @@
 	}
 
 	/* Mask out address bits which are smaller than the device type */
-	mask = ~((1<<p_cfi->device_type)-1);
+	mask = ~(p_cfi->device_type-1);
 	p_cfi->addr_unlock1 = unlock_addrs[uaddr].addr1 & mask;
 	p_cfi->addr_unlock2 = unlock_addrs[uaddr].addr2 & mask;
 
@@ -1634,7 +1634,7 @@
 		goto match_done;
 	}
 
-	mask = ~((1<<cfi->device_type)-1);
+	mask = ~(cfi->device_type-1);
 
 	DEBUG( MTD_DEBUG_LEVEL3, "MTD %s(): check unlock addrs 0x%.4x 0x%.4x\n",
 	       __func__, cfi->addr_unlock1, cfi->addr_unlock2 );
@@ -1700,7 +1700,7 @@
 
  retry:
 	if (!cfi->numchips) {
-		unsigned long mask = ~((1<<cfi->device_type)-1);
+		unsigned long mask = ~(cfi->device_type-1);
 
 		uaddr_idx++;
 




More information about the linux-mtd-cvs mailing list